#984658 more.c: fix warnings issued by the compiler

Package:
src:nn
Source:
nn
Submitter:
Bjarni Ingi Gislason
Date:
2021-03-06 18:12:03 UTC
Severity:
normal
Tags:
#984658#5
Date:
2021-03-06 18:09:55 UTC
From:
To:
Dear Maintainer,

  Add header file "more.h".

  Comment out declaration of "STANDOUT", is declared in "nn_term.h".

  Fix type of parameter "attrp" in "next_header_field()".

  Fix the type of "hdrattr", it is "fct_type_int", not just "fct_type".

  Add several /* FALLTHROUGH */ to avoid warnings from the compiler.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 more.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/more.c b/more.c
index 99280e0..1da0317 100644
--- a/more.c
+++ b/more.c
@@ -22,6 +22,7 @@
 #include "macro.h"
 #include "match.h"
 #include "menu.h"
+#include "more.h"
 #include "news.h"
 #include "regexp.h"
 #include "save.h"
@@ -69,7 +70,7 @@ extern char    *folder_save_file, *default_save_file;
 extern int      show_art_next_invalid;
 extern int      mouse_y;
 extern int      mouse_state;
-extern int      STANDOUT;
+/* extern int      STANDOUT; */ /* declared in "nn_term.h" */
 extern int      alt_cmd_key, in_menu_mode, any_message;
 extern long     n_selected;

@@ -207,7 +208,7 @@ scan_header_fields(char *fields, article_header * ah)
 }

 int
-next_header_field(char **namep, char **valp, fct_type * attrp)
+next_header_field(char **namep, char **valp, fct_type_int * attrp)
 {
     fct_type        attr;

@@ -391,7 +392,7 @@ more(article_header * ah, int mode, int screen_offset)
     int             match_expr, shade_overlap, shade_line;
     int            *key_map;
     key_type        cur_key;
-    fct_type        hdrattr;
+    fct_type_int    hdrattr;
     char           *match_start, *match_end = NULL;
     int             open_modes, o_mode;

@@ -1116,6 +1117,7 @@ alt_key:
 		    STATE(K_CONTINUE);
 		}
 	    }
+	    /* FALLTHROUGH */
 	    /* fall through??? */

 	case K_NEXT_PAGE:
@@ -1204,6 +1206,7 @@ alt_key:
 		    c = alt_cmd_key;
 		    goto alt_key;
 	    }
+	    /* FALLTHROUGH */
 	    /* XXX: fall-thru? */
 	case K_QUIT:
 	    ah->attr = A_LEAVE_NEXT;
@@ -1485,6 +1488,7 @@ alt_key:
 		regular_expr = regcomp(fname);
 		match_lines = 0;
 	    }
+	    /* FALLTHROUGH *(
 	    /* XXX: fall here? */
 	case K_NEXT_MATCH:
 	    if (regular_expr == NULL) {
@@ -1597,6 +1601,7 @@ alt_key:
 	    if (mode & MM_PREVIEW)
 		more_return(MC_PREVIEW_OTHER);

+	    /* FALLTHROUGH */
 	    /* fall thru to "default" */

 	default: