Remove some stuff that is throwing errors in gcc-7
authorKlaus Ethgen <Klaus@Ethgen.de>
Sun, 17 Sep 2017 12:45:42 +0000 (13:45 +0100)
committerKlaus Ethgen <Klaus@Ethgen.de>
Sun, 17 Sep 2017 14:15:58 +0000 (15:15 +0100)
New gcc warns (and errors with -Werror) if there are unused functions or
variables.

- Remove two leftover functions from ae34634113b2
- Remove definition made to much in 035c3253ded5
- Remove two variable definitions made in b0b11291d2c9
- Remove not really used function in 15917d4063ce
- Remove two variable definitions made in 5ed2574fb8cc
- Remove variable definition made in efe0e6a38273
- Remove variable definition made in c95bd6996583 and since then removed
  usage
- Remove unused variable definition made in bc02fd0eb0d9
- Remove unused variable definition made in 324129463b17
- Remove two variables left over from fe69cac65ad4 (Pretty old code from
  John Ellis)
- Remove some functions not used anymore with one obsolete variable
- Remove Variables introduced in 8746b22d3ed1 and 51a9455bd33f
- Fix missed change in definition in 6e3b2edff8cf
- Remove unused function from 63a96f8504a2
- Remove unused function from c6bdbaa559c7 (Pretty old code)

src/bar_exif.c
src/collect-table.c
src/dupe.c
src/layout_image.c
src/layout_util.c
src/logwindow.c
src/pixbuf-renderer.c
src/preferences.c
src/remote.c
src/search.c
src/view_file/view_file.c

index 345e1d2..fc83209 100644 (file)
@@ -97,7 +97,6 @@ static void bar_pane_exif_entry_update_title(ExifEntry *ee);
 static void bar_pane_exif_update(PaneExifData *ped);
 static gboolean bar_pane_exif_menu_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);
 static void bar_pane_exif_notify_cb(FileData *fd, NotifyType type, gpointer data);
-static gboolean bar_pane_exif_mouse_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);
 static gboolean bar_pane_exif_copy_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);
 
 static void bar_pane_exif_entry_changed(GtkEntry *text_entry, gpointer data)
index 75be016..2dd3b16 100644 (file)
@@ -803,8 +803,6 @@ static void collection_table_popup_select_invert_cb(GtkWidget *widget, gpointer
 
 static void collection_table_popup_rectangular_selection_cb(GtkWidget *widget, gpointer data)
 {
-       CollectTable *ct = data;
-
        options->collections.rectangular_selection = !(options->collections.rectangular_selection);
 }
 
index f52b560..ff49303 100644 (file)
@@ -2211,13 +2211,6 @@ static void dupe_menu_edit_cb(GtkWidget *widget, gpointer data)
        dupe_window_edit_selected(dw, key);
 }
 
-static void dupe_menu_collection_cb(GtkWidget *widget, gpointer data)
-{
-       DupeWindow *dw = data;
-
-       dupe_window_collection_from_selection(dw);
-}
-
 static void dupe_menu_print_cb(GtkWidget *widget, gpointer data)
 {
        DupeWindow *dw = data;
index c6377cb..e4125a1 100644 (file)
@@ -52,7 +52,6 @@
 
 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw);
 static void layout_image_set_buttons(LayoutWindow *lw);
-static void layout_image_animate_stop(LayoutWindow *lw);
 static gboolean layout_image_animate_new_file(LayoutWindow *lw);
 static void layout_image_animate_update_image(LayoutWindow *lw);
 
@@ -355,17 +354,6 @@ static gboolean layout_image_animate_check(LayoutWindow *lw)
        return TRUE;
 }
 
-static void layout_image_animate_stop(LayoutWindow *lw)
-{
-       if (!layout_valid(&lw)) return;
-
-       if(lw->options.animate && lw->animation)
-               {
-               lw->animation->valid = FALSE;
-               lw->animation = NULL;
-               }
-}
-
 static void layout_image_animate_update_image(LayoutWindow *lw)
 {
        if (!layout_valid(&lw)) return;
index e9f107b..9707d18 100644 (file)
@@ -877,8 +877,6 @@ static void layout_menu_animate_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_rectangular_selection_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = data;
-
        options->collections.rectangular_selection = gtk_toggle_action_get_active(action);
 }
 
@@ -1020,8 +1018,6 @@ static void layout_menu_slideshow_pause_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_slideshow_slower_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = data;
-
        options->slideshow.delay = options->slideshow.delay + 5;
        if (options->slideshow.delay > SLIDESHOW_MAX_SECONDS)
                options->slideshow.delay = SLIDESHOW_MAX_SECONDS;
@@ -1029,8 +1025,6 @@ static void layout_menu_slideshow_slower_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_slideshow_faster_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = data;
-
        options->slideshow.delay = options->slideshow.delay - 5;
        if (options->slideshow.delay < SLIDESHOW_MIN_SECONDS * 10)
                options->slideshow.delay = SLIDESHOW_MIN_SECONDS * 10;
@@ -1167,7 +1161,6 @@ static void layout_menu_foreach_func(
 
 static void layout_menu_kbd_map_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = data;
        gint fd = -1;
        GPtrArray *array;
        char * tmp_file;
@@ -2447,7 +2440,6 @@ static void layout_actions_setup_editors(LayoutWindow *lw)
 void layout_actions_setup(LayoutWindow *lw)
 {
        GError *error;
-       gint i;
 
        DEBUG_1("%s layout_actions_setup: start", get_exec_time());
        if (lw->ui_manager) return;
index eabeecc..97e61c8 100644 (file)
@@ -108,8 +108,6 @@ static void log_window_line_wrap_cb(GtkWidget *widget, gpointer data)
 
 static void log_window_timer_data_cb(GtkWidget *widget, gpointer data)
 {
-       LogWindow *logwin = data;
-
        options->log_window.timer_data = !options->log_window.timer_data;
 }
 
@@ -135,7 +133,6 @@ static LogWindow *log_window_create(LayoutWindow *lw)
        GtkWidget *text;
        GtkTextBuffer *buffer;
        GtkTextIter iter;
-       GtkWidget *button;
        GtkWidget *win_vbox;
        GtkWidget *textbox;
        GtkWidget *hbox;
index 65f4f14..2459bf4 100644 (file)
@@ -920,9 +920,6 @@ static void pr_scroller_stop(PixbufRenderer *pr)
 
 void pixbuf_renderer_set_color(PixbufRenderer *pr, GdkColor *color)
 {
-       GtkStyle *style;
-       GtkWidget *widget;
-
        g_return_if_fail(IS_PIXBUF_RENDERER(pr));
 
        if (color)
@@ -2298,15 +2295,15 @@ static void pr_create_anaglyph_dubois(GdkPixbuf *pixbuf, GdkPixbuf *right, gint
        guchar *spi, *dpi;
        gint i, j, k;
        double pr_dubois_matrix[3][6];
-       const static double pr_dubois_matrix_RC[3][6] = {
+       static const double pr_dubois_matrix_RC[3][6] = {
                { 0.456,  0.500,  0.176, -0.043, -0.088, -0.002},
                {-0.040, -0.038, -0.016,  0.378,  0.734, -0.018},
                {-0.015, -0.021, -0.005, -0.072, -0.113,  1.226}};
-       const static double pr_dubois_matrix_GM[3][6] = {
+       static const double pr_dubois_matrix_GM[3][6] = {
                {-0.062, -0.158, -0.039,  0.529,  0.705,  0.024},
                { 0.284,  0.668,  0.143, -0.016, -0.015, -0.065},
                {-0.015, -0.027,  0.021,  0.009,  0.075,  0.937}};
-       const static double pr_dubois_matrix_YB[3][6] = {
+       static const double pr_dubois_matrix_YB[3][6] = {
                { 1.000, -0.193,  0.282, -0.015, -0.116, -0.016},
                {-0.024,  0.855,  0.064,  0.006,  0.058, -0.016},
                {-0.036, -0.163,  0.021,  0.089,  0.174,  0.858}};
index dada370..8ad40cf 100644 (file)
@@ -140,12 +140,6 @@ static GtkWidget *sidecar_ext_entry;
  *-----------------------------------------------------------------------------
  */
 
-static void scroll_reset_cb(GtkWidget *widget, gpointer data)
-{
-       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
-               c_options->image.scroll_reset_method = GPOINTER_TO_INT(data);
-}
-
 static void zoom_increment_cb(GtkWidget *spin, gpointer data)
 {
        c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 100.0 + 0.01);
@@ -1546,9 +1540,7 @@ static void config_tab_image(GtkWidget *notebook)
 {
        GtkWidget *hbox;
        GtkWidget *vbox;
-       GtkWidget *vbox2;
        GtkWidget *group;
-       GtkWidget *button;
        GtkWidget *ct_button;
        GtkWidget *enlargement_button;
        GtkWidget *table;
@@ -2540,29 +2532,6 @@ void show_config_window(void)
  *-----------------
  */
 
-static GtkWidget *about = NULL;
-
-static gboolean about_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
-{
-       gtk_widget_destroy(about);
-       about = NULL;
-
-       return TRUE;
-}
-
-static void about_window_close(GtkWidget *widget, gpointer data)
-{
-       if (!about) return;
-
-       gtk_widget_destroy(about);
-       about = NULL;
-}
-
-static void about_credits_cb(GtkWidget *widget, gpointer data)
-{
-       help_window_show("credits");
-}
-
 void show_about_window(LayoutWindow *lw)
 {
        GdkPixbuf *pixbuf_logo;
index e32f272..28a5be4 100644 (file)
@@ -452,11 +452,6 @@ static void gr_cache_metadata(const gchar *text, GIOChannel *channel, gpointer d
        cache_maintain_home_remote(TRUE, FALSE);
 }
 
-static void gr_cache_clear(const gchar *text, GIOChannel *channel, gpointer data)
-{
-       cache_maintain_home_remote(FALSE, TRUE);
-}
-
 static void gr_cache_render(const gchar *text, GIOChannel *channel, gpointer data)
 {
        cache_manager_render_remote(text, FALSE, FALSE);
@@ -748,7 +743,7 @@ static RemoteCommandEntry remote_commands[] = {
        { "-crr:", "--cache-render-recurse:", gr_cache_render_recurse, TRUE, FALSE, N_("<folder> "), N_("render thumbnails recursively") },
        { "-crs:", "--cache-render-shared:", gr_cache_render_standard, TRUE, FALSE, N_("<folder> "), N_(" render thumbnails (see Help)") },
        { "-crsr:", "--cache-render-shared-recurse:", gr_cache_render_standard_recurse, TRUE, FALSE, N_("<folder>"), N_(" render thumbnails recursively (see Help)") },
-       { NULL, NULL, NULL, FALSE, FALSE, NULL }
+       { NULL, NULL, NULL, FALSE, FALSE, NULL, NULL }
 };
 
 static RemoteCommandEntry *remote_command_find(const gchar *text, const gchar **offset)
index b78b3be..190000d 100644 (file)
@@ -959,13 +959,6 @@ static void sr_menu_edit_cb(GtkWidget *widget, gpointer data)
        search_result_edit_selected(sd, key);
 }
 
-static void sr_menu_collection_cb(GtkWidget *widget, gpointer data)
-{
-       SearchData *sd = data;
-
-       search_result_collection_from_selection(sd);
-}
-
 static void sr_menu_print_cb(GtkWidget *widget, gpointer data)
 {
        SearchData *sd = data;
index 810baf5..de8b14b 100644 (file)
@@ -376,15 +376,6 @@ static void vf_pop_menu_duplicates_cb(GtkWidget *widget, gpointer data)
        dupe_window_add_files(dw, vf_pop_menu_file_list(vf), FALSE);
 }
 
-static void vf_pop_menu_add_collection_cb(GtkWidget *widget, gpointer data)
-{
-       ViewFile *vf = data;
-       CollectWindow *w;
-
-       w = collection_window_new(NULL);
-       collection_table_add_filelist(w->table, vf_pop_menu_file_list(vf));
-}
-
 static void vf_pop_menu_disable_grouping_cb(GtkWidget *widget, gpointer data)
 {
        ViewFile *vf = data;