[geany/geany] cc035a: Merge branch 'gcc-warnings'

Matthew Brush git-noreply at xxxxx
Fri Jan 12 22:07:49 UTC 2018


Branch:      refs/heads/master
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <matt at geany.org>
Date:        Fri, 12 Jan 2018 22:07:49 UTC
Commit:      cc035ab99db99996d6667957a1a15cc93a555f2d
             https://github.com/geany/geany/commit/cc035ab99db99996d6667957a1a15cc93a555f2d

Log Message:
-----------
Merge branch 'gcc-warnings'


Modified Paths:
--------------
    ctags/main/parse.c
    ctags/main/xtag.c
    ctags/parsers/actionscript.c
    ctags/parsers/cobol.c
    ctags/parsers/fortran.c
    ctags/parsers/html.c
    ctags/parsers/perl.c
    ctags/parsers/r.c
    src/build.c
    src/document.c
    src/editor.c
    src/encodings.c
    src/highlighting.c
    src/keybindings.c
    src/search.c
    src/tools.c

Modified: ctags/main/parse.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -103,7 +103,7 @@ extern kindOption* getLanguageFileKind (const langType language)
 
 	kind = LanguageTable [language]->fileKind;
 
-	Assert (kind != KIND_NULL);
+	Assert (kind != NULL);
 
 	return kind;
 }
@@ -316,7 +316,7 @@ static void initializeParserOne (langType lang)
 
 static void initializeParsers (void)
 {
-	int i;
+	unsigned int i;
 	for (i = 0; i < LanguageCount;  i++)
 		initializeParserOne(i);
 }


Modified: ctags/main/xtag.c
10 lines changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -27,18 +27,18 @@ static bool isPseudoTagsEnabled (xtagDesc *pdesc CTAGS_ATTR_UNUSED)
 
 static xtagDesc xtagDescs [] = {
 	{ true, 'F',  "fileScope",
-	  "Include tags of file scope" },
+	  "Include tags of file scope", NULL},
 	{ false, 'f', "inputFile",
-	  "Include an entry for the base file name of every input file"},
+	  "Include an entry for the base file name of every input file", NULL},
 	{ false, 'p', "pseudo",
 	  "Include pseudo tags",
 	  isPseudoTagsEnabled},
 	{ false, 'q', "qualified",
-	  "Include an extra class-qualified tag entry for each tag"},
+	  "Include an extra class-qualified tag entry for each tag", NULL},
 	{ false, 'r', "reference",
-	  "Include reference tags"},
+	  "Include reference tags", NULL},
 	{ false, 's', "subparser",
-	  "Include tags generated by sub parsers"},
+	  "Include tags generated by sub parsers", NULL},
 };
 
 extern xtagDesc* getXtagDesc (xtagType type)


Modified: ctags/parsers/actionscript.c
20 lines changed, 10 insertions(+), 10 deletions(-)
===================================================================
@@ -41,43 +41,43 @@
 static tagRegexTable actionscriptTagRegexTable[] = {
 	/* Functions */
     {"^[ \t]*[(private|public|static|protected|internal|final|override)( \t)]*function[ \t]+([A-Za-z0-9_]+)[ \t]*\\(([^\\{]*)",
-	    "\\1 (\\2", "f,function,functions,methods", NULL},
+	    "\\1 (\\2", "f,function,functions,methods", NULL, NULL},
 
 	/* Getters and setters */
 	{"^[ \t]*[(public|static|internal|final|override)( \t)]*function[ \t]+(set|get)[ \t]+([A-Za-z0-9_]+)[ \t]*\\(",
-		"\\2 \\1", "l,field,fields", NULL},
+		"\\2 \\1", "l,field,fields", NULL, NULL},
 
 	/* Variables */
 	{"^[ \t]*[(private|public|static|protected|internal)( \t)]*var[ \t]+([A-Za-z0-9_]+)([ \t]*\\:[ \t]*([A-Za-z0-9_]+))*[ \t]*",
-		"\\1 \\: \\3", "v,variable,variables", NULL},
+		"\\1 \\: \\3", "v,variable,variables", NULL, NULL},
 
 	/* Constants */
 	{"^[ \t]*[(private|public|static|protected|internal)( \t)]*const[ \t]+([A-Za-z0-9_]+)([ \t]*\\:[ \t]*([A-Za-z0-9_]+))*[ \t]*",
-		"\\1 : \\3", "m,macro,macros", NULL},
+		"\\1 : \\3", "m,macro,macros", NULL, NULL},
 
 	/* Classes */
 	{"^[ \t]*[(private|public|static|dynamic|final|internal)( \t)]*class[ \t]+([A-Za-z0-9_]+)[ \t]*([^\\{]*)",
-		"\\1 (\\2)", "c,class,classes", NULL},
+		"\\1 (\\2)", "c,class,classes", NULL, NULL},
 
 	/* Interfaces */
 	{"^[ \t]*[(private|public|static|dynamic|final|internal)( \t)]*interface[ \t]+([A-Za-z0-9_]+)[ \t]*([^\\{]*)",
-		"\\1 (\\2)", "i,interface,interfaces", NULL},
+		"\\1 (\\2)", "i,interface,interfaces", NULL, NULL},
 
 	/* Packages */
 	{"^[ \t]*[(private|public|static)( \t)]*package[ \t]+([A-Za-z0-9_.]+)[ \t]*",
-		"\\1", "p,package", NULL},
+		"\\1", "p,package", NULL, NULL},
 
 	/* Notes */
 	{"\\/\\/[ \t]*(NOTE|note|Note)[ \t]*\\:*(.*)",
-		"\\2", "o,other"},
+		"\\2", "o,other", NULL, NULL},
 
 	/* Todos */
 	{"\\/\\/[ \t]*(TODO|todo|ToDo|Todo)[ \t]*\\:*(.*)",
-		"\\2", "o,other"},
+		"\\2", "o,other", NULL, NULL},
 
 	/* Prototypes (Put this in for AS1 compatibility...) */
     {".*\\.prototype\\.([A-Za-z0-9 ]+)[ \t]*\\=([ \t]*)function( [ \t]?)*\\(",
-	    "\\1", "r,prototype"}
+	    "\\1", "r,prototype", NULL, NULL}
 };
 
 /*


Modified: ctags/parsers/cobol.c
12 lines changed, 6 insertions(+), 6 deletions(-)
===================================================================
@@ -19,17 +19,17 @@ static tagRegexTable cobolTagRegexTable[] = {
 	{"^[ \t]*[0-9]+[ \t]+([A-Z0-9][A-Z0-9-]*)[ \t]+("
 	 "BLANK|OCCURS|IS|JUST|PIC|REDEFINES|RENAMES|SIGN|SYNC|USAGE|VALUE"
 	 ")", "\\1",
-	 "d,data,data items", "i"},
+	 "d,data,data items", "i", NULL},
 	{"^[ \t]*[FSR]D[ \t]+([A-Z0-9][A-Z0-9-]*)\\.", "\\1",
-	 "f,file,file descriptions (FD, SD, RD)", "i"},
+	 "f,file,file descriptions (FD, SD, RD)", "i", NULL},
 	{"^[ \t]*[0-9]+[ \t]+([A-Z0-9][A-Z0-9-]*)\\.", "\\1",
-	 "g,group,group items", "i"},
+	 "g,group,group items", "i", NULL},
 	{"^[ \t]*([A-Z0-9][A-Z0-9-]*)\\.", "\\1",
-	 "p,paragraph,paragraphs", "i"},
+	 "p,paragraph,paragraphs", "i", NULL},
 	{"^[ \t]*PROGRAM-ID\\.[ \t]+([A-Z0-9][A-Z0-9-]*)\\.", "\\1",
-	 "P,program,program ids", "i"},
+	 "P,program,program ids", "i", NULL},
 	{"^[ \t]*([A-Z0-9][A-Z0-9-]*)[ \t]+SECTION\\.", "\\1",
-	 "s,section,sections", "i"},
+	 "s,section,sections", "i", NULL},
 };
 
 /*


Modified: ctags/parsers/fortran.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -673,7 +673,7 @@ static int getFixedFormChar (void)
 					Column = 6;
 					break;
 				}
-				/* fall through to next case */
+				/* fall through */
 			case LTYPE_CONTINUATION:
 				Column = 5;
 				do
@@ -1001,7 +1001,7 @@ static void readToken (tokenInfo *const token)
 				skipLine ();
 				Column = 0;
 			}
-			/* fall through to newline case */
+			/* fall through */
 		case '\n':
 			token->type = TOKEN_STATEMENT_END;
 			if (FreeSourceForm)


Modified: ctags/parsers/html.c
10 lines changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -20,9 +20,9 @@ static tagRegexTable htmlTagRegexTable [] = {
 	{"<a"
 	 POSSIBLE_ATTRIBUTES "[ \t]+name=\"?([^>\"]+)\"?" POSSIBLE_ATTRIBUTES
 	 "[ \t]*>", "\\2",
-	 "a,anchor,named anchors", "i"},
+	 "a,anchor,named anchors", "i", NULL},
 	{"^[ \t]*function[ \t]*([A-Za-z0-9_]+)[ \t]*\\(", "\\1",
-	 "f,function,JavaScript functions", NULL},
+	 "f,function,JavaScript functions", NULL, NULL},
 
 /* the following matches headings with tags inside like
  * <h1><a href="#id109"><i>Some Text</i></a></h1>
@@ -34,13 +34,13 @@ static tagRegexTable htmlTagRegexTable [] = {
 	ATTRS ">" SPACES "(<" ATTRS ">" SPACES ")*([^<]+).*"
 
 	{"<h1" INNER_HEADING "</h1>", "\\2",
-	 "n,namespace,H1 heading", "i"},
+	 "n,namespace,H1 heading", "i", NULL},
 
 	{"<h2" INNER_HEADING "</h2>", "\\2",
-	 "c,class,H2 heading", "i"},
+	 "c,class,H2 heading", "i", NULL},
 
 	{"<h3" INNER_HEADING "</h3>", "\\2",
-	 "v,variable,H3 heading", "i"},
+	 "v,variable,H3 heading", "i", NULL},
 };
 
 /*


Modified: ctags/parsers/perl.c
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -138,9 +138,11 @@ static bool isSubroutineDeclaration (const unsigned char *cp)
 				case ';':
 					if (!nparens)
 						return true;
+					/* fall through */
 				case '{':
 					if (!nparens)
 						return false;
+					/* fall through */
 				default:
 					if (attr) {
 						if (isIdentifier1(*cp)) {


Modified: ctags/parsers/r.c
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -142,6 +142,7 @@ static void createRTags (void)
 							break;
 						}
 					}
+					/* fall through */
 				case ' ':
 				case '\x009':
 					/* skip whitespace */


Modified: src/build.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2256,7 +2256,7 @@ static void build_load_menu_grp(GKeyFile *config, GeanyBuildCommand **dst, gint
 	gsize prefixlen; /* NOTE prefixlen used in macros above */
 	GeanyBuildCommand *dstcmd;
 	gchar *key;
-	static gchar cmdbuf[3] = "  ";
+	static gchar cmdbuf[4] = "  ";
 
 	if (*dst == NULL)
 		*dst = g_new0(GeanyBuildCommand, build_groups_count[grp]);


Modified: src/document.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -3701,7 +3701,7 @@ gboolean document_check_disk_status(GeanyDocument *doc, gboolean force)
 {
 	gboolean ret = FALSE;
 	gboolean use_gio_filemon;
-	time_t mtime;
+	time_t mtime = 0;
 	gchar *locale_filename;
 	FileDiskStatus old_status;
 


Modified: src/editor.c
7 lines changed, 3 insertions(+), 4 deletions(-)
===================================================================
@@ -2391,6 +2391,8 @@ typedef struct
 
 
 #define CURSOR_PLACEHOLDER "_" /* Would rather use … but not all docs are unicode */
+
+
 /* Replaces the internal cursor markers with the placeholder suitable for
  * display. Except for the first cursor if indicator_for_first is FALSE,
  * which is simply deleted.
@@ -2400,10 +2402,9 @@ typedef struct
 static GSList *replace_cursor_markers(GeanyEditor *editor, GString *template,
 									  gboolean indicator_for_first)
 {
-	gssize cur_index = -1;
 	gint i = 0;
 	GSList *temp_list = NULL;
-	gint cursor_steps = 0, old_cursor = 0;
+	gint cursor_steps = 0;
 	SelectionRange *sel;
 
 	while (TRUE)
@@ -2524,7 +2525,6 @@ void editor_insert_text_block(GeanyEditor *editor, const gchar *text, gint inser
 static gboolean find_next_snippet_indicator(GeanyEditor *editor, SelectionRange *sel)
 {
 	ScintillaObject *sci = editor->sci;
-	gint val;
 	gint pos = sci_get_current_position(sci);
 
 	if (pos == sci_get_length(sci))
@@ -2552,7 +2552,6 @@ static gboolean find_next_snippet_indicator(GeanyEditor *editor, SelectionRange
 gboolean editor_goto_next_snippet_cursor(GeanyEditor *editor)
 {
 	ScintillaObject *sci = editor->sci;
-	gint current_pos = sci_get_current_position(sci);
 	SelectionRange sel;
 
 	if (find_next_snippet_indicator(editor, &sel))


Modified: src/encodings.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -702,7 +702,7 @@ static gchar *encodings_convert_to_utf8_with_suggestion(const gchar *buffer, gss
 	/* First check for preferred charset, if specified */
 	preferred_charset = file_prefs.default_open_encoding;
 
-	if (preferred_charset == encodings[GEANY_ENCODING_NONE].idx ||
+	if (preferred_charset == (gint) encodings[GEANY_ENCODING_NONE].idx ||
 		preferred_charset < 0 ||
 		preferred_charset >= GEANY_ENCODINGS_MAX)
 	{
@@ -712,7 +712,7 @@ static gchar *encodings_convert_to_utf8_with_suggestion(const gchar *buffer, gss
 	/* -1 means "Preferred charset" */
 	for (i = -1; i < GEANY_ENCODINGS_MAX; i++)
 	{
-		if (G_UNLIKELY(i == encodings[GEANY_ENCODING_NONE].idx))
+		if (G_UNLIKELY(i == (gint) encodings[GEANY_ENCODING_NONE].idx))
 			continue;
 
 		if (check_suggestion)


Modified: src/highlighting.c
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -284,10 +284,13 @@ static void parse_keyfile_style(GKeyFile *kf, gchar **list,
 	{
 		case 4:
 			style->italic = utils_atob(list[3]);
+			/* fall through */
 		case 3:
 			style->bold = utils_atob(list[2]);
+			/* fall through */
 		case 2:
 			parse_color(kf, list[1], &style->background);
+			/* fall through */
 		case 1:
 			parse_color(kf, list[0], &style->foreground);
 	}


Modified: src/keybindings.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2614,8 +2614,8 @@ static gboolean cb_func_document_action(guint key_id)
 			{
 				gint line = sci_get_current_line(doc->editor->sci);
 				editor_toggle_fold(doc->editor, line, 0);
-				break;
 			}
+			break;
 		case GEANY_KEYS_DOCUMENT_REMOVE_MARKERS:
 			on_remove_markers1_activate(NULL, NULL);
 			break;


Modified: src/search.c
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -1879,6 +1879,7 @@ static void search_finished(GPid child_pid, gint status, gpointer user_data)
 		}
 		case 1:
 			msg = _("No matches found.");
+			/* fall through */
 		default:
 			msgwin_msg_add_string(COLOR_BLUE, -1, NULL, msg);
 			ui_set_statusbar(FALSE, "%s", msg);


Modified: src/tools.c
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -648,6 +648,7 @@ static void word_count(gchar *text, guint *chars, guint *lines, guint *words)
 		{
 			case '\n':
 				(*lines)++;
+				/* fall through */
 			case '\r':
 			case '\f':
 			case '\t':



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list