gint -> gboolean.
authorLaurent Monin <geeqie@norz.org>
Sun, 15 Mar 2009 18:06:41 +0000 (18:06 +0000)
committerLaurent Monin <geeqie@norz.org>
Sun, 15 Mar 2009 18:06:41 +0000 (18:06 +0000)
12 files changed:
src/secure_save.c
src/similar.c
src/slideshow.c
src/slideshow.h
src/thumb.c
src/thumb.h
src/thumb_standard.c
src/thumb_standard.h
src/trash.c
src/trash.h
src/typedefs.h
src/ui_bookmark.c

index 687e8b9..009ca34 100644 (file)
@@ -233,7 +233,7 @@ secure_close(SecureSaveInfo *ssi)
         * while closing file releases file descriptor we need to call fsync(). */
 #if defined(HAVE_FFLUSH) || defined(HAVE_FSYNC)
        if (ssi->secure_save) {
-               gint fail = 0;
+               gboolean fail = FALSE;
 
 #ifdef HAVE_FFLUSH
                fail = (fflush(ssi->fp) == EOF);
index de28fd9..ba2cc16 100644 (file)
@@ -174,7 +174,7 @@ void image_sim_fill_data(ImageSimilarityData *sd, GdkPixbuf *pixbuf)
        gint w, h;
        gint rs;
        guchar *pix;
-       gint has_alpha;
+       gboolean has_alpha;
        gint p_step;
 
        guchar *p;
index 42a3bca..a15da53 100644 (file)
@@ -152,7 +152,7 @@ static void slideshow_list_init(SlideShowData *ss, gint start_index)
                }
 }
 
-gint slideshow_should_continue(SlideShowData *ss)
+gboolean slideshow_should_continue(SlideShowData *ss)
 {
        FileData *imd_fd;
        FileData *dir_fd;
@@ -186,7 +186,7 @@ gint slideshow_should_continue(SlideShowData *ss)
        return FALSE;
 }
 
-static gint slideshow_step(SlideShowData *ss, gboolean forward)
+static gboolean slideshow_step(SlideShowData *ss, gboolean forward)
 {
        gint row;
 
@@ -289,7 +289,7 @@ static gint slideshow_step(SlideShowData *ss, gboolean forward)
        return TRUE;
 }
 
-static gint slideshow_loop_cb(gpointer data)
+static gboolean slideshow_loop_cb(gpointer data)
 {
        SlideShowData *ss = data;
 
index 221295d..058965d 100644 (file)
@@ -26,7 +26,7 @@
 
 void slideshow_free(SlideShowData *ss);
 
-gint slideshow_should_continue(SlideShowData *ss);
+gboolean slideshow_should_continue(SlideShowData *ss);
 
 void slideshow_next(SlideShowData *ss);
 void slideshow_prev(SlideShowData *ss);
index 0b9dede..9d177f8 100644 (file)
@@ -246,7 +246,7 @@ static void thumb_loader_error_cb(ImageLoader *il, gpointer data)
        if (tl->func_error) tl->func_error(tl, tl->data);
 }
 
-static gint thumb_loader_done_delay_cb(gpointer data)
+static gboolean thumb_loader_done_delay_cb(gpointer data)
 {
        ThumbLoader *tl = data;
 
@@ -305,7 +305,7 @@ void thumb_loader_set_callbacks(ThumbLoader *tl,
        tl->data = data;
 }
 
-void thumb_loader_set_cache(ThumbLoader *tl, gint enable_cache, gint local, gint retry_failed)
+void thumb_loader_set_cache(ThumbLoader *tl, gboolean enable_cache, gboolean local, gboolean retry_failed)
 {
        if (!tl) return;
 
@@ -323,7 +323,7 @@ void thumb_loader_set_cache(ThumbLoader *tl, gint enable_cache, gint local, gint
 }
 
 
-gint thumb_loader_start(ThumbLoader *tl, FileData *fd)
+gboolean thumb_loader_start(ThumbLoader *tl, FileData *fd)
 {
        gchar *cache_path = NULL;
 
index 7fabba9..9d9c4a5 100644 (file)
@@ -21,9 +21,9 @@ void thumb_loader_set_callbacks(ThumbLoader *tl,
                                ThumbLoaderFunc func_error,
                                ThumbLoaderFunc func_progress,
                                gpointer data);
-void thumb_loader_set_cache(ThumbLoader *tl, gint enable_cache, gint local, gint retry_failed);
+void thumb_loader_set_cache(ThumbLoader *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
 
-gint thumb_loader_start(ThumbLoader *tl, FileData *fd);
+gboolean thumb_loader_start(ThumbLoader *tl, FileData *fd);
 void thumb_loader_free(ThumbLoader *tl);
 
 GdkPixbuf *thumb_loader_get_pixbuf(ThumbLoader *tl);
index 4735e92..b86879d 100644 (file)
@@ -123,7 +123,7 @@ static void thumb_loader_std_reset(ThumbLoaderStd *tl)
        tl->progress = 0.0;
 }
 
-static gchar *thumb_std_cache_path(const gchar *path, const gchar *uri, gint local,
+static gchar *thumb_std_cache_path(const gchar *path, const gchar *uri, gboolean local,
                                   const gchar *cache_subfolder)
 {
        gchar *result = NULL;
@@ -158,7 +158,7 @@ static gchar *thumb_std_cache_path(const gchar *path, const gchar *uri, gint loc
        return result;
 }
 
-static gchar *thumb_loader_std_cache_path(ThumbLoaderStd *tl, gint local, GdkPixbuf *pixbuf, gint fail)
+static gchar *thumb_loader_std_cache_path(ThumbLoaderStd *tl, gboolean local, GdkPixbuf *pixbuf, gboolean fail)
 {
        const gchar *folder;
        gint w, h;
@@ -194,7 +194,7 @@ static gchar *thumb_loader_std_cache_path(ThumbLoaderStd *tl, gint local, GdkPix
                                    local, folder);
 }
 
-static gint thumb_loader_std_fail_check(ThumbLoaderStd *tl)
+static gboolean thumb_loader_std_fail_check(ThumbLoaderStd *tl)
 {
        gchar *fail_path;
        gboolean result = FALSE;
@@ -239,7 +239,7 @@ static gint thumb_loader_std_fail_check(ThumbLoaderStd *tl)
        return result;
 }
 
-static gint thumb_loader_std_validate(ThumbLoaderStd *tl, GdkPixbuf *pixbuf)
+static gboolean thumb_loader_std_validate(ThumbLoaderStd *tl, GdkPixbuf *pixbuf)
 {
        const gchar *valid_uri;
        const gchar *uri;
@@ -273,7 +273,7 @@ static void thumb_loader_std_save(ThumbLoaderStd *tl, GdkPixbuf *pixbuf)
 {
        gchar *base_path;
        gchar *tmp_path;
-       gint fail;
+       gboolean fail;
 
        if (!tl->cache_enable || tl->cache_hit) return;
        if (tl->thumb_path) return;
@@ -334,7 +334,7 @@ static void thumb_loader_std_save(ThumbLoaderStd *tl, GdkPixbuf *pixbuf)
                gchar *mark_app;
                gchar *mark_mtime;
                gchar *pathl;
-               gint success;
+               gboolean success;
 
                mark_uri = (tl->cache_local) ? tl->local_uri :tl->thumb_uri;
 
@@ -376,7 +376,7 @@ static void thumb_loader_std_set_fallback(ThumbLoaderStd *tl)
        tl->fd->thumb_pixbuf = pixbuf_fallback(tl->fd, tl->requested_width, tl->requested_height);
 }
 
-static GdkPixbuf *thumb_loader_std_finish(ThumbLoaderStd *tl, GdkPixbuf *pixbuf, gint shrunk)
+static GdkPixbuf *thumb_loader_std_finish(ThumbLoaderStd *tl, GdkPixbuf *pixbuf, gboolean shrunk)
 {
        GdkPixbuf *pixbuf_thumb = NULL;
        GdkPixbuf *result;
@@ -487,7 +487,7 @@ static GdkPixbuf *thumb_loader_std_finish(ThumbLoaderStd *tl, GdkPixbuf *pixbuf,
        return result;
 }
 
-static gint thumb_loader_std_next_source(ThumbLoaderStd *tl, gint remove_broken)
+static gboolean thumb_loader_std_next_source(ThumbLoaderStd *tl, gboolean remove_broken)
 {
        image_loader_free(tl->il);
        tl->il = NULL;
@@ -588,7 +588,7 @@ static void thumb_loader_std_progress_cb(ImageLoader *il, gdouble percent, gpoin
        if (tl->func_progress) tl->func_progress(tl, tl->data);
 }
 
-static gint thumb_loader_std_setup(ThumbLoaderStd *tl, FileData *fd)
+static gboolean thumb_loader_std_setup(ThumbLoaderStd *tl, FileData *fd)
 {
        tl->il = image_loader_new(fd);
        image_loader_set_priority(tl->il, G_PRIORITY_LOW);
@@ -624,10 +624,10 @@ static gint thumb_loader_std_setup(ThumbLoaderStd *tl, FileData *fd)
        return FALSE;
 }
 
-static gint thumb_loader_std_setup_path(ThumbLoaderStd *tl, const gchar *path)
+static gboolean thumb_loader_std_setup_path(ThumbLoaderStd *tl, const gchar *path)
 {
        FileData *fd = file_data_new_simple(path);
-       gint ret = thumb_loader_std_setup(tl, fd);
+       gboolean ret = thumb_loader_std_setup(tl, fd);
        file_data_unref(fd);
        return ret;
 }
@@ -636,7 +636,7 @@ static gint thumb_loader_std_setup_path(ThumbLoaderStd *tl, const gchar *path)
  * Note: Currently local_cache only specifies where to save a _new_ thumb, if
  *       a valid existing thumb is found anywhere the local thumb will not be created.
  */
-void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gint enable_cache, gint local, gint retry_failed)
+void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed)
 {
        if (!tl) return;
 
@@ -645,7 +645,7 @@ void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gint enable_cache, gint loca
        tl->cache_retry = retry_failed;
 }
 
-gint thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd)
+gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd)
 {
        static gchar *thumb_cache = NULL;
        struct stat st;
@@ -738,7 +738,7 @@ struct _ThumbValidate
        gchar *path;
        gint days;
 
-       void (*func_valid)(const gchar *path, gint valid, gpointer data);
+       void (*func_valid)(const gchar *path, gboolean valid, gpointer data);
        gpointer data;
 
        gint idle_id;
@@ -765,7 +765,7 @@ void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl)
        thumb_loader_std_thumb_file_validate_free(tv);
 }
 
-static void thumb_loader_std_thumb_file_validate_finish(ThumbValidate *tv, gint valid)
+static void thumb_loader_std_thumb_file_validate_finish(ThumbValidate *tv, gboolean valid)
 {
        if (tv->func_valid) tv->func_valid(tv->path, valid, tv->data);
 
@@ -834,7 +834,7 @@ static void thumb_loader_std_thumb_file_validate_error_cb(ThumbLoaderStd *tl, gp
        thumb_loader_std_thumb_file_validate_finish(tv, FALSE);
 }
 
-static gint thumb_loader_std_thumb_file_validate_idle_cb(gpointer data)
+static gboolean thumb_loader_std_thumb_file_validate_idle_cb(gpointer data)
 {
        ThumbValidate *tv = data;
 
@@ -845,7 +845,7 @@ static gint thumb_loader_std_thumb_file_validate_idle_cb(gpointer data)
 }
 
 ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_days,
-                                                    void (*func_valid)(const gchar *path, gint valid, gpointer data),
+                                                    void (*func_valid)(const gchar *path, gboolean valid, gpointer data),
                                                     gpointer data)
 {
        ThumbValidate *tv;
@@ -877,7 +877,7 @@ ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gi
        return tv->tl;
 }
 
-static void thumb_std_maint_remove_one(const gchar *source, const gchar *uri, gint local,
+static void thumb_std_maint_remove_one(const gchar *source, const gchar *uri, gboolean local,
                                       const gchar *subfolder)
 {
        gchar *thumb_path;
@@ -932,10 +932,10 @@ static GList *thumb_std_maint_move_tail = NULL;
 
 
 static void thumb_std_maint_move_step(TMaintMove *tm);
-static gint thumb_std_maint_move_idle(gpointer data);
+static gboolean thumb_std_maint_move_idle(gpointer data);
 
 
-static void thumb_std_maint_move_validate_cb(const gchar *path, gint valid, gpointer data)
+static void thumb_std_maint_move_validate_cb(const gchar *path, gboolean valid, gpointer data)
 {
        TMaintMove *tm = data;
        GdkPixbuf *pixbuf;
@@ -1019,7 +1019,7 @@ static void thumb_std_maint_move_step(TMaintMove *tm)
                                                      thumb_std_maint_move_validate_cb, tm);
 }
 
-static gint thumb_std_maint_move_idle(gpointer data)
+static gboolean thumb_std_maint_move_idle(gpointer data)
 {
        TMaintMove *tm;
        gchar *pathl;
index 1be6f8d..6dd5765 100644 (file)
@@ -28,7 +28,7 @@ typedef void (* ThumbLoaderStdFunc)(ThumbLoaderStd *tl, gpointer data);
 
 struct _ThumbLoaderStd
 {
-       gint standard_loader;
+       gboolean standard_loader;
 
        ImageLoader *il;
        FileData *fd;
@@ -41,15 +41,15 @@ struct _ThumbLoaderStd
        gchar *thumb_uri;
        const gchar *local_uri;
 
-       gint thumb_path_local;
+       gboolean thumb_path_local;
 
        gint requested_width;
        gint requested_height;
 
-       gint cache_enable;
-       gint cache_local;
-       gint cache_hit;
-       gint cache_retry;
+       gboolean cache_enable;
+       gboolean cache_local;
+       gboolean cache_hit;
+       gboolean cache_retry;
 
        gdouble progress;
 
@@ -67,8 +67,8 @@ void thumb_loader_std_set_callbacks(ThumbLoaderStd *tl,
                                    ThumbLoaderStdFunc func_error,
                                    ThumbLoaderStdFunc func_progress,
                                    gpointer data);
-void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gint enable_cache, gint local, gint retry_failed);
-gint thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd);
+void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
+gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd);
 void thumb_loader_std_free(ThumbLoaderStd *tl);
 
 GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl);
@@ -79,7 +79,7 @@ GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl);
  * for thumbnail's without a file: uri, validates against allowed_age in days
  */
 ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_age,
-                                                    void (*func_valid)(const gchar *path, gint valid, gpointer data),
+                                                    void (*func_valid)(const gchar *path, gboolean valid, gpointer data),
                                                     gpointer data);
 void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl);
 
index de13058..cd95054 100644 (file)
@@ -122,7 +122,7 @@ static void file_util_safe_del_close_cb(GtkWidget *dialog, gpointer data)
        *gd = NULL;
 }
 
-gint file_util_safe_unlink(const gchar *path)
+gboolean file_util_safe_unlink(const gchar *path)
 {
        static GenericDialog *gd = NULL;
        gchar *result = NULL;
index d840c07..5c586ed 100644 (file)
@@ -14,7 +14,7 @@
 #include "ui_utildlg.h"
 
 void file_util_trash_clear(void);
-gint file_util_safe_unlink(const gchar *path);
+gboolean file_util_safe_unlink(const gchar *path);
 gchar *file_util_safe_delete_status(void);
 
 #endif /* TRASH_H */
index 711f2af..4fed048 100644 (file)
@@ -240,13 +240,13 @@ typedef void (* FileUtilDoneFunc)(gboolean success, const gchar *done_path, gpoi
 
 struct _ThumbLoader
 {
-       gint standard_loader;
+       gboolean standard_loader;
 
        ImageLoader *il;
        FileData *fd;           /* fd->pixbuf contains final (scaled) image when done */
 
-       gint cache_enable;
-       gint cache_hit;
+       gboolean cache_enable;
+       gboolean cache_hit;
        gdouble percent_done;
 
        gint max_w;
@@ -291,7 +291,7 @@ struct _CollectionData
        gint window_h;
 
        /* contents changed since save flag */
-       gint changed;
+       gboolean changed;
 
        GHashTable *existence;
 };
@@ -331,7 +331,7 @@ struct _CollectTable
        gint sync_idle_id;
        gint drop_idle_id;
 
-       gint show_text;
+       gboolean show_text;
 
        /* file list for edit menu */
        GList *editmenu_fd_list;
@@ -828,10 +828,10 @@ struct _SecureSaveInfo {
        gchar *file_name; /**< final file name */
        gchar *tmp_file_name; /**< temporary file name */
        gint err; /**< set to non-zero value in case of error */
-       gint secure_save; /**< use secure save for this file, internal use only */
-       gint preserve_perms; /**< whether to preserve perms, TRUE by default */
-       gint preserve_mtime; /**< whether to preserve mtime, FALSE by default */
-       gint unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
+       gboolean secure_save; /**< use secure save for this file, internal use only */
+       gboolean preserve_perms; /**< whether to preserve perms, TRUE by default */
+       gboolean preserve_mtime; /**< whether to preserve mtime, FALSE by default */
+       gboolean unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
 };
 
 struct _CommandLine
index 9e1075f..694787e 100644 (file)
@@ -61,9 +61,9 @@ struct _BookMarkData
        void (*select_func)(const gchar *path, gpointer data);
        gpointer select_data;
 
-       gint no_defaults;
-       gint editable;
-       gint only_directories;
+       gboolean no_defaults;
+       gboolean editable;
+       gboolean only_directories;
 
        BookButtonData *active_button;
 };
@@ -389,7 +389,7 @@ static void bookmark_menu_position_cb(GtkMenu *menu, gint *x, gint *y, gint *pus
 }
 
 static void bookmark_menu_popup(BookMarkData *bm, GtkWidget *button,
-                               gint button_n, guint32 time, gint local)
+                               gint button_n, guint32 time, gboolean local)
 {
        GtkWidget *menu;
        BookButtonData *b;
@@ -420,7 +420,7 @@ static void bookmark_menu_popup(BookMarkData *bm, GtkWidget *button,
                }
 }
 
-static gint bookmark_press_cb(GtkWidget *button, GdkEventButton *event, gpointer data)
+static gboolean bookmark_press_cb(GtkWidget *button, GdkEventButton *event, gpointer data)
 {
        BookMarkData *bm = data;
 
@@ -431,7 +431,7 @@ static gint bookmark_press_cb(GtkWidget *button, GdkEventButton *event, gpointer
        return TRUE;
 }
 
-static gint bookmark_keypress_cb(GtkWidget *button, GdkEventKey *event, gpointer data)
+static gboolean bookmark_keypress_cb(GtkWidget *button, GdkEventKey *event, gpointer data)
 {
        BookMarkData *bm = data;
 
@@ -784,7 +784,7 @@ void bookmark_list_set_key(GtkWidget *list, const gchar *key)
        bookmark_populate(bm);
 }
 
-void bookmark_list_set_no_defaults(GtkWidget *list, gint no_defaults)
+void bookmark_list_set_no_defaults(GtkWidget *list, gboolean no_defaults)
 {
        BookMarkData *bm;
 
@@ -794,7 +794,7 @@ void bookmark_list_set_no_defaults(GtkWidget *list, gint no_defaults)
        bm->no_defaults = no_defaults;
 }
 
-void bookmark_list_set_editable(GtkWidget *list, gint editable)
+void bookmark_list_set_editable(GtkWidget *list, gboolean editable)
 {
        BookMarkData *bm;
 
@@ -804,7 +804,7 @@ void bookmark_list_set_editable(GtkWidget *list, gint editable)
        bm->editable = editable;
 }
 
-void bookmark_list_set_only_directories(GtkWidget *list, gint only_directories)
+void bookmark_list_set_only_directories(GtkWidget *list, gboolean only_directories)
 {
        BookMarkData *bm;