Fixes compile warnings in files touched by the "C++ keywords" change
authorOmari Stephens <xsdg@xsdg.org>
Mon, 8 Aug 2022 00:50:56 +0000 (00:50 +0000)
committerColin Clark <colin.clark@cclark.uk>
Mon, 8 Aug 2022 14:47:59 +0000 (15:47 +0100)
Note that the -Wpedantic function pointer warnings aren't fixable, given the GLIB/GTK API design:
https://stackoverflow.com/a/14134283

src/search.c

index 43bcf8f..59f243e 100644 (file)
@@ -2322,9 +2322,9 @@ static gboolean search_file_next(SearchData *sd)
                {
                tested = TRUE;
                match = FALSE;
-               gint search_marks;
-               gint i;
-               gchar *marks_string;
+               gint search_marks = -1;
+               gint i = 0;
+               gchar *marks_string = NULL;
 
                if (g_strcmp0(gtk_combo_box_text_get_active_text(
                                                GTK_COMBO_BOX_TEXT(sd->marks_type)), _("Any mark")) == 0)
@@ -2350,6 +2350,7 @@ static gboolean search_file_next(SearchData *sd)
                                        search_marks = 1 << i;
                                        }
                                g_free(marks_string);
+                               marks_string = NULL;
                                }
                        }