From 1f007a8cf9b8d48bffac59d6b87e3917ab95a15e Mon Sep 17 00:00:00 2001 From: Klaus Ethgen Date: Sun, 17 Sep 2017 13:45:42 +0100 Subject: [PATCH] Remove some stuff that is throwing errors in gcc-7 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 | 1 - src/collect-table.c | 2 -- src/dupe.c | 7 ------- src/layout_image.c | 12 ------------ src/layout_util.c | 8 -------- src/logwindow.c | 3 --- src/pixbuf-renderer.c | 9 +++------ src/preferences.c | 31 ------------------------------- src/remote.c | 7 +------ src/search.c | 7 ------- src/view_file/view_file.c | 9 --------- 11 files changed, 4 insertions(+), 92 deletions(-) diff --git a/src/bar_exif.c b/src/bar_exif.c index 345e1d2b..fc832097 100644 --- a/src/bar_exif.c +++ b/src/bar_exif.c @@ -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) diff --git a/src/collect-table.c b/src/collect-table.c index 75be016e..2dd3b168 100644 --- a/src/collect-table.c +++ b/src/collect-table.c @@ -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); } diff --git a/src/dupe.c b/src/dupe.c index f52b5609..ff49303e 100644 --- a/src/dupe.c +++ b/src/dupe.c @@ -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; diff --git a/src/layout_image.c b/src/layout_image.c index c6377cb7..e4125a1a 100644 --- a/src/layout_image.c +++ b/src/layout_image.c @@ -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; diff --git a/src/layout_util.c b/src/layout_util.c index e9f107b9..9707d18b 100644 --- a/src/layout_util.c +++ b/src/layout_util.c @@ -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; diff --git a/src/logwindow.c b/src/logwindow.c index eabeecc1..97e61c82 100644 --- a/src/logwindow.c +++ b/src/logwindow.c @@ -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; diff --git a/src/pixbuf-renderer.c b/src/pixbuf-renderer.c index 65f4f14b..2459bf42 100644 --- a/src/pixbuf-renderer.c +++ b/src/pixbuf-renderer.c @@ -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}}; diff --git a/src/preferences.c b/src/preferences.c index dada3700..8ad40cf6 100644 --- a/src/preferences.c +++ b/src/preferences.c @@ -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; diff --git a/src/remote.c b/src/remote.c index e32f2722..28a5be4c 100644 --- a/src/remote.c +++ b/src/remote.c @@ -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_(" "), N_("render thumbnails recursively") }, { "-crs:", "--cache-render-shared:", gr_cache_render_standard, TRUE, FALSE, N_(" "), N_(" render thumbnails (see Help)") }, { "-crsr:", "--cache-render-shared-recurse:", gr_cache_render_standard_recurse, TRUE, FALSE, N_(""), 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) diff --git a/src/search.c b/src/search.c index b78b3be5..190000da 100644 --- a/src/search.c +++ b/src/search.c @@ -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; diff --git a/src/view_file/view_file.c b/src/view_file/view_file.c index 810baf59..de8b14b7 100644 --- a/src/view_file/view_file.c +++ b/src/view_file/view_file.c @@ -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; -- 2.20.1