From 94c67ee52b2e81260f2f63c17771c4902942857a Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Thu, 22 May 2008 13:00:45 +0000 Subject: [PATCH] Fix signed vs unsigned warnings. In most cases, gint was used instead of guint. --- src/exif-common.c | 2 +- src/filefilter.c | 24 ++++++++++++------------ src/filefilter.h | 2 +- src/image-overlay.c | 10 +++++----- src/img-view.c | 2 +- src/info.c | 18 +++++++++--------- src/layout.c | 8 ++++---- src/layout.h | 4 ++-- src/layout_image.c | 6 +++--- src/layout_util.c | 4 ++-- src/logwindow.c | 4 ++-- src/options.h | 2 +- src/pixbuf-renderer.c | 2 +- src/preferences.c | 7 ++++--- src/print.c | 35 ++++++++++++++++++----------------- src/slideshow.c | 4 ++-- src/typedefs.h | 4 ++-- src/ui_bookmark.c | 2 +- src/ui_spinner.c | 4 ++-- src/view_dir.c | 2 +- src/view_file.c | 8 ++++---- src/view_file.h | 4 ++-- src/view_file_icon.c | 6 +++--- src/view_file_icon.h | 4 ++-- src/view_file_list.c | 10 +++++----- src/view_file_list.h | 4 ++-- 26 files changed, 92 insertions(+), 90 deletions(-) diff --git a/src/exif-common.c b/src/exif-common.c index 33f6abab..d0bcd6a7 100644 --- a/src/exif-common.c +++ b/src/exif-common.c @@ -303,7 +303,7 @@ static gchar *exif_build_formatted_SubjectDistance(ExifData *exif) r = exif_get_rational(exif, "Exif.Photo.SubjectDistance", &sign); if (!r) return NULL; - if ((long)r->num == 0xffffffff) return g_strdup(_("infinity")); + if ((long)r->num == (long)0xffffffff) return g_strdup(_("infinity")); if ((long)r->num == 0) return g_strdup(_("unknown")); n = exif_rational_to_double(r, sign); diff --git a/src/filefilter.c b/src/filefilter.c index 7cb113fb..7974c61f 100644 --- a/src/filefilter.c +++ b/src/filefilter.c @@ -42,7 +42,7 @@ gint ishidden(const gchar *name) } static FilterEntry *filter_entry_new(const gchar *key, const gchar *description, - const gchar *extensions, FileFormatClass file_class, gint enabled) + const gchar *extensions, FileFormatClass file_class, gboolean enabled) { FilterEntry *fe; @@ -105,7 +105,7 @@ void filter_add(const gchar *key, const gchar *description, const gchar *extensi void filter_add_unique(const gchar *description, const gchar *extensions, FileFormatClass file_class, gint enabled) { gchar *key; - gint n; + guint n; key = g_strdup("user0"); n = 1; @@ -172,7 +172,7 @@ void filter_add_defaults(void) gchar *desc; gchar **extensions; GString *filter = NULL; - gint i; + guint i; format = work->data; work = work->next; @@ -256,7 +256,7 @@ GList *filter_to_list(const gchar *extensions) while (*p != '\0') { const gchar *b; - gint l = 0; + guint l = 0; b = p; while (*p != '\0' && *p != ';') @@ -274,7 +274,7 @@ GList *filter_to_list(const gchar *extensions) void filter_rebuild(void) { GList *work; - gint i; + guint i; string_list_free(extension_list); extension_list = NULL; @@ -316,7 +316,7 @@ void filter_rebuild(void) gint filter_name_exists(const gchar *name) { GList *work; - gint ln; + guint ln; if (!extension_list || options->file_filter.disable) return TRUE; @@ -325,7 +325,7 @@ gint filter_name_exists(const gchar *name) while (work) { gchar *filter = work->data; - gint lf = strlen(filter); + guint lf = strlen(filter); if (ln >= lf) { @@ -341,7 +341,7 @@ gint filter_name_exists(const gchar *name) gint filter_file_class(const gchar *name, FileFormatClass file_class) { GList *work; - gint ln; + guint ln; if (file_class < 0 || file_class >= FILE_FORMAT_CLASSES) { @@ -354,7 +354,7 @@ gint filter_file_class(const gchar *name, FileFormatClass file_class) while (work) { gchar *filter = work->data; - gint lf = strlen(filter); + guint lf = strlen(filter); if (ln >= lf) { @@ -395,7 +395,7 @@ void filter_parse(const gchar *text) gchar *ext; gchar *desc; gint enabled = TRUE; - gint file_class; + guint file_class; if (!text || text[0] != '"') return; @@ -405,9 +405,9 @@ void filter_parse(const gchar *text) ext = quoted_value(p, &p); desc = quoted_value(p, &p); - file_class = strtol(p, NULL, 10); + file_class = strtoul(p, NULL, 10); - if (file_class < 0 || file_class >= FILE_FORMAT_CLASSES) file_class = FORMAT_CLASS_UNKNOWN; + if (file_class >= FILE_FORMAT_CLASSES) file_class = FORMAT_CLASS_UNKNOWN; if (key && key[0] == '#') { diff --git a/src/filefilter.h b/src/filefilter.h index 85e831ab..8aa122b2 100644 --- a/src/filefilter.h +++ b/src/filefilter.h @@ -21,7 +21,7 @@ struct _FilterEntry { gchar *description; gchar *extensions; FileFormatClass file_class; - gint enabled; + gboolean enabled; }; /* you can change, but not add or remove entries from the returned list */ diff --git a/src/image-overlay.c b/src/image-overlay.c index f5d57a96..0cf4ed3d 100644 --- a/src/image-overlay.c +++ b/src/image-overlay.c @@ -209,8 +209,8 @@ static gchar *image_osd_mkinfo(const gchar *str, ImageWindow *imd, GHashTable *v { gchar delim = '%', imp = '|', sep[] = " - "; gchar *start, *end; - gint pos, prev; - gint last; + guint pos, prev; + guint last; gchar *name, *data; GString *new; gchar *ret; @@ -226,7 +226,7 @@ static gchar *image_osd_mkinfo(const gchar *str, ImageWindow *imd, GHashTable *v while (TRUE) { - gint limit = 0; + guint limit = 0; gchar *trunc = NULL; gchar *limpos = NULL; gchar *extra = NULL; @@ -262,7 +262,7 @@ static gchar *image_osd_mkinfo(const gchar *str, ImageWindow *imd, GHashTable *v } if (limpos) - limit = atoi(limpos); + limit = (guint) atoi(limpos); if (extrapos) extra = g_strndup(extrapos, end - extrapos); @@ -322,7 +322,7 @@ static gchar *image_osd_mkinfo(const gchar *str, ImageWindow *imd, GHashTable *v gchar *left = NULL; gchar *right = extra; gchar *p; - gint len = strlen(extra); + guint len = strlen(extra); /* Search and replace "\n" by a newline character */ for (p = extra; *p; p++, len--) diff --git a/src/img-view.c b/src/img-view.c index 4810969d..9bca8733 100644 --- a/src/img-view.c +++ b/src/img-view.c @@ -639,7 +639,7 @@ static void scroll_cb(ImageWindow *imd, GdkScrollDirection direction, guint32 ti break; } } - else if ( (state & GDK_SHIFT_MASK) != (options->mousewheel_scrolls)) + else if ( (state & GDK_SHIFT_MASK) != (guint) (options->mousewheel_scrolls)) { switch (direction) { diff --git a/src/info.c b/src/info.c index 654135ee..3c523d3d 100644 --- a/src/info.c +++ b/src/info.c @@ -51,7 +51,7 @@ typedef struct _InfoTabsPos InfoTabsPos; struct _InfoTabsPos { TabData *(*func)(InfoData *id); - gint pos; + guint pos; }; static GList *info_tabs_pos_list = NULL; @@ -496,7 +496,7 @@ static gpointer info_tab_new_funcs[] = { gchar *info_tab_default_order(void) { - gint i; + guint i; static gchar str[G_N_ELEMENTS(info_tab_new_funcs) + 1]; for (i = 0; i < G_N_ELEMENTS(info_tab_new_funcs); i++) @@ -521,7 +521,7 @@ static void info_tab_get_order_string(gchar **dest) work = info_tabs_pos_list; while (work) { - gint i; + guint i; InfoTabsPos *t = work->data; work = work->next; @@ -547,15 +547,15 @@ static void info_tabs_init(InfoData *id) if (!info_tabs_pos_list) { - gint count = 0; - gint i; + guint count = 0; + guint i; gchar *order = options->properties.tabs_order; for (i = 0; i < strlen(order); i++) { - gint n = order[i] - '1'; + guint n = order[i] - '1'; - if (n < 0 || n >= G_N_ELEMENTS(info_tab_new_funcs)) break; + if (n >= G_N_ELEMENTS(info_tab_new_funcs)) break; count++; } @@ -564,9 +564,9 @@ static void info_tabs_init(InfoData *id) for (i = 0; i < strlen(order); i++) { - gint n = order[i] - '1'; + guint n = order[i] - '1'; - if (n < 0 || n >= G_N_ELEMENTS(info_tab_new_funcs)) continue; + if (n >= G_N_ELEMENTS(info_tab_new_funcs)) continue; if (g_list_find(info_tabs_pos_list, info_tab_new_funcs[n])) continue; info_tabs_pos_list_append(info_tab_new_funcs[n]); } diff --git a/src/layout.c b/src/layout.c index f6df1886..df2bd659 100644 --- a/src/layout.c +++ b/src/layout.c @@ -517,9 +517,9 @@ void layout_status_update_info(LayoutWindow *lw, const gchar *text) if (!text) { - gint n; + guint n; gint64 n_bytes = 0; - gint s; + guint s; gint64 s_bytes = 0; const gchar *ss; @@ -776,7 +776,7 @@ GList *layout_list(LayoutWindow *lw) return NULL; } -gint layout_list_count(LayoutWindow *lw, gint64 *bytes) +guint layout_list_count(LayoutWindow *lw, gint64 *bytes) { if (!layout_valid(&lw)) return 0; @@ -844,7 +844,7 @@ GList *layout_selection_list_by_index(LayoutWindow *lw) return NULL; } -gint layout_selection_count(LayoutWindow *lw, gint64 *bytes) +guint layout_selection_count(LayoutWindow *lw, gint64 *bytes) { if (!layout_valid(&lw)) return 0; diff --git a/src/layout.h b/src/layout.h index 89a2392c..892bc8b3 100644 --- a/src/layout.h +++ b/src/layout.h @@ -38,7 +38,7 @@ void layout_status_update_image(LayoutWindow *lw); void layout_status_update_all(LayoutWindow *lw); GList *layout_list(LayoutWindow *lw); -gint layout_list_count(LayoutWindow *lw, gint64 *bytes); +guint layout_list_count(LayoutWindow *lw, gint64 *bytes); FileData *layout_list_get_fd(LayoutWindow *lw, gint index); gint layout_list_get_index(LayoutWindow *lw, const gchar *path); void layout_list_sync_fd(LayoutWindow *lw, FileData *fd); @@ -46,7 +46,7 @@ void layout_list_sync_fd(LayoutWindow *lw, FileData *fd); GList *layout_selection_list(LayoutWindow *lw); /* return list of pointers to int for selection */ GList *layout_selection_list_by_index(LayoutWindow *lw); -gint layout_selection_count(LayoutWindow *lw, gint64 *bytes); +guint layout_selection_count(LayoutWindow *lw, gint64 *bytes); void layout_select_all(LayoutWindow *lw); void layout_select_none(LayoutWindow *lw); void layout_select_invert(LayoutWindow *lw); diff --git a/src/layout_image.c b/src/layout_image.c index 97633ca9..9ae86c0e 100644 --- a/src/layout_image.c +++ b/src/layout_image.c @@ -991,7 +991,7 @@ static void layout_image_dnd_end(GtkWidget *widget, GdkDragContext *context, gpo if (!isfile(path)) { - if (row < layout_list_count(lw, NULL) - 1) + if ((guint) row < layout_list_count(lw, NULL) - 1) { layout_image_next(lw); } @@ -1404,7 +1404,7 @@ void layout_image_next(LayoutWindow *lw) if (current >= 0) { - if (current < layout_list_count(lw, NULL) - 1) + if ((guint) current < layout_list_count(lw, NULL) - 1) { layout_image_set_index(lw, current + 1); } @@ -1622,7 +1622,7 @@ static void layout_image_scroll_cb(ImageWindow *imd, GdkScrollDirection directio break; } } - else if ( (state & GDK_SHIFT_MASK) != (options->mousewheel_scrolls)) + else if ( (state & GDK_SHIFT_MASK) != (guint) (options->mousewheel_scrolls)) { switch (direction) { diff --git a/src/layout_util.c b/src/layout_util.c index 374938a3..13ecccb7 100644 --- a/src/layout_util.c +++ b/src/layout_util.c @@ -62,9 +62,9 @@ static guint tree_key_overrides[] = { GDK_End, GDK_KP_End }; -static gint layout_key_match(guint keyval) +static gboolean layout_key_match(guint keyval) { - gint i; + guint i; for (i = 0; i < sizeof(tree_key_overrides) / sizeof(guint); i++) { diff --git a/src/logwindow.c b/src/logwindow.c index ee26e0eb..793f4fb6 100644 --- a/src/logwindow.c +++ b/src/logwindow.c @@ -28,7 +28,7 @@ struct _LogWindow GdkColor colors[LOG_COUNT]; - gint lines; + guint lines; }; typedef struct _LogDef LogDef; @@ -208,7 +208,7 @@ void log_window_append(const gchar *str, LogType type) GtkTextView *text; GtkTextBuffer *buffer; GtkTextIter iter; - gint line_limit = 1000; //FIXME: option + guint line_limit = 1000; //FIXME: option static GList *memory = NULL; if (logwindow == NULL) diff --git a/src/options.h b/src/options.h index f7b8fa63..53a60f1b 100644 --- a/src/options.h +++ b/src/options.h @@ -20,7 +20,7 @@ struct _ConfOptions /* ui */ gint progressive_key_scrolling; gint place_dialogs_under_mouse; - gint mousewheel_scrolls; + gboolean mousewheel_scrolls; gint show_icon_names; gint show_copy_path; diff --git a/src/pixbuf-renderer.c b/src/pixbuf-renderer.c index 810a9d40..39a66175 100644 --- a/src/pixbuf-renderer.c +++ b/src/pixbuf-renderer.c @@ -1899,7 +1899,7 @@ static void pr_tile_remove(PixbufRenderer *pr, ImageTile *it) static void pr_tile_free_space(PixbufRenderer *pr, guint space, ImageTile *it) { GList *work; - gint tile_max; + guint tile_max; work = g_list_last(pr->tiles); diff --git a/src/preferences.c b/src/preferences.c index 2a243d38..ab19d79f 100644 --- a/src/preferences.c +++ b/src/preferences.c @@ -519,13 +519,14 @@ static void thumb_size_menu_cb(GtkWidget *combo, gpointer data) gint n; n = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); + if (n < 0) return; - if (n >= 0 && n < sizeof(thumb_size_list) / sizeof(ThumbSize)) + if ((guint) n < sizeof(thumb_size_list) / sizeof(ThumbSize)) { c_options->thumbnails.max_width = thumb_size_list[n].w; c_options->thumbnails.max_height = thumb_size_list[n].h; } - else if (n > 0) + else { c_options->thumbnails.max_width = options->thumbnails.max_width; c_options->thumbnails.max_height = options->thumbnails.max_height; @@ -546,7 +547,7 @@ static void add_thumb_size_menu(GtkWidget *table, gint column, gint row, gchar * combo = gtk_combo_box_new_text(); current = -1; - for (i = 0; i < sizeof(thumb_size_list) / sizeof(ThumbSize); i++) + for (i = 0; (guint) i < sizeof(thumb_size_list) / sizeof(ThumbSize); i++) { gint w, h; gchar *buf; diff --git a/src/print.c b/src/print.c index 4a7b472c..abaf0782 100644 --- a/src/print.c +++ b/src/print.c @@ -177,6 +177,22 @@ typedef enum { TEXT_INFO_FILEPATH = 1 << 4 } TextInfo; +typedef enum { + PAPER_UNIT_POINTS = 0, + PAPER_UNIT_MM, + PAPER_UNIT_CM, + PAPER_UNIT_INCH, + PAPER_UNIT_PICAS, + PAPER_UNIT_COUNT +} PaperUnits; + +typedef enum { + PAPER_ORIENTATION_PORTRAIT = 0, + PAPER_ORIENTATION_LANDSCAPE, + PAPER_ORIENTATION_COUNT +} PaperOrientation; + + typedef struct _PrintWindow PrintWindow; struct _PrintWindow { @@ -237,11 +253,11 @@ struct _PrintWindow GtkWidget *margin_top_spin; GtkWidget *margin_bottom_spin; - gint paper_units; + PaperUnits paper_units; gint paper_size; gdouble paper_width; gdouble paper_height; - gint paper_orientation; + PaperOrientation paper_orientation; gdouble margin_left; gdouble margin_right; @@ -329,21 +345,6 @@ static const gchar *print_output_name(PrintOutput output) */ -typedef enum { - PAPER_UNIT_POINTS = 0, - PAPER_UNIT_MM, - PAPER_UNIT_CM, - PAPER_UNIT_INCH, - PAPER_UNIT_PICAS, - PAPER_UNIT_COUNT -} PaperUnits; - -typedef enum { - PAPER_ORIENTATION_PORTRAIT = 0, - PAPER_ORIENTATION_LANDSCAPE, - PAPER_ORIENTATION_COUNT -} PaperOrientation; - typedef struct _PaperSize PaperSize; struct _PaperSize { gchar *description; diff --git a/src/slideshow.c b/src/slideshow.c index ffe803ca..2d598bf1 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -55,7 +55,7 @@ static GList *generate_list(SlideShowData *ss) } else { - gint i; + guint i; for (i = 0; i < ss->slide_count; i++) { list = g_list_prepend(list, GINT_TO_POINTER(i)); @@ -365,7 +365,7 @@ static SlideShowData *real_slideshow_start(ImageWindow *imd, LayoutWindow *lw, if (ss->slide_count < 2) { ss->slide_count = layout_list_count(ss->layout, NULL); - if (!options->slideshow.random && start_point >= 0 && start_point < ss->slide_count) + if (!options->slideshow.random && start_point >= 0 && (guint) start_point < ss->slide_count) { start_index = start_point; } diff --git a/src/typedefs.h b/src/typedefs.h index b030c19d..0d701646 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -238,7 +238,7 @@ struct _CollectInfo { FileData *fd; GdkPixbuf *pixbuf; - gint flag_mask; + guint flag_mask; }; struct _CollectionData @@ -684,7 +684,7 @@ struct _SlideShowData FileData *slide_fd; - gint slide_count; + guint slide_count; gint timeout_id; gint from_selection; diff --git a/src/ui_bookmark.c b/src/ui_bookmark.c index 4a8d03ff..902d1642 100644 --- a/src/ui_bookmark.c +++ b/src/ui_bookmark.c @@ -268,7 +268,7 @@ void history_list_add_to_key(const gchar *key, const gchar *path, gint max) if (max == -1) max = HISTORY_DEFAULT_KEY_COUNT; if (max > 0) { - while (hd->list && g_list_length(hd->list) > max) + while (hd->list && g_list_length(hd->list) > (guint) max) { GList *work = g_list_last(hd->list); gchar *buf = work->data; diff --git a/src/ui_spinner.c b/src/ui_spinner.c index 1f4fe1a8..c6327044 100644 --- a/src/ui_spinner.c +++ b/src/ui_spinner.c @@ -41,11 +41,11 @@ typedef struct _SpinnerData SpinnerData; struct _SpinnerData { GtkWidget *image; GList *list; /* list of pixbufs */ - gint frame; + guint frame; gint timer_id; }; -static void spinner_set_frame(SpinnerData *sp, gint frame) +static void spinner_set_frame(SpinnerData *sp, guint frame) { GdkPixbuf *pb; diff --git a/src/view_dir.c b/src/view_dir.c index 8d49340c..36bd9912 100644 --- a/src/view_dir.c +++ b/src/view_dir.c @@ -623,7 +623,7 @@ GtkWidget *vd_pop_menu(ViewDir *vd, FileData *fd) for (i = 0; i < VIEW_DIR_TYPES_COUNT; i++) { item = menu_item_add_check(submenu, _(menu_view_dir_radio_entries[i].label), - (vd->type == menu_view_dir_radio_entries[i].value), + ((gint) vd->type == menu_view_dir_radio_entries[i].value), G_CALLBACK(vd_pop_submenu_dir_view_as_cb), vd); g_object_set_data(G_OBJECT(item), VIEW_DIR_AS_SUBMENU_KEY, GINT_TO_POINTER(menu_view_dir_radio_entries[i].value)); } diff --git a/src/view_file.c b/src/view_file.c index ec315877..f9c3a258 100644 --- a/src/view_file.c +++ b/src/view_file.c @@ -79,9 +79,9 @@ gint vf_index_by_path(ViewFile *vf, const gchar *path) return index; } -gint vf_count(ViewFile *vf, gint64 *bytes) +guint vf_count(ViewFile *vf, gint64 *bytes) { - gint count = 0; + guint count = 0; switch(vf->type) { @@ -167,9 +167,9 @@ static gint vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer da *----------------------------------------------------------------------------- */ -gint vf_selection_count(ViewFile *vf, gint64 *bytes) +guint vf_selection_count(ViewFile *vf, gint64 *bytes) { - gint count = 0; + guint count = 0; switch(vf->type) { diff --git a/src/view_file.h b/src/view_file.h index c5f72bd0..407b97db 100644 --- a/src/view_file.h +++ b/src/view_file.h @@ -42,11 +42,11 @@ GtkWidget *vf_pop_menu(ViewFile *vf); FileData *vf_index_get_data(ViewFile *vf, gint row); gint vf_index_by_path(ViewFile *vf, const gchar *path); gint vf_index_by_fd(ViewFile *vf, FileData *in_fd); -gint vf_count(ViewFile *vf, gint64 *bytes); +guint vf_count(ViewFile *vf, gint64 *bytes); GList *vf_get_list(ViewFile *vf); gint vf_index_is_selected(ViewFile *vf, gint row); -gint vf_selection_count(ViewFile *vf, gint64 *bytes); +guint vf_selection_count(ViewFile *vf, gint64 *bytes); GList *vf_selection_get_list(ViewFile *vf); GList *vf_selection_get_list_by_index(ViewFile *vf); diff --git a/src/view_file_icon.c b/src/view_file_icon.c index 9a62986e..bb02b6e7 100644 --- a/src/view_file_icon.c +++ b/src/view_file_icon.c @@ -247,7 +247,7 @@ static void vficon_send_layout_select(ViewFile *vf, IconData *id) row = g_list_index(vf->list, id); if (row > vficon_index_by_fd(vf, cur_fd) && - row + 1 < vf_count(vf, NULL)) + (guint) (row + 1) < vf_count(vf, NULL)) { read_ahead_fd = vf_index_get_data(vf, row + 1); } @@ -809,7 +809,7 @@ gint vficon_index_is_selected(ViewFile *vf, gint row) return (id->selected & SELECTION_SELECTED); } -gint vficon_selection_count(ViewFile *vf, gint64 *bytes) +guint vficon_selection_count(ViewFile *vf, gint64 *bytes) { if (bytes) { @@ -1970,7 +1970,7 @@ static gint vficon_index_by_id(ViewFile *vf, IconData *in_id) return -1; } -gint vficon_count(ViewFile *vf, gint64 *bytes) +guint vficon_count(ViewFile *vf, gint64 *bytes) { if (bytes) { diff --git a/src/view_file_icon.h b/src/view_file_icon.h index a61774f5..0bed76aa 100644 --- a/src/view_file_icon.h +++ b/src/view_file_icon.h @@ -37,11 +37,11 @@ void vficon_pop_menu_show_names_cb(GtkWidget *widget, gpointer data); FileData *vficon_index_get_data(ViewFile *vf, gint row); gint vficon_index_by_path(ViewFile *vf, const gchar *path); gint vficon_index_by_fd(ViewFile *vf, FileData *in_fd); -gint vficon_count(ViewFile *vf, gint64 *bytes); +guint vficon_count(ViewFile *vf, gint64 *bytes); GList *vficon_get_list(ViewFile *vf); gint vficon_index_is_selected(ViewFile *vf, gint row); -gint vficon_selection_count(ViewFile *vf, gint64 *bytes); +guint vficon_selection_count(ViewFile *vf, gint64 *bytes); GList *vficon_selection_get_list(ViewFile *vf); GList *vficon_selection_get_list_by_index(ViewFile *vf); diff --git a/src/view_file_list.c b/src/view_file_list.c index 328d6ff6..cac41ade 100644 --- a/src/view_file_list.c +++ b/src/view_file_list.c @@ -232,7 +232,7 @@ static void vflist_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointe if (VFLIST_INFO(vf, thumbs_enabled) && VFLIST_INFO(vf, click_fd) && VFLIST_INFO(vf, click_fd)->pixbuf) { - gint items; + guint items; if (vflist_row_is_selected(vf, VFLIST_INFO(vf, click_fd))) items = vf_selection_count(vf, NULL); @@ -629,7 +629,7 @@ static void vflist_select_image(ViewFile *vf, FileData *sel_fd) if (sel_fd && options->image.enable_read_ahead && row >= 0) { if (row > g_list_index(vf->list, cur_fd) && - row + 1 < vf_count(vf, NULL)) + (guint) (row + 1) < vf_count(vf, NULL)) { read_ahead_fd = vf_index_get_data(vf, row + 1); } @@ -1064,7 +1064,7 @@ gint vflist_index_by_path(ViewFile *vf, const gchar *path) return -1; } -gint vflist_count(ViewFile *vf, gint64 *bytes) +guint vflist_count(ViewFile *vf, gint64 *bytes) { if (bytes) { @@ -1144,12 +1144,12 @@ gint vflist_index_is_selected(ViewFile *vf, gint row) return vflist_row_is_selected(vf, fd); } -gint vflist_selection_count(ViewFile *vf, gint64 *bytes) +guint vflist_selection_count(ViewFile *vf, gint64 *bytes) { GtkTreeModel *store; GtkTreeSelection *selection; GList *slist; - gint count; + guint count; selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(vf->listview)); slist = gtk_tree_selection_get_selected_rows(selection, &store); diff --git a/src/view_file_list.h b/src/view_file_list.h index 75aa11ee..45d30c67 100644 --- a/src/view_file_list.h +++ b/src/view_file_list.h @@ -41,11 +41,11 @@ void vflist_pop_menu_thumbs_cb(GtkWidget *widget, gpointer data); FileData *vflist_index_get_data(ViewFile *vf, gint row); gint vflist_index_by_path(ViewFile *vf, const gchar *path); -gint vflist_count(ViewFile *vf, gint64 *bytes); +guint vflist_count(ViewFile *vf, gint64 *bytes); GList *vflist_get_list(ViewFile *vf); gint vflist_index_is_selected(ViewFile *vf, gint row); -gint vflist_selection_count(ViewFile *vf, gint64 *bytes); +guint vflist_selection_count(ViewFile *vf, gint64 *bytes); GList *vflist_selection_get_list(ViewFile *vf); GList *vflist_selection_get_list_by_index(ViewFile *vf); -- 2.20.1