In most cases, gint was used instead of guint.
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);
}
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;
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;
gchar *desc;
gchar **extensions;
GString *filter = NULL;
- gint i;
+ guint i;
format = work->data;
work = work->next;
while (*p != '\0')
{
const gchar *b;
- gint l = 0;
+ guint l = 0;
b = p;
while (*p != '\0' && *p != ';')
void filter_rebuild(void)
{
GList *work;
- gint i;
+ guint i;
string_list_free(extension_list);
extension_list = NULL;
gint filter_name_exists(const gchar *name)
{
GList *work;
- gint ln;
+ guint ln;
if (!extension_list || options->file_filter.disable) return TRUE;
while (work)
{
gchar *filter = work->data;
- gint lf = strlen(filter);
+ guint lf = strlen(filter);
if (ln >= lf)
{
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)
{
while (work)
{
gchar *filter = work->data;
- gint lf = strlen(filter);
+ guint lf = strlen(filter);
if (ln >= lf)
{
gchar *ext;
gchar *desc;
gint enabled = TRUE;
- gint file_class;
+ guint file_class;
if (!text || text[0] != '"') return;
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] == '#')
{
gchar *description;
gchar *extensions;
FileFormatClass file_class;
- gint enabled;
+ gboolean enabled;
};
/* you can change, but not add or remove entries from the returned list */
{
gchar delim = '%', imp = '|', sep[] = " - ";
gchar *start, *end;
- gint pos, prev;
- gint last;
+ guint pos, prev;
+ guint last;
gchar *name, *data;
GString *new;
gchar *ret;
while (TRUE)
{
- gint limit = 0;
+ guint limit = 0;
gchar *trunc = NULL;
gchar *limpos = NULL;
gchar *extra = NULL;
}
if (limpos)
- limit = atoi(limpos);
+ limit = (guint) atoi(limpos);
if (extrapos)
extra = g_strndup(extrapos, end - extrapos);
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--)
break;
}
}
- else if ( (state & GDK_SHIFT_MASK) != (options->mousewheel_scrolls))
+ else if ( (state & GDK_SHIFT_MASK) != (guint) (options->mousewheel_scrolls))
{
switch (direction)
{
struct _InfoTabsPos
{
TabData *(*func)(InfoData *id);
- gint pos;
+ guint pos;
};
static GList *info_tabs_pos_list = NULL;
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++)
work = info_tabs_pos_list;
while (work)
{
- gint i;
+ guint i;
InfoTabsPos *t = work->data;
work = work->next;
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++;
}
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]);
}
if (!text)
{
- gint n;
+ guint n;
gint64 n_bytes = 0;
- gint s;
+ guint s;
gint64 s_bytes = 0;
const gchar *ss;
return NULL;
}
-gint layout_list_count(LayoutWindow *lw, gint64 *bytes)
+guint layout_list_count(LayoutWindow *lw, gint64 *bytes)
{
if (!layout_valid(&lw)) return 0;
return NULL;
}
-gint layout_selection_count(LayoutWindow *lw, gint64 *bytes)
+guint layout_selection_count(LayoutWindow *lw, gint64 *bytes)
{
if (!layout_valid(&lw)) return 0;
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);
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);
if (!isfile(path))
{
- if (row < layout_list_count(lw, NULL) - 1)
+ if ((guint) row < layout_list_count(lw, NULL) - 1)
{
layout_image_next(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);
}
break;
}
}
- else if ( (state & GDK_SHIFT_MASK) != (options->mousewheel_scrolls))
+ else if ( (state & GDK_SHIFT_MASK) != (guint) (options->mousewheel_scrolls))
{
switch (direction)
{
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++)
{
GdkColor colors[LOG_COUNT];
- gint lines;
+ guint lines;
};
typedef struct _LogDef LogDef;
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)
/* ui */
gint progressive_key_scrolling;
gint place_dialogs_under_mouse;
- gint mousewheel_scrolls;
+ gboolean mousewheel_scrolls;
gint show_icon_names;
gint show_copy_path;
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);
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;
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;
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
{
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;
*/
-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;
}
else
{
- gint i;
+ guint i;
for (i = 0; i < ss->slide_count; i++)
{
list = g_list_prepend(list, GINT_TO_POINTER(i));
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;
}
{
FileData *fd;
GdkPixbuf *pixbuf;
- gint flag_mask;
+ guint flag_mask;
};
struct _CollectionData
FileData *slide_fd;
- gint slide_count;
+ guint slide_count;
gint timeout_id;
gint from_selection;
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;
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;
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));
}
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)
{
*-----------------------------------------------------------------------------
*/
-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)
{
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);
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);
}
return (id->selected & SELECTION_SELECTED);
}
-gint vficon_selection_count(ViewFile *vf, gint64 *bytes)
+guint vficon_selection_count(ViewFile *vf, gint64 *bytes)
{
if (bytes)
{
return -1;
}
-gint vficon_count(ViewFile *vf, gint64 *bytes)
+guint vficon_count(ViewFile *vf, gint64 *bytes)
{
if (bytes)
{
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);
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);
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);
}
return -1;
}
-gint vflist_count(ViewFile *vf, gint64 *bytes)
+guint vflist_count(ViewFile *vf, gint64 *bytes)
{
if (bytes)
{
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);
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);