Fix signed vs unsigned warnings.
authorLaurent Monin <geeqie@norz.org>
Thu, 22 May 2008 13:00:45 +0000 (13:00 +0000)
committerLaurent Monin <geeqie@norz.org>
Thu, 22 May 2008 13:00:45 +0000 (13:00 +0000)
In most cases, gint was used instead of guint.

26 files changed:
src/exif-common.c
src/filefilter.c
src/filefilter.h
src/image-overlay.c
src/img-view.c
src/info.c
src/layout.c
src/layout.h
src/layout_image.c
src/layout_util.c
src/logwindow.c
src/options.h
src/pixbuf-renderer.c
src/preferences.c
src/print.c
src/slideshow.c
src/typedefs.h
src/ui_bookmark.c
src/ui_spinner.c
src/view_dir.c
src/view_file.c
src/view_file.h
src/view_file_icon.c
src/view_file_icon.h
src/view_file_list.c
src/view_file_list.h

index 33f6aba..d0bcd6a 100644 (file)
@@ -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);
index 7cb113f..7974c61 100644 (file)
@@ -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] == '#')
                {
index 85e831a..8aa122b 100644 (file)
@@ -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 */
index f5d57a9..0cf4ed3 100644 (file)
@@ -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--)
index 4810969..9bca873 100644 (file)
@@ -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)
                        {
index 654135e..3c523d3 100644 (file)
@@ -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]);
                        }
index f6df188..df2bd65 100644 (file)
@@ -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;
 
index 89a2392..892bc8b 100644 (file)
@@ -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);
index 97633ca..9ae86c0 100644 (file)
@@ -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)
                        {
index 374938a..13ecccb 100644 (file)
@@ -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++)
                {
index ee26e0e..793f4fb 100644 (file)
@@ -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)
index f7b8fa6..53a60f1 100644 (file)
@@ -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;
 
index 810a9d4..39a6617 100644 (file)
@@ -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);
 
index 2a243d3..ab19d79 100644 (file)
@@ -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;
index 4a7b472..abaf078 100644 (file)
@@ -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;
index ffe803c..2d598bf 100644 (file)
@@ -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;
                                }
index b030c19..0d70164 100644 (file)
@@ -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;
index 4a8d03f..902d164 100644 (file)
@@ -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;
index 1f4fe1a..c632704 100644 (file)
@@ -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;
 
index 8d49340..36bd991 100644 (file)
@@ -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));
                }
index ec31587..f9c3a25 100644 (file)
@@ -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)
        {
index c5f72bd..407b97d 100644 (file)
@@ -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);
 
index 9a62986..bb02b6e 100644 (file)
@@ -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)
                {
index a61774f..0bed76a 100644 (file)
@@ -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);
 
index 328d6ff..cac41ad 100644 (file)
@@ -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);
index 75aa11e..45d30c6 100644 (file)
@@ -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);