From: Colin Clark Date: Fri, 6 Aug 2021 15:37:39 +0000 (+0100) Subject: Clean up some compile warnings and errors X-Git-Tag: v1.7~80 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=40502fa6fc4d253905c8d49da1c22500fce60e8c Clean up some compile warnings and errors Also remove the Guidelines overlay feature. --- diff --git a/src/dupe.c b/src/dupe.c index f9c624e9..d76452a2 100644 --- a/src/dupe.c +++ b/src/dupe.c @@ -485,6 +485,7 @@ static DupeItem *dupe_item_find_fd(DupeWindow *dw, FileData *fd) } */ +/* static DupeItem *dupe_item_find_path_by_list(const gchar *path, GList *work) { while (work) @@ -498,7 +499,9 @@ static DupeItem *dupe_item_find_path_by_list(const gchar *path, GList *work) return NULL; } +*/ +/* static DupeItem *dupe_item_find_path(DupeWindow *dw, const gchar *path) { DupeItem *di; @@ -508,6 +511,7 @@ static DupeItem *dupe_item_find_path(DupeWindow *dw, const gchar *path) return di; } +*/ /* * ------------------------------------------------------------------ @@ -1847,7 +1851,6 @@ static void dupe_array_check(DupeWindow *dw ) gint i_set1; gint i_set2; DUPE_CHECK_RESULT check_result; - DupeMatchType mask = dw->match_mask; param_match_mask = dw->match_mask; guint out_match_index; gboolean match_found = FALSE;; @@ -1876,7 +1879,6 @@ static void dupe_array_check(DupeWindow *dw ) work = dw->second_list; while (work) { - DupeItem *di = work->data; g_array_append_val(array_set2, (work->data)); work = work->next; } @@ -2710,6 +2712,7 @@ static void dupe_item_remove(DupeWindow *dw, DupeItem *di) dupe_window_update_count(dw, FALSE); } +/* static gboolean dupe_item_remove_by_path(DupeWindow *dw, const gchar *path) { DupeItem *di; @@ -2721,6 +2724,7 @@ static gboolean dupe_item_remove_by_path(DupeWindow *dw, const gchar *path) return TRUE; } +*/ static gboolean dupe_files_add_queue_cb(gpointer data) { @@ -5157,7 +5161,6 @@ static void dupe_notify_cb(FileData *fd, NotifyType type, gpointer data) static void delete_finished_cb(gboolean success, const gchar *dest_path, gpointer data) { DupeWindow *dw = data; - GList *work; if (!success) { diff --git a/src/icons/Makefile.am b/src/icons/Makefile.am index f8009e9c..9f05bf67 100644 --- a/src/icons/Makefile.am +++ b/src/icons/Makefile.am @@ -22,7 +22,6 @@ ICONS_INLINE = \ icon_config.png \ icon_tools.png \ icon_view.png \ - icon_guidelines.png \ icon_panorama.png \ icon_maintenance.png \ icon_zoomfillhor.png \ @@ -72,7 +71,6 @@ ICONS_INLINE_PAIRS = \ icon_config $(srcdir)/icon_config.png \ icon_tools $(srcdir)/icon_tools.png \ icon_view $(srcdir)/icon_view.png \ - icon_guidelines $(srcdir)/icon_guidelines.png \ icon_panorama $(srcdir)/icon_panorama.png \ icon_maintenance $(srcdir)/icon_maintenance.png \ icon_zoomfillhor $(srcdir)/icon_zoomfillhor.png \ diff --git a/src/icons/icon_guidelines.png b/src/icons/icon_guidelines.png deleted file mode 100644 index 1fb81fae..00000000 Binary files a/src/icons/icon_guidelines.png and /dev/null differ diff --git a/src/image-overlay.c b/src/image-overlay.c index 90d4c783..8e0423b3 100644 --- a/src/image-overlay.c +++ b/src/image-overlay.c @@ -212,15 +212,10 @@ void image_osd_toggle(ImageWindow *imd) } else { - if (show & OSD_SHOW_GUIDELINES) + if (show & OSD_SHOW_HISTOGRAM) { image_osd_set(imd, OSD_SHOW_NOTHING); } - else if (show & OSD_SHOW_HISTOGRAM) - { - image_osd_set(imd, OSD_SHOW_GUIDELINES); - image_osd_set(imd, show | ~OSD_SHOW_HISTOGRAM); - } else { image_osd_set(imd, show | OSD_SHOW_HISTOGRAM); @@ -515,42 +510,6 @@ static GdkPixbuf *image_osd_icon_pixbuf(ImageOSDFlag flag) return icon; } -static GdkPixbuf *image_osd_guidelines_render(OverlayStateData *osd) -{ - gint width, height; - GdkPixbuf *rectangles; - ImageWindow *imd = osd->imd; - -/** @FIXME guidelines does not work with revised draw signal handling - */ - //~ pixbuf_renderer_get_scaled_size((PixbufRenderer *)imd->pr, &width, &height); - - //~ if (width && height) - //~ { - //~ rectangles = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); - //~ if (rectangles) - //~ { - //~ pixbuf_set_rect_fill(rectangles, 0, 0, width, height, 255, 255, 255, 0); - //~ pixbuf_set_rect(rectangles, 0, 0 + (height / 3), width, height / 3, - //~ 0, 0, 0, 255, - //~ 1, 1, 1, 1); - //~ pixbuf_set_rect(rectangles, 0, 0 + (height / 3 + 1), width, height / 3 - 2, - //~ 255, 255, 255, 255, - //~ 1, 1, 1, 1); - - //~ pixbuf_set_rect(rectangles, 0 + width / 3, 0 , width / 3, height, - //~ 0, 0, 0, 255, - //~ 1, 1, 1, 1); - //~ pixbuf_set_rect(rectangles, 0 + width / 3 + 1, 0, width / 3 - 2, height, - //~ 255, 255, 255, 255, - //~ 1, 1, 1, 1); - //~ return rectangles; - //~ } - //~ } - - return NULL; -} - static gint image_overlay_add(ImageWindow *imd, GdkPixbuf *pixbuf, gint x, gint y, OverlayRendererFlags flags) { @@ -660,41 +619,19 @@ static gboolean image_osd_update_cb(gpointer data) with histogram we have to redraw also when loading is finished */ if (osd->changed_states & IMAGE_STATE_IMAGE || (osd->changed_states & IMAGE_STATE_LOADING && osd->show & OSD_SHOW_HISTOGRAM) || - (osd->changed_states & IMAGE_STATE_LOADING && osd->show & OSD_SHOW_GUIDELINES) || osd->notify & NOTIFY_HISTMAP) { GdkPixbuf *pixbuf; - if (osd->show & OSD_SHOW_GUIDELINES) + pixbuf = image_osd_info_render(osd); + if (pixbuf) { - ImageWindow *imd = osd->imd; - osd->x = ((PixbufRenderer *)imd->pr)->x_offset; - osd->y = ((PixbufRenderer *)imd->pr)->y_offset; - osd->origin = OVL_NORMAL; - - pixbuf = image_osd_guidelines_render(osd); - if (pixbuf) - { - image_osd_info_show(osd, pixbuf); - g_object_unref(pixbuf); - } - - osd->x = options->image_overlay.x; - osd->y = options->image_overlay.y; - osd->origin = OVL_RELATIVE; + image_osd_info_show(osd, pixbuf); + g_object_unref(pixbuf); } else { - pixbuf = image_osd_info_render(osd); - if (pixbuf) - { - image_osd_info_show(osd, pixbuf); - g_object_unref(pixbuf); - } - else - { - image_osd_info_hide(osd); - } + image_osd_info_hide(osd); } } } diff --git a/src/image-overlay.h b/src/image-overlay.h index 9792f4f0..ae72dca8 100644 --- a/src/image-overlay.h +++ b/src/image-overlay.h @@ -37,8 +37,7 @@ typedef enum { OSD_SHOW_NOTHING = 0, OSD_SHOW_INFO = 1 << 0, OSD_SHOW_STATUS = 1 << 1, - OSD_SHOW_HISTOGRAM = 1 << 2, - OSD_SHOW_GUIDELINES = 1 << 3 + OSD_SHOW_HISTOGRAM = 1 << 2 } OsdShowFlags; void set_image_overlay_template_string(gchar **template_string, const gchar *value); diff --git a/src/layout.c b/src/layout.c index fae646b2..f750ab14 100644 --- a/src/layout.c +++ b/src/layout.c @@ -2497,9 +2497,6 @@ void save_layout(LayoutWindow *lw) void layout_close(LayoutWindow *lw) { - GList *list; - LayoutWindow *tmp_lw; - if (layout_window_list && layout_window_list->next) { save_layout(lw); @@ -3051,7 +3048,6 @@ void layout_update_from_config(LayoutWindow *lw, const gchar **attribute_names, LayoutWindow *layout_new_from_default() { LayoutWindow *lw; - gchar *path = NULL; GList *work; gboolean success; gchar *default_path; diff --git a/src/layout_util.c b/src/layout_util.c index 9a2cb590..82237e5c 100644 --- a/src/layout_util.c +++ b/src/layout_util.c @@ -950,23 +950,6 @@ static void layout_menu_histogram_cb(GtkToggleAction *action, gpointer data) } } -static void layout_menu_guidelines_cb(GtkToggleAction *action, gpointer data) -{ - LayoutWindow *lw = data; - - if (gtk_toggle_action_get_active(action)) - { - image_osd_set(lw->image, OSD_SHOW_INFO | OSD_SHOW_STATUS | OSD_SHOW_GUIDELINES); - layout_util_sync_views(lw); - } - else - { - OsdShowFlags flags = image_osd_get(lw->image); - if (flags & OSD_SHOW_GUIDELINES) - image_osd_set(lw->image, OSD_SHOW_NOTHING); - } -} - static void layout_menu_animate_cb(GtkToggleAction *action, gpointer data) { LayoutWindow *lw = data; @@ -1289,7 +1272,8 @@ static void layout_menu_kbd_map_cb(GtkAction *action, gpointer data) GIOChannel *channel; char **pre_key, **post_key; char *key_name, *converted_line; - int keymap_index, index; + int keymap_index; + guint index; fd = g_file_open_tmp("geeqie_keymap_XXXXXX.svg", &tmp_file, &error); if (error) @@ -2572,7 +2556,6 @@ static GtkToggleActionEntry menu_toggle_entries[] = { { "Grayscale", PIXBUF_INLINE_ICON_GRAYSCALE, N_("Toggle _grayscale"), "G", N_("Toggle grayscale"), CB(layout_menu_alter_desaturate_cb), FALSE}, { "ImageOverlay", NULL, N_("Image _Overlay"), NULL, N_("Image Overlay"), CB(layout_menu_overlay_cb), FALSE }, { "ImageHistogram", NULL, N_("_Show Histogram"), NULL, N_("Show Histogram"), CB(layout_menu_histogram_cb), FALSE }, - { "ImageGuidelines", PIXBUF_INLINE_ICON_GUIDELINES, N_("_Show Guidelines"), NULL, N_("Show Guidelines"), CB(layout_menu_guidelines_cb), FALSE }, { "RectangularSelection", PIXBUF_INLINE_ICON_SELECT_RECTANGLE, N_("Rectangular Selection"), "R", N_("Rectangular Selection"), CB(layout_menu_rectangular_selection_cb), FALSE }, { "Animate", NULL, N_("GIF _animation"), "A", N_("Toggle GIF animation"), CB(layout_menu_animate_cb), FALSE }, { "ExifRotate", GTK_STOCK_ORIENTATION_PORTRAIT, N_("_Exif rotate"), "X", N_("Exif rotate"), CB(layout_menu_exif_rotate_cb), FALSE }, @@ -2824,7 +2807,6 @@ static const gchar *menu_ui_description = " " " " " " -" " " " " " " " @@ -3768,9 +3750,6 @@ static void layout_util_sync_views(LayoutWindow *lw) action = gtk_action_group_get_action(lw->action_group, "ImageHistogram"); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), osd_flags & OSD_SHOW_HISTOGRAM); - action = gtk_action_group_get_action(lw->action_group, "ImageGuidelines"); - gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), osd_flags & OSD_SHOW_GUIDELINES); - action = gtk_action_group_get_action(lw->action_group, "ExifRotate"); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), options->image.exif_rotate_enable); diff --git a/src/logwindow.c b/src/logwindow.c index bde86d38..5ead4697 100644 --- a/src/logwindow.c +++ b/src/logwindow.c @@ -43,7 +43,7 @@ struct _LogWindow GtkTextTag *color_tags[LOG_COUNT]; #endif - guint lines; + gint lines; GtkWidget *regexp_box; GtkWidget *bar; GtkWidget *pause; @@ -128,11 +128,6 @@ static void log_window_regexp_cb(GtkWidget *text_entry, gpointer data) g_free(new_regexp); } -static void log_window_debug_spin_cb(GtkSpinButton *debug_level, gpointer data) -{ - set_debug_level(gtk_spin_button_get_value(debug_level)); -} - static void remove_green_bg(LogWindow *logwin) { GtkTextIter start_find; @@ -648,7 +643,7 @@ void log_window_append(const gchar *str, LogType type) memory = g_list_prepend(memory, msg); - while (g_list_length(memory) >= options->log_window_lines) + while (g_list_length(memory) >= (guint)options->log_window_lines) { GList *work = g_list_last(memory); LogMsg *oldest_msg = work->data; diff --git a/src/main.c b/src/main.c index ee4de769..57e17f68 100644 --- a/src/main.c +++ b/src/main.c @@ -1136,7 +1136,6 @@ static void create_application_paths() { gchar buf[1024]; gchar *dirname; - gchar *basename; gchar *tmp; memset(buf, 0, sizeof(buf)); diff --git a/src/options.h b/src/options.h index c1f9256e..3db05f71 100644 --- a/src/options.h +++ b/src/options.h @@ -35,7 +35,6 @@ struct _ConfOptions gchar *image_l_click_video_editor; gboolean show_icon_names; gboolean show_star_rating; - gboolean show_guidelines; gboolean draw_rectangle; gboolean show_predefined_keyword_tree; gboolean overunderexposed; diff --git a/src/pixbuf_util.c b/src/pixbuf_util.c index 9d10630f..842396ee 100644 --- a/src/pixbuf_util.c +++ b/src/pixbuf_util.c @@ -120,7 +120,6 @@ static PixbufInline inline_pixbuf_data[] = { { PIXBUF_INLINE_ICON_CONFIG, icon_config }, { PIXBUF_INLINE_ICON_TOOLS, icon_tools }, { PIXBUF_INLINE_ICON_VIEW, icon_view }, - { PIXBUF_INLINE_ICON_GUIDELINES, icon_guidelines }, { PIXBUF_INLINE_ICON_PANORAMA, icon_panorama }, { PIXBUF_INLINE_ICON_MAINTENANCE, icon_maintenance }, { PIXBUF_INLINE_ICON_ZOOMFILLHOR, icon_zoomfillhor }, diff --git a/src/pixbuf_util.h b/src/pixbuf_util.h index 6c8347c0..8aa56846 100644 --- a/src/pixbuf_util.h +++ b/src/pixbuf_util.h @@ -54,7 +54,6 @@ gboolean pixbuf_scale_aspect(gint req_w, gint req_h, gint old_w, gint old_h, gin #define PIXBUF_INLINE_ICON_CONFIG "icon_config" #define PIXBUF_INLINE_ICON_TOOLS "icon_tools" #define PIXBUF_INLINE_ICON_VIEW "icon_view" -#define PIXBUF_INLINE_ICON_GUIDELINES "icon_guidelines" #define PIXBUF_INLINE_ICON_PANORAMA "icon_panorama" #define PIXBUF_INLINE_ICON_MAINTENANCE "icon_maintenance" #define PIXBUF_INLINE_ICON_ZOOMFILLHOR "icon_zoomfillhor" diff --git a/src/preferences.c b/src/preferences.c index 476b4812..f270f6aa 100644 --- a/src/preferences.c +++ b/src/preferences.c @@ -782,7 +782,6 @@ static const UseableMouseItems useable_mouse_items[] = { {"ExifWin", N_("Exif window"), PIXBUF_INLINE_ICON_EXIF}, {"Thumbnails", N_("Show thumbnails"), PIXBUF_INLINE_ICON_THUMB}, {"ShowMarks", N_("Show marks"), PIXBUF_INLINE_ICON_MARKS}, - {"ImageGuidelines", N_("Show guidelines"), PIXBUF_INLINE_ICON_GUIDELINES}, {"DrawRectangle", N_("Draw Rectangle"), PIXBUF_INLINE_ICON_DRAW_RECTANGLE}, {"FloatTools", N_("Float file list"), PIXBUF_INLINE_ICON_FLOAT}, {"SBar", N_("Info sidebar"), PIXBUF_INLINE_ICON_INFO}, diff --git a/src/rcfile.c b/src/rcfile.c index 8c90aec1..3e04027d 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -307,7 +307,6 @@ static void write_global_attributes(GString *outstr, gint indent) /* General Options */ WRITE_NL(); WRITE_BOOL(*options, show_icon_names); WRITE_NL(); WRITE_BOOL(*options, show_star_rating); - WRITE_NL(); WRITE_BOOL(*options, show_guidelines); WRITE_NL(); WRITE_BOOL(*options, show_predefined_keyword_tree); WRITE_SEPARATOR(); @@ -801,7 +800,6 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** /* General options */ if (READ_BOOL(*options, show_icon_names)) continue; if (READ_BOOL(*options, show_star_rating)) continue; - if (READ_BOOL(*options, show_guidelines)) continue; if (READ_BOOL(*options, show_predefined_keyword_tree)) continue; if (READ_BOOL(*options, tree_descend_subdirs)) continue; diff --git a/src/renderer-tiles.c b/src/renderer-tiles.c index a8f0a7d5..e9938960 100644 --- a/src/renderer-tiles.c +++ b/src/renderer-tiles.c @@ -2024,8 +2024,6 @@ static void rt_scroll(void *renderer, gint x_off, gint y_off) { gint x1, y1; gint x2, y2; - GtkWidget *box; - GdkWindow *window; cairo_t *cr; cairo_surface_t *surface; @@ -2055,6 +2053,9 @@ static void rt_scroll(void *renderer, gint x_off, gint y_off) cr = cairo_create(rt->surface); surface = rt->surface; #else + GtkWidget *box; + GdkWindow *window; + box = GTK_WIDGET(pr); window = gtk_widget_get_window(box); diff --git a/src/search.c b/src/search.c index 1b8da57f..f46e94dc 100644 --- a/src/search.c +++ b/src/search.c @@ -2219,7 +2219,7 @@ static gboolean search_file_next(SearchData *sd) { tested = TRUE; match = FALSE; - gint class; + FileFormatClass class; FileFormatClass search_class; if (g_strcmp0(gtk_combo_box_text_get_active_text( diff --git a/src/toolbar.c b/src/toolbar.c index 932e7f5c..9d229c8c 100644 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -142,7 +142,6 @@ static const UseableToolbarItems useable_toolbar_items[] = { {"ExifWin", N_("Exif window"), PIXBUF_INLINE_ICON_EXIF}, {"Thumbnails", N_("Show thumbnails"), PIXBUF_INLINE_ICON_THUMB}, {"ShowMarks", N_("Show marks"), PIXBUF_INLINE_ICON_MARKS}, - {"ImageGuidelines", N_("Show guidelines"), PIXBUF_INLINE_ICON_GUIDELINES}, {"DrawRectangle", N_("Draw Rectangle"), PIXBUF_INLINE_ICON_DRAW_RECTANGLE}, {"FloatTools", N_("Float file list"), PIXBUF_INLINE_ICON_FLOAT}, {"SBar", N_("Info sidebar"), PIXBUF_INLINE_ICON_INFO}, diff --git a/src/typedefs.h b/src/typedefs.h index d9c5e04a..1625b518 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -398,7 +398,7 @@ struct _AnimationData GdkPixbufAnimationIter *iter; GdkPixbuf *gpb; FileData *data_adr; - guint delay; + gint delay; gboolean valid; GCancellable *cancellable; GFile *in_file; diff --git a/src/ui_utildlg.c b/src/ui_utildlg.c index 853f957d..413f936f 100644 --- a/src/ui_utildlg.c +++ b/src/ui_utildlg.c @@ -457,6 +457,7 @@ static void generic_dialog_setup(GenericDialog *gd, gtk_window_set_resizable(GTK_WINDOW(gd->dialog), TRUE); gtk_container_set_border_width(GTK_CONTAINER(gd->dialog), PREF_PAD_BORDER); +#if GTK_CHECK_VERSION(3,22,0) scrolled = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW(scrolled), TRUE); gtk_scrolled_window_set_propagate_natural_width(GTK_SCROLLED_WINDOW(scrolled), TRUE); @@ -464,6 +465,9 @@ static void generic_dialog_setup(GenericDialog *gd, gtk_container_add(GTK_CONTAINER(scrolled), vbox); gtk_container_add(GTK_CONTAINER(gd->dialog), scrolled); gtk_widget_show(scrolled); +#else + vbox = gtk_vbox_new(FALSE, PREF_PAD_BUTTON_SPACE); +#endif gtk_widget_show(vbox); gd->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); diff --git a/src/view_file/view_file.c b/src/view_file/view_file.c index 58172584..fdea4356 100644 --- a/src/view_file/view_file.c +++ b/src/view_file/view_file.c @@ -77,11 +77,16 @@ FileData *vf_index_get_data(ViewFile *vf, gint row) gint vf_index_by_fd(ViewFile *vf, FileData *fd) { + gint ret; + switch (vf->type) { - case FILEVIEW_LIST: return vflist_index_by_fd(vf, fd); - case FILEVIEW_ICON: return vficon_index_by_fd(vf, fd); + case FILEVIEW_LIST: ret = vflist_index_by_fd(vf, fd); break; + case FILEVIEW_ICON: ret = vficon_index_by_fd(vf, fd); break; + default: ret = 0; } + + return ret; } guint vf_count(ViewFile *vf, gint64 *bytes) @@ -128,12 +133,16 @@ GList *vf_get_list(ViewFile *vf) static gboolean vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) { ViewFile *vf = data; + gboolean ret; switch (vf->type) { - case FILEVIEW_LIST: return vflist_press_key_cb(widget, event, data); - case FILEVIEW_ICON: return vficon_press_key_cb(widget, event, data); + case FILEVIEW_LIST: ret = vflist_press_key_cb(widget, event, data); break; + case FILEVIEW_ICON: ret = vficon_press_key_cb(widget, event, data); break; + default: ret = FALSE; } + + return ret; } /* @@ -145,23 +154,31 @@ static gboolean vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer static gboolean vf_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) { ViewFile *vf = data; + gboolean ret; switch (vf->type) { - case FILEVIEW_LIST: return vflist_press_cb(widget, bevent, data); - case FILEVIEW_ICON: return vficon_press_cb(widget, bevent, data); + case FILEVIEW_LIST: ret = vflist_press_cb(widget, bevent, data); break; + case FILEVIEW_ICON: ret = vficon_press_cb(widget, bevent, data); break; + default: ret = FALSE; } + + return ret; } static gboolean vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) { ViewFile *vf = data; + gboolean ret; switch (vf->type) { - case FILEVIEW_LIST: return vflist_release_cb(widget, bevent, data); - case FILEVIEW_ICON: return vficon_release_cb(widget, bevent, data); + case FILEVIEW_LIST: ret = vflist_release_cb(widget, bevent, data); break; + case FILEVIEW_ICON: ret = vficon_release_cb(widget, bevent, data); break; + default: ret = FALSE; } + + return ret; } @@ -173,29 +190,44 @@ static gboolean vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointe guint vf_selection_count(ViewFile *vf, gint64 *bytes) { + guint ret; + switch (vf->type) { - case FILEVIEW_LIST: return vflist_selection_count(vf, bytes); - case FILEVIEW_ICON: return vficon_selection_count(vf, bytes); + case FILEVIEW_LIST: ret = vflist_selection_count(vf, bytes); break; + case FILEVIEW_ICON: ret = vficon_selection_count(vf, bytes); break; + default: ret = 0; } + + return ret; } GList *vf_selection_get_list(ViewFile *vf) { + GList *ret; + switch (vf->type) { - case FILEVIEW_LIST: return vflist_selection_get_list(vf); - case FILEVIEW_ICON: return vficon_selection_get_list(vf); + case FILEVIEW_LIST: ret = vflist_selection_get_list(vf); break; + case FILEVIEW_ICON: ret = vficon_selection_get_list(vf); break; + default: ret = NULL; } + + return ret; } GList *vf_selection_get_list_by_index(ViewFile *vf) { + GList *ret; + switch (vf->type) { - case FILEVIEW_LIST: return vflist_selection_get_list_by_index(vf); - case FILEVIEW_ICON: return vficon_selection_get_list_by_index(vf); + case FILEVIEW_LIST: ret = vflist_selection_get_list_by_index(vf); break; + case FILEVIEW_ICON: ret = vficon_selection_get_list_by_index(vf); break; + default: ret = NULL; } + + return ret; } void vf_select_all(ViewFile *vf) @@ -285,20 +317,30 @@ static void vf_dnd_init(ViewFile *vf) GList *vf_pop_menu_file_list(ViewFile *vf) { + GList *ret; + switch (vf->type) { - case FILEVIEW_LIST: return vflist_pop_menu_file_list(vf); - case FILEVIEW_ICON: return vficon_pop_menu_file_list(vf); + case FILEVIEW_LIST: ret = vflist_pop_menu_file_list(vf); break; + case FILEVIEW_ICON: ret = vficon_pop_menu_file_list(vf); break; + default: ret = NULL; } + + return ret; } GList *vf_selection_get_one(ViewFile *vf, FileData *fd) { + GList *ret; + switch (vf->type) { - case FILEVIEW_LIST: return vflist_selection_get_one(vf, fd); - case FILEVIEW_ICON: return vficon_selection_get_one(vf, fd); + case FILEVIEW_LIST: ret = vflist_selection_get_one(vf, fd); break; + case FILEVIEW_ICON: ret = vficon_selection_get_one(vf, fd); break; + default: ret = NULL; } + + return ret; } static void vf_pop_menu_edit_cb(GtkWidget *widget, gpointer data) @@ -698,20 +740,30 @@ GtkWidget *vf_pop_menu(ViewFile *vf) gboolean vf_refresh(ViewFile *vf) { + gboolean ret; + switch (vf->type) { - case FILEVIEW_LIST: return vflist_refresh(vf); - case FILEVIEW_ICON: return vficon_refresh(vf); + case FILEVIEW_LIST: ret = vflist_refresh(vf); break; + case FILEVIEW_ICON: ret = vficon_refresh(vf); break; + default: ret = FALSE; } + + return ret; } gboolean vf_set_fd(ViewFile *vf, FileData *dir_fd) { + gboolean ret; + switch (vf->type) { - case FILEVIEW_LIST: return vflist_set_fd(vf, dir_fd); - case FILEVIEW_ICON: return vficon_set_fd(vf, dir_fd); + case FILEVIEW_LIST: ret = vflist_set_fd(vf, dir_fd); break; + case FILEVIEW_ICON: ret = vficon_set_fd(vf, dir_fd); break; + default: ret = FALSE; } + + return ret; } static void vf_destroy_cb(GtkWidget *widget, gpointer data)