For the sake of consistency, use glib basic types everywhere.
authorLaurent Monin <geeqie@norz.org>
Tue, 26 Aug 2008 22:22:51 +0000 (22:22 +0000)
committerLaurent Monin <geeqie@norz.org>
Tue, 26 Aug 2008 22:22:51 +0000 (22:22 +0000)
54 files changed:
src/cache.c
src/cache.h
src/collect-table.c
src/color-man.c
src/color-man.h
src/debug.c
src/debug.h
src/dupe.h
src/editors.c
src/exif-common.c
src/exif-int.h
src/exif.c
src/exif.h
src/filedata.c
src/format_canon.c
src/format_canon.h
src/format_fuji.c
src/format_fuji.h
src/format_nikon.c
src/format_nikon.h
src/format_olympus.c
src/format_olympus.h
src/format_raw.c
src/format_raw.h
src/histogram.c
src/history_list.c
src/history_list.h
src/image-load.c
src/image.c
src/info.c
src/layout_config.c
src/layout_util.c
src/lirc.c
src/main.c
src/pan-calendar.c
src/pan-folder.c
src/pan-grid.c
src/pan-item.c
src/pan-view.c
src/pixbuf-renderer.c
src/pixbuf_util.c
src/pixbuf_util.h
src/preferences.c
src/print.c
src/remote.c
src/remote.h
src/secure_save.c
src/similar.c
src/slideshow.c
src/thumb.c
src/ui_fileops.c
src/ui_fileops.h
src/utilops.c
src/window.c

index 928611e..b3d4f36 100644 (file)
@@ -535,7 +535,7 @@ void cache_sim_data_set_date(CacheData *cd, time_t date)
        cd->have_date = TRUE;
 }
 
-void cache_sim_data_set_checksum(CacheData *cd, long checksum)
+void cache_sim_data_set_checksum(CacheData *cd, glong checksum)
 {
        if (!cd) return;
 
index 1cf0372..ff51039 100644 (file)
@@ -42,7 +42,7 @@ struct _CacheData
        gint width;
        gint height;
        time_t date;
-       long checksum;
+       glong checksum;
        guchar md5sum[16];
        ImageSimilarityData *sim;
 
@@ -64,7 +64,7 @@ CacheData *cache_sim_data_load(const gchar *path);
 
 void cache_sim_data_set_dimensions(CacheData *cd, gint w, gint h);
 void cache_sim_data_set_date(CacheData *cd, time_t date);
-void cache_sim_data_set_checksum(CacheData *cd, long checksum);
+void cache_sim_data_set_checksum(CacheData *cd, glong checksum);
 void cache_sim_data_set_md5sum(CacheData *cd, guchar digest[16]);
 void cache_sim_data_set_similarity(CacheData *cd, ImageSimilarityData *sd);
 gint cache_sim_data_filled(ImageSimilarityData *sd);
index 333bac2..c3e3242 100644 (file)
@@ -1335,7 +1335,7 @@ static void collection_table_insert_marker(CollectTable *ct, CollectInfo *info,
 
                parent = gtk_tree_view_get_bin_window(GTK_TREE_VIEW(ct->listview));
 
-               pb = gdk_pixbuf_new_from_xpm_data((const char **)marker_xpm);
+               pb = gdk_pixbuf_new_from_xpm_data((const gchar **)marker_xpm);
                gdk_pixbuf_render_pixmap_and_mask(pb, &pixmap, &mask, 128);
                gdk_pixbuf_unref(pb);
 
index 4b6a6f3..77186c9 100644 (file)
@@ -97,7 +97,7 @@ static void color_man_cache_unref(ColorManCache *cc)
 }
 
 static cmsHPROFILE color_man_cache_load_profile(ColorManProfileType type, const gchar *file,
-                                               unsigned char *data, guint data_len)
+                                               guchar *data, guint data_len)
 {
        cmsHPROFILE profile = NULL;
 
@@ -134,7 +134,7 @@ static cmsHPROFILE color_man_cache_load_profile(ColorManProfileType type, const
 }
 
 static ColorManCache *color_man_cache_new(ColorManProfileType in_type, const gchar *in_file,
-                                         unsigned char *in_data, guint in_data_len,
+                                         guchar *in_data, guint in_data_len,
                                          ColorManProfileType out_type, const gchar *out_file,
                                          gint has_alpha)
 {
@@ -251,7 +251,7 @@ static ColorManCache *color_man_cache_find(ColorManProfileType in_type, const gc
 }
 
 static ColorManCache *color_man_cache_get(ColorManProfileType in_type, const gchar *in_file,
-                                         unsigned char *in_data, guint in_data_len,
+                                         guchar *in_data, guint in_data_len,
                                          ColorManProfileType out_type, const gchar *out_file,
                                          gint has_alpha)
 {
@@ -355,7 +355,7 @@ static gint color_man_idle_cb(gpointer data)
 
 static ColorMan *color_man_new_real(ImageWindow *imd, GdkPixbuf *pixbuf,
                                    ColorManProfileType input_type, const gchar *input_file,
-                                   unsigned char *input_data, guint input_data_len,
+                                   guchar *input_data, guint input_data_len,
                                    ColorManProfileType screen_type, const gchar *screen_file)
 {
        ColorMan *cm;
@@ -402,7 +402,7 @@ void color_man_start_bg(ColorMan *cm, ColorManDoneFunc done_func, gpointer done_
 }
 
 ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
-                                unsigned char *input_data, guint input_data_len,
+                                guchar *input_data, guint input_data_len,
                                 ColorManProfileType screen_type, const gchar *screen_file)
 {
        return color_man_new_real(imd, pixbuf,
@@ -440,7 +440,7 @@ ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
 }
 
 ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
-                                unsigned char *input_data, guint input_data_len,
+                                guchar *input_data, guint input_data_len,
                                 ColorManProfileType screen_type, const gchar *screen_file)
 {
        /* no op */
index 95b47d6..2399026 100644 (file)
@@ -51,7 +51,7 @@ ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
                        ColorManProfileType input_type, const gchar *input_file,
                        ColorManProfileType screen_type, const gchar *screen_file);
 ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
-                                unsigned char *input_data, guint input_data_len,
+                                guchar *input_data, guint input_data_len,
                                 ColorManProfileType screen_type, const gchar *screen_file);
 void color_man_free(ColorMan *cm);
 
index c3858a2..59a4dd6 100644 (file)
@@ -19,7 +19,7 @@
  * Logging functions
  */
 
-gint log_domain_printf(const char *domain, const gchar *format, ...)
+gint log_domain_printf(const gchar *domain, const gchar *format, ...)
 {
        va_list ap;
        gchar buf[4096];
@@ -118,7 +118,7 @@ const gchar *get_exec_time(void)
        previous = tv;
        started = 1;
 
-       g_snprintf(timestr, sizeof(timestr), "%5d.%06d (+%05d.%06d)", (int)tv.tv_sec, (int)tv.tv_usec, (int)delta.tv_sec, (int)delta.tv_usec);
+       g_snprintf(timestr, sizeof(timestr), "%5d.%06d (+%05d.%06d)", (gint)tv.tv_sec, (gint)tv.tv_usec, (gint)delta.tv_sec, (gint)delta.tv_usec);
 
        return timestr;
 }
index 0aa4096..87b1bff 100644 (file)
@@ -17,7 +17,7 @@
 #define DOMAIN_DEBUG "debug"
 #define DOMAIN_INFO  "info"
 
-gint log_domain_printf(const char *domain, const gchar *format, ...) G_GNUC_PRINTF(2, 3);
+gint log_domain_printf(const gchar *domain, const gchar *format, ...) G_GNUC_PRINTF(2, 3);
 #define log_printf(...) log_domain_printf(DOMAIN_INFO, __VA_ARGS__)
 
 #ifdef DEBUG
index 7b4262b..5821016 100644 (file)
@@ -41,7 +41,7 @@ struct _DupeItem
 
        FileData *fd;
 
-       long checksum;
+       glong checksum;
        gchar *md5sum;
        gint width;
        gint height;
index fa68ac1..f91e1de 100644 (file)
@@ -231,7 +231,7 @@ static void editor_verbose_window_progress(EditorData *ed, const gchar *text)
 
        if (ed->total)
                {
-               gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ed->vd->progress), (double)ed->count / ed->total);
+               gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ed->vd->progress), (gdouble)ed->count / ed->total);
                }
 
        gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ed->vd->progress), (text) ? text : "");
index 2f033cf..66c8606 100644 (file)
 #include "ui_fileops.h"
 
 
-static double exif_rational_to_double(ExifRational *r, gint sign)
+static gdouble exif_rational_to_double(ExifRational *r, gint sign)
 {
        if (!r || r->den == 0.0) return 0.0;
 
-       if (sign) return (double)((int)r->num) / (double)((int)r->den);
-       return (double)r->num / r->den;
+       if (sign) return (gdouble)((gint)r->num) / (gdouble)((gint)r->den);
+       return (gdouble)r->num / r->den;
 }
 
-static double exif_get_rational_as_double(ExifData *exif, const gchar *key)
+static gdouble exif_get_rational_as_double(ExifData *exif, const gchar *key)
 {
        ExifRational *r;
        gint sign;
@@ -86,14 +86,14 @@ static gchar *remove_common_prefix(gchar *s, gchar *t)
        return s;
 }
 
-static double get_crop_factor(ExifData *exif)
+static gdouble get_crop_factor(ExifData *exif)
 {
-       double res_unit_tbl[] = {0.0, 25.4, 25.4, 10.0, 1.0, 0.001 };
-       double xres = exif_get_rational_as_double(exif, "Exif.Photo.FocalPlaneXResolution");
-       double yres = exif_get_rational_as_double(exif, "Exif.Photo.FocalPlaneYResolution");
+       gdouble res_unit_tbl[] = {0.0, 25.4, 25.4, 10.0, 1.0, 0.001 };
+       gdouble xres = exif_get_rational_as_double(exif, "Exif.Photo.FocalPlaneXResolution");
+       gdouble yres = exif_get_rational_as_double(exif, "Exif.Photo.FocalPlaneYResolution");
        gint res_unit;
        gint w, h;
-       double xsize, ysize, size, ratio;
+       gdouble xsize, ysize, size, ratio;
 
        if (xres == 0.0 || yres == 0.0) return 0.0;
 
@@ -211,17 +211,17 @@ static gchar *exif_build_formatted_ShutterSpeed(ExifData *exif)
        r = exif_get_rational(exif, "Exif.Photo.ExposureTime", NULL);
        if (r && r->num && r->den)
                {
-               double n = (double)r->den / (double)r->num;
+               gdouble n = (gdouble)r->den / (gdouble)r->num;
                return g_strdup_printf("%s%.0fs", n > 1.0 ? "1/" : "",
                                                  n > 1.0 ? n : 1.0 / n);
                }
        r = exif_get_rational(exif, "Exif.Photo.ShutterSpeedValue", NULL);
        if (r && r->num  && r->den)
                {
-               double n = pow(2.0, exif_rational_to_double(r, TRUE));
+               gdouble n = pow(2.0, exif_rational_to_double(r, TRUE));
 
                /* Correct exposure time to avoid values like 1/91s (seen on Minolta DImage 7) */
-               if (n > 1.0 && (int)n - ((int)(n/10))*10 == 1) n--;
+               if (n > 1.0 && (gint)n - ((gint)(n/10))*10 == 1) n--;
 
                return g_strdup_printf("%s%.0fs", n > 1.0 ? "1/" : "",
                                                  n > 1.0 ? floor(n) : 1.0 / n);
@@ -231,7 +231,7 @@ static gchar *exif_build_formatted_ShutterSpeed(ExifData *exif)
 
 static gchar *exif_build_formatted_Aperture(ExifData *exif)
 {
-       double n;
+       gdouble n;
 
        n = exif_get_rational_as_double(exif, "Exif.Photo.FNumber");
        if (n == 0.0) n = exif_get_rational_as_double(exif, "Exif.Photo.ApertureValue");
@@ -244,7 +244,7 @@ static gchar *exif_build_formatted_ExposureBias(ExifData *exif)
 {
        ExifRational *r;
        gint sign;
-       double n;
+       gdouble n;
 
        r = exif_get_rational(exif, "Exif.Photo.ExposureBiasValue", &sign);
        if (!r) return NULL;
@@ -255,7 +255,7 @@ static gchar *exif_build_formatted_ExposureBias(ExifData *exif)
 
 static gchar *exif_build_formatted_FocalLength(ExifData *exif)
 {
-       double n;
+       gdouble n;
 
        n = exif_get_rational_as_double(exif, "Exif.Photo.FocalLength");
        if (n == 0.0) return NULL;
@@ -265,7 +265,7 @@ static gchar *exif_build_formatted_FocalLength(ExifData *exif)
 static gchar *exif_build_formatted_FocalLength35mmFilm(ExifData *exif)
 {
        gint n;
-       double f, c;
+       gdouble f, c;
 
        if (exif_get_integer(exif, "Exif.Photo.FocalLengthIn35mmFilm", &n) && n != 0)
                {
@@ -295,13 +295,13 @@ static gchar *exif_build_formatted_SubjectDistance(ExifData *exif)
 {
        ExifRational *r;
        gint sign;
-       double n;
+       gdouble n;
 
        r = exif_get_rational(exif, "Exif.Photo.SubjectDistance", &sign);
        if (!r) return NULL;
 
-       if ((long)r->num == (long)0xffffffff) return g_strdup(_("infinity"));
-       if ((long)r->num == 0) return g_strdup(_("unknown"));
+       if ((glong)r->num == (glong)0xffffffff) return g_strdup(_("infinity"));
+       if ((glong)r->num == 0) return g_strdup(_("unknown"));
 
        n = exif_rational_to_double(r, sign);
        if (n == 0.0) return _("unknown");
@@ -369,8 +369,8 @@ static gchar *exif_build_formatted_Resolution(ExifData *exif)
        if (!rx || !ry) return NULL;
 
        units = exif_get_data_as_text(exif, "Exif.Image.ResolutionUnit");
-       text = g_strdup_printf("%0.f x %0.f (%s/%s)", rx->den ? (double)rx->num / rx->den : 1.0,
-                                                     ry->den ? (double)ry->num / ry->den : 1.0,
+       text = g_strdup_printf("%0.f x %0.f (%s/%s)", rx->den ? (gdouble)rx->num / rx->den : 1.0,
+                                                     ry->den ? (gdouble)ry->num / ry->den : 1.0,
                                                      _("dot"), (units) ? units : _("unknown"));
 
        g_free(units);
@@ -586,7 +586,7 @@ void exif_free_fd(FileData *fd, ExifData *exif)
        NNN.: the data in this segment
  */
 
-gint exif_jpeg_segment_find(unsigned char *data, guint size,
+gint exif_jpeg_segment_find(guchar *data, guint size,
                            guchar app_marker, const gchar *magic, guint magic_len,
                            guint *seg_offset, guint *seg_length)
 {
@@ -625,7 +625,7 @@ gint exif_jpeg_segment_find(unsigned char *data, guint size,
        return FALSE;
 }
 
-gint exif_jpeg_parse_color(ExifData *exif, unsigned char *data, guint size)
+gint exif_jpeg_parse_color(ExifData *exif, guchar *data, guint size)
 {
        guint seg_offset = 0;
        guint seg_length = 0;
@@ -674,7 +674,7 @@ gint exif_jpeg_parse_color(ExifData *exif, unsigned char *data, guint size)
 
        if (chunk_count > 0)
                {
-               unsigned char *cp_data;
+               guchar *cp_data;
                guint cp_length = 0;
                guint i;
 
index 1050010..dcccaea 100644 (file)
@@ -94,7 +94,7 @@ struct _ExifMarker
 struct _ExifTextList
 {
        gint value;
-       const gchardescription;
+       const gchar *description;
 };
 
 #define EXIF_TEXT_LIST_END { -1, NULL }
@@ -143,10 +143,10 @@ void exif_write_data_list(ExifData *exif, FILE *f, gint human_readable_list);
 #define EXIF_TIFD_SIZE 12
 
 
-guint16 exif_byte_get_int16(unsigned char *f, ExifByteOrder bo);
-guint32 exif_byte_get_int32(unsigned char *f, ExifByteOrder bo);
-void exif_byte_put_int16(unsigned char *f, guint16 n, ExifByteOrder bo);
-void exif_byte_put_int32(unsigned char *f, guint32 n, ExifByteOrder bo);
+guint16 exif_byte_get_int16(guchar *f, ExifByteOrder bo);
+guint32 exif_byte_get_int32(guchar *f, ExifByteOrder bo);
+void exif_byte_put_int16(guchar *f, guint16 n, ExifByteOrder bo);
+void exif_byte_put_int32(guchar *f, guint32 n, ExifByteOrder bo);
 
 ExifItem *exif_item_new(ExifFormatType format, guint tag,
                        guint elements, const ExifMarker *marker);
@@ -154,14 +154,14 @@ void exif_item_copy_data(ExifItem *item, void *src, guint len,
                         ExifFormatType src_format, ExifByteOrder bo);
 
 gint exif_parse_IFD_table(ExifData *exif,
-                         unsigned char *tiff, guint offset,
+                         guchar *tiff, guint offset,
                          guint size, ExifByteOrder bo,
                          gint level,
                          const ExifMarker *list);
 
-gint exif_tiff_directory_offset(unsigned char *data, const guint len,
+gint exif_tiff_directory_offset(guchar *data, const guint len,
                                guint *offset, ExifByteOrder *bo);
-gint exif_tiff_parse(ExifData *exif, unsigned char *tiff, guint size, ExifMarker *list);
+gint exif_tiff_parse(ExifData *exif, guchar *tiff, guint size, ExifMarker *list);
 
 gchar *exif_text_list_find_value(ExifTextList *list, guint value);
 
index f1d5b5c..7299461 100644 (file)
@@ -481,10 +481,10 @@ ExifItem *exif_item_new(ExifFormatType format, guint tag,
                        return item;
                        break;
                case EXIF_FORMAT_BYTE_UNSIGNED:
-                       item->data_len = sizeof(char) * elements;
+                       item->data_len = sizeof(gchar) * elements;
                        break;
                case EXIF_FORMAT_STRING:
-                       item->data_len = sizeof(char) * elements;
+                       item->data_len = sizeof(gchar) * elements;
                        break;
                case EXIF_FORMAT_SHORT_UNSIGNED:
                        item->data_len = sizeof(guint16) * elements;
@@ -496,10 +496,10 @@ ExifItem *exif_item_new(ExifFormatType format, guint tag,
                        item->data_len = sizeof(ExifRational) * elements;
                        break;
                case EXIF_FORMAT_BYTE:
-                       item->data_len = sizeof(char) * elements;
+                       item->data_len = sizeof(gchar) * elements;
                        break;
                case EXIF_FORMAT_UNDEFINED:
-                       item->data_len = sizeof(char) * elements;
+                       item->data_len = sizeof(gchar) * elements;
                        break;
                case EXIF_FORMAT_SHORT:
                        item->data_len = sizeof(gint16) * elements;
@@ -514,7 +514,7 @@ ExifItem *exif_item_new(ExifFormatType format, guint tag,
                        item->data_len = sizeof(float) * elements;
                        break;
                case EXIF_FORMAT_DOUBLE:
-                       item->data_len = sizeof(double) * elements;
+                       item->data_len = sizeof(gdouble) * elements;
                        break;
                }
 
@@ -531,7 +531,7 @@ static void exif_item_free(ExifItem *item)
        g_free(item);
 }
 
-char *exif_item_get_tag_name(ExifItem *item)
+gchar *exif_item_get_tag_name(ExifItem *item)
 {
        if (!item || !item->marker) return NULL;
        return g_strdup(item->marker->key);
@@ -549,7 +549,7 @@ guint exif_item_get_elements(ExifItem *item)
        return item->elements;
 }
 
-char *exif_item_get_data(ExifItem *item, guint *data_len)
+gchar *exif_item_get_data(ExifItem *item, guint *data_len)
 {
        if (data_len)
                *data_len = item->data_len;
@@ -563,13 +563,13 @@ guint exif_item_get_format_id(ExifItem *item)
 }
 
 
-char *exif_item_get_description(ExifItem *item)
+gchar *exif_item_get_description(ExifItem *item)
 {
        if (!item || !item->marker) return NULL;
        return g_strdup(_(item->marker->description));
 }
 
-const char *exif_item_get_format_name(ExifItem *item, gint brief)
+const gchar *exif_item_get_format_name(ExifItem *item, gint brief)
 {
        if (!item || !item->marker) return NULL;
        return (brief) ? ExifFormatList[item->format].short_name : ExifFormatList[item->format].description;
@@ -581,7 +581,7 @@ static GString *string_append_raw_bytes(GString *string, gpointer data, gint ne)
 
        for (i = 0 ; i < ne; i++)
                {
-               unsigned char c = ((char *)data)[i];
+               guchar c = ((gchar *)data)[i];
                if (c < 32 || c > 127) c = '.';
                g_string_append_printf(string, "%c", c);
                }
@@ -604,7 +604,7 @@ static GString *string_append_raw_bytes(GString *string, gpointer data, gint ne)
                        {
                        spacer = "";
                        }
-               g_string_append_printf(string, "%s%02x", spacer, ((char *)data)[i]);
+               g_string_append_printf(string, "%s%02x", spacer, ((gchar *)data)[i]);
                }
 
        return string;
@@ -636,7 +636,7 @@ gchar *exif_text_list_find_value(ExifTextList *list, guint value)
 
 /* note: the align_buf is used to avoid alignment issues (on sparc) */
 
-guint16 exif_byte_get_int16(unsigned char *f, ExifByteOrder bo)
+guint16 exif_byte_get_int16(guchar *f, ExifByteOrder bo)
 {
        guint16 align_buf;
 
@@ -648,7 +648,7 @@ guint16 exif_byte_get_int16(unsigned char *f, ExifByteOrder bo)
                return GUINT16_FROM_BE(align_buf);
 }
 
-guint32 exif_byte_get_int32(unsigned char *f, ExifByteOrder bo)
+guint32 exif_byte_get_int32(guchar *f, ExifByteOrder bo)
 {
        guint32 align_buf;
 
@@ -660,7 +660,7 @@ guint32 exif_byte_get_int32(unsigned char *f, ExifByteOrder bo)
                return GUINT32_FROM_BE(align_buf);
 }
 
-void exif_byte_put_int16(unsigned char *f, guint16 n, ExifByteOrder bo)
+void exif_byte_put_int16(guchar *f, guint16 n, ExifByteOrder bo)
 {
        guint16 align_buf;
 
@@ -676,7 +676,7 @@ void exif_byte_put_int16(unsigned char *f, guint16 n, ExifByteOrder bo)
        memcpy(f, &align_buf, sizeof(guint16));
 }
 
-void exif_byte_put_int32(unsigned char *f, guint32 n, ExifByteOrder bo)
+void exif_byte_put_int32(guchar *f, guint32 n, ExifByteOrder bo)
 {
        guint32 align_buf;
 
@@ -755,7 +755,7 @@ void exif_item_copy_data(ExifItem *item, void *src, guint len,
                case EXIF_FORMAT_STRING:
                        memcpy(dest, src, len);
                        /* string is NULL terminated, make sure this is true */
-                       if (((char *)dest)[len - 1] != '\0') ((char *)dest)[len - 1] = '\0';
+                       if (((gchar *)dest)[len - 1] != '\0') ((gchar *)dest)[len - 1] = '\0';
                        break;
                case EXIF_FORMAT_SHORT_UNSIGNED:
                case EXIF_FORMAT_SHORT:
@@ -807,13 +807,13 @@ void exif_item_copy_data(ExifItem *item, void *src, guint len,
                                ExifRational r;
 
                                rational_from_data(&r, src + i * bs, bo);
-                               if (r.den) ((double *)dest)[i] = (double)r.num / r.den;
+                               if (r.den) ((gdouble *)dest)[i] = (gdouble)r.num / r.den;
                                }
                        break;
                }
 }
 
-static gint exif_parse_IFD_entry(ExifData *exif, unsigned char *tiff, guint offset,
+static gint exif_parse_IFD_entry(ExifData *exif, guchar *tiff, guint offset,
                                 guint size, ExifByteOrder bo,
                                 gint level,
                                 const ExifMarker *list)
@@ -921,7 +921,7 @@ static gint exif_parse_IFD_entry(ExifData *exif, unsigned char *tiff, guint offs
 }
 
 gint exif_parse_IFD_table(ExifData *exif,
-                         unsigned char *tiff, guint offset,
+                         guchar *tiff, guint offset,
                          guint size, ExifByteOrder bo,
                          gint level,
                          const ExifMarker *list)
@@ -955,7 +955,7 @@ gint exif_parse_IFD_table(ExifData *exif,
  *-------------------------------------------------------------------
  */
 
-gint exif_tiff_directory_offset(unsigned char *data, const guint len,
+gint exif_tiff_directory_offset(guchar *data, const guint len,
                                guint *offset, ExifByteOrder *bo)
 {
        if (len < 8) return FALSE;
@@ -983,7 +983,7 @@ gint exif_tiff_directory_offset(unsigned char *data, const guint len,
        return (*offset < len);
 }
 
-gint exif_tiff_parse(ExifData *exif, unsigned char *tiff, guint size, ExifMarker *list)
+gint exif_tiff_parse(ExifData *exif, guchar *tiff, guint size, ExifMarker *list)
 {
        ExifByteOrder bo;
        guint offset;
@@ -1019,7 +1019,7 @@ gint exif_tiff_parse(ExifData *exif, unsigned char *tiff, guint size, ExifMarker
  */
 static ExifMarker jpeg_color_marker = { 0x8773, EXIF_FORMAT_UNDEFINED, -1, "Exif.Image.InterColorProfile", NULL, NULL };
 
-void exif_add_jpeg_color_profile(ExifData *exif, unsigned char *cp_data, guint cp_length)
+void exif_add_jpeg_color_profile(ExifData *exif, guchar *cp_data, guint cp_length)
 {
        ExifItem *item = exif_item_new(jpeg_color_marker.format, jpeg_color_marker.tag, 1,
                                     &jpeg_color_marker);
@@ -1032,7 +1032,7 @@ void exif_add_jpeg_color_profile(ExifData *exif, unsigned char *cp_data, guint c
 }
 
 static gint exif_jpeg_parse(ExifData *exif,
-                           unsigned char *data, guint size,
+                           guchar *data, guint size,
                            ExifMarker *list)
 {
        guint seg_offset = 0;
@@ -1060,11 +1060,11 @@ static gint exif_jpeg_parse(ExifData *exif,
        return res;
 }
 
-unsigned char *exif_get_color_profile(ExifData *exif, guint *data_len)
+guchar *exif_get_color_profile(ExifData *exif, guint *data_len)
 {
        ExifItem *prof_item = exif_get_item(exif, "Exif.Image.InterColorProfile");
        if (prof_item && exif_item_get_format_id(prof_item) == EXIF_FORMAT_UNDEFINED)
-               return (unsigned char*) exif_item_get_data(prof_item, data_len);
+               return (guchar *) exif_item_get_data(prof_item, data_len);
        return NULL;
 }
 
@@ -1099,9 +1099,9 @@ ExifItem *exif_get_next_item(ExifData *exif)
        return NULL;
 }
 
-static gint map_file(const gchar *path, void **mapping, int *size)
+static gint map_file(const gchar *path, void **mapping, gint *size)
 {
-       int fd;
+       gint fd;
        struct stat fs;
 
        fd = open(path, O_RDONLY);
@@ -1132,7 +1132,7 @@ static gint map_file(const gchar *path, void **mapping, int *size)
        return 0;
 }
 
-static gint unmap_file(void *mapping, int size)
+static gint unmap_file(void *mapping, gint size)
 {
        if (munmap(mapping, size) == -1)
                {
@@ -1165,7 +1165,7 @@ ExifData *exif_read(gchar *path, gchar *sidecar_path)
 {
        ExifData *exif;
        void *f;
-       int size, res;
+       gint size, res;
        gchar *pathl;
 
        if (!path) return NULL;
@@ -1182,10 +1182,10 @@ ExifData *exif_read(gchar *path, gchar *sidecar_path)
        exif->items = NULL;
        exif->current = NULL;
 
-       res = exif_jpeg_parse(exif, (unsigned char *)f, size, ExifKnownMarkersList);
+       res = exif_jpeg_parse(exif, (guchar *)f, size, ExifKnownMarkersList);
        if (res == -2)
                {
-               res = exif_tiff_parse(exif, (unsigned char *)f, size, ExifKnownMarkersList);
+               res = exif_tiff_parse(exif, (guchar *)f, size, ExifKnownMarkersList);
                }
 
        if (res != 0)
@@ -1201,16 +1201,16 @@ ExifData *exif_read(gchar *path, gchar *sidecar_path)
                        default:
                                break;
                        case FORMAT_RAW_EXIF_TIFF:
-                               res = exif_tiff_parse(exif, (unsigned char*)f + offset, size - offset,
+                               res = exif_tiff_parse(exif, (guchar *)f + offset, size - offset,
                                                      ExifKnownMarkersList);
                                break;
                        case FORMAT_RAW_EXIF_JPEG:
-                               res = exif_jpeg_parse(exif, (unsigned char*)f + offset, size - offset,
+                               res = exif_jpeg_parse(exif, (guchar *)f + offset, size - offset,
                                                      ExifKnownMarkersList);
                                break;
                        case FORMAT_RAW_EXIF_IFD_II:
                        case FORMAT_RAW_EXIF_IFD_MM:
-                               res = exif_parse_IFD_table(exif, (unsigned char*)f, offset, size - offset,
+                               res = exif_parse_IFD_table(exif, (guchar *)f, offset, size - offset,
                                                           (exif_type == FORMAT_RAW_EXIF_IFD_II) ?
                                                                EXIF_BYTE_ORDER_INTEL : EXIF_BYTE_ORDER_MOTOROLA,
                                                           0, ExifKnownMarkersList);
@@ -1218,7 +1218,7 @@ ExifData *exif_read(gchar *path, gchar *sidecar_path)
                        case FORMAT_RAW_EXIF_PROPRIETARY:
                                if (exif_parse_func)
                                        {
-                                       res = exif_parse_func((unsigned char*)f + offset, size - offset, exif);
+                                       res = exif_parse_func((guchar *)f + offset, size - offset, exif);
                                        }
                                break;
                        }
@@ -1262,7 +1262,7 @@ ExifItem *exif_get_item(ExifData *exif, const gchar *key)
 
 #define EXIF_DATA_AS_TEXT_MAX_COUNT 16
 
-gchar *exif_item_get_string(ExifItem *item, int idx)
+gchar *exif_item_get_string(ExifItem *item, gint idx)
 {
        return exif_item_get_data_as_text(item);
 }
@@ -1296,16 +1296,16 @@ gchar *exif_item_get_data_as_text(ExifItem *item)
                        if (ne == 1 && marker->list)
                                {
                                gchar *result;
-                               unsigned char val;
+                               guchar val;
 
                                if (item->format == EXIF_FORMAT_BYTE_UNSIGNED ||
                                    item->format == EXIF_FORMAT_UNDEFINED)
                                        {
-                                       val = ((unsigned char *)data)[0];
+                                       val = ((guchar *)data)[0];
                                        }
                                else
                                        {
-                                       val = (unsigned char)(((signed char *)data)[0]);
+                                       val = (guchar)(((signed gchar *)data)[0]);
                                        }
 
                                result = exif_text_list_find_value(marker->list, (guint)val);
@@ -1339,7 +1339,7 @@ gchar *exif_item_get_data_as_text(ExifItem *item)
                        for (i = 0; i < ne; i++)
                                {
                                g_string_append_printf(string, "%s%ld", (i > 0) ? ", " : "",
-                                                       (unsigned long int)((guint32 *)data)[i]);
+                                                       (gulong)((guint32 *)data)[i]);
                                }
                        break;
                case EXIF_FORMAT_RATIONAL_UNSIGNED:
@@ -1349,7 +1349,7 @@ gchar *exif_item_get_data_as_text(ExifItem *item)
 
                                r = &((ExifRational *)data)[i];
                                g_string_append_printf(string, "%s%ld/%ld", (i > 0) ? ", " : "",
-                                                       (unsigned long)r->num, (unsigned long)r->den);
+                                                       (gulong)r->num, (gulong)r->den);
                                }
                        break;
                case EXIF_FORMAT_SHORT:
@@ -1363,7 +1363,7 @@ gchar *exif_item_get_data_as_text(ExifItem *item)
                        for (i = 0; i < ne; i++)
                                {
                                g_string_append_printf(string, "%s%ld", (i > 0) ? ", " : "",
-                                                       (long int)((gint32 *)data)[i]);
+                                                       (glong)((gint32 *)data)[i]);
                                }
                        break;
                case EXIF_FORMAT_RATIONAL:
@@ -1373,7 +1373,7 @@ gchar *exif_item_get_data_as_text(ExifItem *item)
 
                                r = &((ExifRational *)data)[i];
                                g_string_append_printf(string, "%s%ld/%ld", (i > 0) ? ", " : "",
-                                                       (long)r->num, (long)r->den);
+                                                       (glong)r->num, (glong)r->den);
                                }
                        break;
                case EXIF_FORMAT_FLOAT:
@@ -1387,7 +1387,7 @@ gchar *exif_item_get_data_as_text(ExifItem *item)
                        for (i = 0; i < ne; i++)
                                {
                                g_string_append_printf(string, "%s%f", (i > 0) ? ", " : "",
-                                                       ((double *)data)[i]);
+                                                       ((gdouble *)data)[i]);
                                }
                        break;
                }
@@ -1521,7 +1521,7 @@ void exif_write_data_list(ExifData *exif, FILE *f, gint human_readable_list)
        fprintf(f, "----------------------------------------------------\n");
 }
 
-int exif_write(ExifData *exif)
+gint exif_write(ExifData *exif)
 {
        log_printf("Not compiled with EXIF write support");
        return 0;
@@ -1532,12 +1532,12 @@ ExifItem *exif_add_item(ExifData *exif, const gchar *key)
        return NULL;
 }
 
-int exif_item_delete(ExifData *exif, ExifItem *item)
+gint exif_item_delete(ExifData *exif, ExifItem *item)
 {
        return 0;
 }
 
-int exif_item_set_string(ExifItem *item, const char *str)
+gint exif_item_set_string(ExifItem *item, const gchar *str)
 {
        return 0;
 }
index 4c39fc0..2cab1b3 100644 (file)
@@ -111,7 +111,7 @@ ExifData *exif_read_fd(FileData *fd);
 void exif_free_fd(FileData *fd, ExifData *exif);
 
 
-int exif_write(ExifData *exif);
+gint exif_write(ExifData *exif);
 void exif_free(ExifData *exif);
 
 gchar *exif_get_data_as_text(ExifData *exif, const gchar *key);
@@ -124,42 +124,42 @@ ExifItem *exif_get_first_item(ExifData *exif);
 ExifItem *exif_get_next_item(ExifData *exif);
 
 
-char *exif_item_get_tag_name(ExifItem *item);
+gchar *exif_item_get_tag_name(ExifItem *item);
 guint exif_item_get_tag_id(ExifItem *item);
 guint exif_item_get_elements(ExifItem *item);
-char *exif_item_get_data(ExifItem *item, guint *data_len);
-char *exif_item_get_description(ExifItem *item);
+gchar *exif_item_get_data(ExifItem *item, guint *data_len);
+gchar *exif_item_get_description(ExifItem *item);
 guint exif_item_get_format_id(ExifItem *item);
-const char *exif_item_get_format_name(ExifItem *item, gint brief);
+const gchar *exif_item_get_format_name(ExifItem *item, gint brief);
 gchar *exif_item_get_data_as_text(ExifItem *item);
 gint exif_item_get_integer(ExifItem *item, gint *value);
 ExifRational *exif_item_get_rational(ExifItem *item, gint *sign);
 
-gchar *exif_item_get_string(ExifItem *item, int idx);
+gchar *exif_item_get_string(ExifItem *item, gint idx);
 
 const gchar *exif_get_description_by_key(const gchar *key);
 const gchar *exif_get_tag_description_by_key(const gchar *key);
 
 gchar *exif_get_formatted_by_key(ExifData *exif, const gchar *key, gint *key_valid);
 
-int exif_item_delete(ExifData *exif, ExifItem *item);
-int exif_item_set_string(ExifItem *item, const char *str);
+gint exif_item_delete(ExifData *exif, ExifItem *item);
+gint exif_item_set_string(ExifItem *item, const gchar *str);
 
-unsigned char *exif_get_color_profile(ExifData *exif, guint *data_len);
+guchar *exif_get_color_profile(ExifData *exif, guint *data_len);
 
 /* jpeg embedded icc support */
 
-void exif_add_jpeg_color_profile(ExifData *exif, unsigned char *cp_data, guint cp_length);
+void exif_add_jpeg_color_profile(ExifData *exif, guchar *cp_data, guint cp_length);
 
 
-gint exif_jpeg_segment_find(unsigned char *data, guint size,
+gint exif_jpeg_segment_find(guchar *data, guint size,
                                    guchar app_marker, const gchar *magic, guint magic_len,
                                    guint *seg_offset, guint *seg_length);
-gint exif_jpeg_parse_color(ExifData *exif, unsigned char *data, guint size);
+gint exif_jpeg_parse_color(ExifData *exif, guchar *data, guint size);
 
 /*raw support */
-gint format_raw_img_exif_offsets_fd(int fd, const gchar *path,
-                                   unsigned char *header_data, const guint header_len,
+gint format_raw_img_exif_offsets_fd(gint fd, const gchar *path,
+                                   guchar *header_data, const guint header_len,
                                    guint *image_offset, guint *exif_offset);
 
 
index 922b405..d71eca9 100644 (file)
@@ -90,16 +90,16 @@ gchar *text_from_size_abrev(gint64 size)
                }
        if (size < (gint64)1048576)
                {
-               return g_strdup_printf(_("%.1f K"), (double)size / 1024.0);
+               return g_strdup_printf(_("%.1f K"), (gdouble)size / 1024.0);
                }
        if (size < (gint64)1073741824)
                {
-               return g_strdup_printf(_("%.1f MB"), (double)size / 1048576.0);
+               return g_strdup_printf(_("%.1f MB"), (gdouble)size / 1048576.0);
                }
 
-       /* to avoid overflowing the double, do division in two steps */
+       /* to avoid overflowing the gdouble, do division in two steps */
        size /= 1048576;
-       return g_strdup_printf(_("%.1f GB"), (double)size / 1024.0);
+       return g_strdup_printf(_("%.1f GB"), (gdouble)size / 1024.0);
 }
 
 /* note: returned string is valid until next call to text_from_time() */
@@ -368,7 +368,7 @@ static FileData *file_data_new(const gchar *path_utf8, struct stat *st, gboolean
 
 static void file_data_check_sidecars(FileData *fd)
 {
-       int base_len;
+       gint base_len;
        GString *fname;
        FileData *parent_fd = NULL;
        GList *work;
@@ -677,8 +677,8 @@ void file_data_change_info_free(FileDataChangeInfo *fdci, FileData *fd)
 
 static gint sidecar_file_priority(const gchar *path)
 {
-       const char *extension = extension_from_path(path);
-       int i = 1;
+       const gchar *extension = extension_from_path(path);
+       gint i = 1;
        GList *work;
 
        if (extension == NULL)
@@ -809,7 +809,7 @@ static gint filelist_read_real(FileData *dir_fd, GList **files, GList **dirs, gi
        gchar *pathl;
        GList *dlist = NULL;
        GList *flist = NULL;
-       int (*stat_func)(const char *path, struct stat *buf);
+       gint (*stat_func)(const gchar *path, struct stat *buf);
 
        g_assert(files || dirs);
 
@@ -1478,7 +1478,7 @@ static void file_data_update_ci_dest(FileData *fd, const gchar *dest_path)
 
 static void file_data_update_ci_dest_preserve_ext(FileData *fd, const gchar *dest_path)
 {
-       const char *extension = extension_from_path(fd->change->source);
+       const gchar *extension = extension_from_path(fd->change->source);
        gchar *base = remove_extension_from_path(dest_path);
        gchar *old_path = fd->change->dest;
        
index 88bfef3..e5101e1 100644 (file)
@@ -43,7 +43,7 @@
  *-----------------------------------------------------------------------------
  */
 
-static gint canon_cr2_tiff_entry(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static gint canon_cr2_tiff_entry(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                                 guint *image_offset, gint *jpeg_encoding)
 {
        guint tag;
@@ -92,7 +92,7 @@ static gint canon_cr2_tiff_entry(unsigned char *data, const guint len, guint off
        return TRUE;
 }
 
-static gint canon_cr2_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static gint canon_cr2_tiff_table(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                                 guint *image_offset)
 {
        gint jpeg_encoding = FALSE;
@@ -117,7 +117,7 @@ static gint canon_cr2_tiff_table(unsigned char *data, const guint len, guint off
        return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
 }
 
-gint format_canon_raw_cr2(unsigned char *data, const guint len,
+gint format_canon_raw_cr2(guchar *data, const guint len,
                          guint *image_offset, guint *exif_offset)
 {
        guint jpeg_offset = 0;
@@ -150,7 +150,7 @@ gint format_canon_raw_cr2(unsigned char *data, const guint len,
 #define CRW_HEADER_SIZE                26
 #define CRW_DIR_ENTRY_SIZE     10
 
-gint format_canon_raw_crw(unsigned char *data, const guint len,
+gint format_canon_raw_crw(guchar *data, const guint len,
                          guint *image_offset, guint *exif_offset)
 {
        guint block_offset;
@@ -601,7 +601,7 @@ static void canon_mknote_parse_convert(ExifData *exif)
 }
 #endif
 
-gint format_canon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_canon_makernote(ExifData *exif, guchar *tiff, guint offset,
                            guint size, ExifByteOrder bo)
 {
        ExifItem *item;
index 41e2111..c2b828d 100644 (file)
 #include "exif-int.h"
 
 
-gint format_canon_raw_crw(unsigned char *data, const guint len,
+gint format_canon_raw_crw(guchar *data, const guint len,
                          guint *image_offset, guint *exif_offset);
 
-gint format_canon_raw_cr2(unsigned char *data, const guint len,
+gint format_canon_raw_cr2(guchar *data, const guint len,
                          guint *image_offset, guint *exif_offset);
 
 #define FORMAT_RAW_CANON { "crw", \
@@ -39,7 +39,7 @@ gint format_canon_raw_cr2(unsigned char *data, const guint len,
                           "Canon cr2", format_canon_raw_cr2 }
 
 
-gint format_canon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_canon_makernote(ExifData *exif, guchar *tiff, guint offset,
                            guint size, ExifByteOrder bo);
 
 #define FORMAT_EXIF_CANON { FORMAT_EXIF_MATCH_MAKE, "Canon", 5, "Canon", format_canon_makernote }
index a9247d0..d5a7cf1 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 
-gint format_fuji_raw(unsigned char *data, const guint len,
+gint format_fuji_raw(guchar *data, const guint len,
                     guint *image_offset, guint *exif_offset)
 {
        guint io;
@@ -175,10 +175,10 @@ EXIF_MARKER_LIST_END
 
 
 
-gint format_fuji_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_fuji_makernote(ExifData *exif, guchar *tiff, guint offset,
                           guint size, ExifByteOrder bo)
 {
-       unsigned char *data;
+       guchar *data;
        guint ifdstart;
 
        if (offset + 8 + 4 >= size) return FALSE;
index aa0793d..bfe7504 100644 (file)
@@ -18,7 +18,7 @@
 #include "exif-int.h"
 
 
-gint format_fuji_raw(unsigned char *data, const guint len,
+gint format_fuji_raw(guchar *data, const guint len,
                     guint *image_offset, guint *exif_offset);
 
 
@@ -28,7 +28,7 @@ gint format_fuji_raw(unsigned char *data, const guint len,
                          "Fuji raw", format_fuji_raw }
 
 
-gint format_fuji_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_fuji_makernote(ExifData *exif, guchar *tiff, guint offset,
                           guint size, ExifByteOrder bo);
 
 #define FORMAT_EXIF_FUJI { FORMAT_EXIF_MATCH_MAKERNOTE, "FUJIFILM", 8, "Fujifilm", format_fuji_makernote }
index 389bca0..dd9e9da 100644 (file)
  *-----------------------------------------------------------------------------
  */
 
-static guint nikon_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static guint nikon_tiff_table(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                              gint level,
                              guint *image_offset, guint *jpeg_len);
 
 
-static void nikon_tiff_entry(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static void nikon_tiff_entry(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                             gint level,
                             guint *image_offset, guint *image_length, guint *jpeg_start, guint *jpeg_len)
 {
@@ -97,7 +97,7 @@ static void nikon_tiff_entry(unsigned char *data, const guint len, guint offset,
                }
 }
 
-static guint nikon_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static guint nikon_tiff_table(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                              gint level,
                              guint *image_offset, guint *image_length)
 {
@@ -131,7 +131,7 @@ static guint nikon_tiff_table(unsigned char *data, const guint len, guint offset
        return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
 }
 
-gint format_nikon_raw(unsigned char *data, const guint len,
+gint format_nikon_raw(guchar *data, const guint len,
                      guint *image_offset, guint *exif_offset)
 {
        guint i_off = 0;
@@ -355,10 +355,10 @@ static ExifTextList NikonAFPoint[]= {
 };
 
 
-gint format_nikon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_nikon_makernote(ExifData *exif, guchar *tiff, guint offset,
                            guint size, ExifByteOrder bo)
 {
-       unsigned char *data;
+       guchar *data;
        ExifItem *item;
 
        if (offset + 8 + 4 >= size) return FALSE;
index 354a42e..6c3d32a 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "exif-int.h"
 
-gint format_nikon_raw(unsigned char *data, const guint len,
+gint format_nikon_raw(guchar *data, const guint len,
                      guint *image_offset, guint *exif_offset);
 
 #define FORMAT_RAW_NIKON { "nef", \
@@ -35,7 +35,7 @@ gint format_nikon_raw(unsigned char *data, const guint len,
                            FORMAT_RAW_EXIF_TIFF, NULL, \
                            "Samsung raw", format_nikon_raw }
 
-gint format_nikon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_nikon_makernote(ExifData *exif, guchar *tiff, guint offset,
                            guint size, ExifByteOrder bo);
 
 #define FORMAT_EXIF_NIKON { FORMAT_EXIF_MATCH_MAKERNOTE, "Nikon\x00", 6, "Nikon", format_nikon_makernote }, \
index 8485da9..1239b33 100644 (file)
  *-----------------------------------------------------------------------------
  */
 
-static guint olympus_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static guint olympus_tiff_table(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                                gint level,
                                guint *image_offset, guint *exif_offset);
 
 
-static void olympus_tiff_entry(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static void olympus_tiff_entry(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                               gint level,
                               guint *image_offset, guint *exif_offset)
 {
@@ -81,7 +81,7 @@ static void olympus_tiff_entry(unsigned char *data, const guint len, guint offse
                }
 }
 
-static guint olympus_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static guint olympus_tiff_table(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                                gint level,
                                guint *image_offset, guint *exif_offset)
 {
@@ -105,7 +105,7 @@ static guint olympus_tiff_table(unsigned char *data, const guint len, guint offs
        return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
 }
 
-gint format_olympus_raw(unsigned char *data, const guint len,
+gint format_olympus_raw(guchar *data, const guint len,
                        guint *image_offset, guint *exif_offset)
 {
        guint i_off = 0;
@@ -294,10 +294,10 @@ static ExifTextList OlympusWBColorTemp[]= {
        EXIF_TEXT_LIST_END
 };
 
-gint format_olympus_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_olympus_makernote(ExifData *exif, guchar *tiff, guint offset,
                              guint size, ExifByteOrder bo)
 {
-       unsigned char *data;
+       guchar *data;
        ExifItem *item;
 
        if (offset + 8 + 4 >= size) return FALSE;
index b1c5e42..8472fb8 100644 (file)
@@ -15,7 +15,7 @@
 #include "exif-int.h"
 
 
-gint format_olympus_raw(unsigned char *data, const guint len,
+gint format_olympus_raw(guchar *data, const guint len,
                        guint *image_offset, guint *exif_offset);
 
 
@@ -25,7 +25,7 @@ gint format_olympus_raw(unsigned char *data, const guint len,
                             "Olympus raw", format_olympus_raw }
 
 
-gint format_olympus_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_olympus_makernote(ExifData *exif, guchar *tiff, guint offset,
                              guint size, ExifByteOrder bo);
 
 #define FORMAT_EXIF_OLYMPUS { FORMAT_EXIF_MATCH_MAKERNOTE, "OLYMP\x00\x01", 7, \
index dbf4b1a..aaa75c6 100644 (file)
@@ -82,7 +82,7 @@ static FormatExifEntry format_exif_list[] = {
 };
 
 
-static guint tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static guint tiff_table(guchar *data, const guint len, guint offset, ExifByteOrder bo,
                        guint tag, ExifFormatType type,
                        guint *result_offset, guint *result_count)
 {
@@ -133,7 +133,7 @@ static guint tiff_table(unsigned char *data, const guint len, guint offset, Exif
        return exif_byte_get_int32(data + offset + count * 12, bo);
 }
 
-static gint format_tiff_find_tag_data(unsigned char *data, const guint len,
+static gint format_tiff_find_tag_data(guchar *data, const guint len,
                                      guint tag, ExifFormatType type,
                                      guint *result_offset, guint *result_count)
 {
@@ -179,7 +179,7 @@ static gint format_tiff_find_tag_data(unsigned char *data, const guint len,
        return FALSE;
 }
 
-static FormatRawEntry *format_raw_find(unsigned char *data, const guint len)
+static FormatRawEntry *format_raw_find(guchar *data, const guint len)
 {
        gint n;
        gint tiff;
@@ -231,7 +231,7 @@ static FormatRawEntry *format_raw_find(unsigned char *data, const guint len)
 }
 
 static gint format_raw_parse(FormatRawEntry *entry,
-                            unsigned char *data, const guint len,
+                            guchar *data, const guint len,
                             guint *image_offset, guint *exif_offset)
 {
        guint io = 0;
@@ -257,7 +257,7 @@ static gint format_raw_parse(FormatRawEntry *entry,
        return TRUE;
 }
 
-gint format_raw_img_exif_offsets(unsigned char *data, const guint len,
+gint format_raw_img_exif_offsets(guchar *data, const guint len,
                                 guint *image_offset, guint *exif_offset)
 {
        FormatRawEntry *entry;
@@ -272,7 +272,7 @@ gint format_raw_img_exif_offsets(unsigned char *data, const guint len,
 }
 
 
-FormatRawExifType format_raw_exif_offset(unsigned char *data, const guint len, guint *exif_offset,
+FormatRawExifType format_raw_exif_offset(guchar *data, const guint len, guint *exif_offset,
                                         FormatRawExifParseFunc *exif_parse_func)
 {
        FormatRawEntry *entry;
@@ -294,8 +294,8 @@ FormatRawExifType format_raw_exif_offset(unsigned char *data, const guint len, g
 }
 
 
-gint format_raw_img_exif_offsets_fd(int fd, const gchar *path,
-                                   unsigned char *header_data, const guint header_len,
+gint format_raw_img_exif_offsets_fd(gint fd, const gchar *path,
+                                   guchar *header_data, const guint header_len,
                                    guint *image_offset, guint *exif_offset)
 {
        FormatRawEntry *entry;
@@ -377,7 +377,7 @@ gint format_raw_img_exif_offsets_fd(int fd, const gchar *path,
 }
 
 
-static FormatExifEntry *format_exif_makernote_find(ExifData *exif, unsigned char *tiff,
+static FormatExifEntry *format_exif_makernote_find(ExifData *exif, guchar *tiff,
                                                   guint offset, guint size)
 {
        ExifItem *make;
@@ -414,7 +414,7 @@ static FormatExifEntry *format_exif_makernote_find(ExifData *exif, unsigned char
        return FALSE;
 }
 
-gint format_exif_makernote_parse(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_exif_makernote_parse(ExifData *exif, guchar *tiff, guint offset,
                                 guint size, ExifByteOrder bo)
 {
        FormatExifEntry *entry;
@@ -435,10 +435,10 @@ gint format_exif_makernote_parse(ExifData *exif, unsigned char *tiff, guint offs
  */
 #if DEBUG_RAW_TIFF
 
-static guint format_debug_tiff_table(unsigned char *data, const guint len, guint offset,
+static guint format_debug_tiff_table(guchar *data, const guint len, guint offset,
                                     ExifByteOrder bo, gint level);
 
-static void format_debug_tiff_entry(unsigned char *data, const guint len, guint offset,
+static void format_debug_tiff_entry(guchar *data, const guint len, guint offset,
                                    ExifByteOrder bo, gint level)
 {
        guint tag;
@@ -497,7 +497,7 @@ static void format_debug_tiff_entry(unsigned char *data, const guint len, guint
                }
 }
 
-static guint format_debug_tiff_table(unsigned char *data, const guint len, guint offset,
+static guint format_debug_tiff_table(guchar *data, const guint len, guint offset,
                                     ExifByteOrder bo, gint level)
 {
        guint count;
@@ -523,7 +523,7 @@ static guint format_debug_tiff_table(unsigned char *data, const guint len, guint
        return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
 }
 
-gint format_debug_tiff_raw(unsigned char *data, const guint len,
+gint format_debug_tiff_raw(guchar *data, const guint len,
                           guint *image_offset, guint *exif_offset)
 {
        ExifByteOrder bo;
index d7217d8..f9c1cf8 100644 (file)
@@ -31,19 +31,19 @@ typedef enum {
        FORMAT_RAW_EXIF_PROPRIETARY
 } FormatRawExifType;
 
-typedef gint (* FormatRawParseFunc)(unsigned char *data, const guint len,
+typedef gint (* FormatRawParseFunc)(guchar *data, const guint len,
                                    guint *image_offset, guint *exif_offset);
 
-typedef gint (* FormatRawExifParseFunc)(unsigned char *data, const guint len,
+typedef gint (* FormatRawExifParseFunc)(guchar *data, const guint len,
                                        ExifData *exif);
 
-gint format_raw_img_exif_offsets(unsigned char *data, const guint len,
+gint format_raw_img_exif_offsets(guchar *data, const guint len,
                                 guint *image_offset, guint *exif_offset);
-gint format_raw_img_exif_offsets_fd(int fd, const gchar *path,
-                                   unsigned char *header_data, const guint header_len,
+gint format_raw_img_exif_offsets_fd(gint fd, const gchar *path,
+                                   guchar *header_data, const guint header_len,
                                    guint *image_offset, guint *exif_offset);
 
-FormatRawExifType format_raw_exif_offset(unsigned char *data, const guint len, guint *exif_offset,
+FormatRawExifType format_raw_exif_offset(guchar *data, const guint len, guint *exif_offset,
                                         FormatRawExifParseFunc *exif_parse_func);
 
 
@@ -52,10 +52,10 @@ typedef enum {
        FORMAT_EXIF_MATCH_MAKERNOTE
 } FormatExifMatchType;
 
-typedef gint (* FormatExifParseFunc)(ExifData *exif, unsigned char *tiff, guint offset,
+typedef gint (* FormatExifParseFunc)(ExifData *exif, guchar *tiff, guint offset,
                                    guint size, ExifByteOrder bo);
 
-gint format_exif_makernote_parse(ExifData *exif, unsigned char *tiff, guint offset,
+gint format_exif_makernote_parse(ExifData *exif, guchar *tiff, guint offset,
                                 guint size, ExifByteOrder bo);
 
 
@@ -73,7 +73,7 @@ gint format_exif_makernote_parse(ExifData *exif, unsigned char *tiff, guint offs
                                "Tiff debugger MM", format_debug_tiff_raw }
 
 /* used for debugging only */
-gint format_debug_tiff_raw(unsigned char *data, const guint len,
+gint format_debug_tiff_raw(guchar *data, const guint len,
                           guint *image_offset, guint *exif_offset);
 #endif
 
index f8154d6..1a2305c 100644 (file)
@@ -164,7 +164,7 @@ gint histogram_draw(Histogram *histogram, GdkPixbuf *pixbuf, gint x, gint y, gin
        /* FIXME: use the coordinates correctly */
        gint i;
        gulong max = 0;
-       double logmax;
+       gdouble logmax;
 
        if (!histogram) return 0;
 
index 0aa8e9a..b764053 100644 (file)
@@ -179,7 +179,7 @@ static void history_list_free(HistoryData *hd)
        g_free(hd);
 }
 
-static HistoryData *history_list_find_by_key(const gcharkey)
+static HistoryData *history_list_find_by_key(const gchar *key)
 {
        GList *work = history_list;
 
@@ -194,7 +194,7 @@ static HistoryData *history_list_find_by_key(const gchar* key)
        return NULL;
 }
 
-const gchar *history_list_find_last_path_by_key(const gcharkey)
+const gchar *history_list_find_last_path_by_key(const gchar *key)
 {
        HistoryData *hd;
 
index 827f24e..5fba001 100644 (file)
@@ -25,7 +25,7 @@ void history_list_item_change(const gchar *key, const gchar *oldpath, const gcha
 void history_list_item_move(const gchar *key, const gchar *path, gint direction);
 void history_list_item_remove(const gchar *key, const gchar *path);
 
-const gchar *history_list_find_last_path_by_key(const gcharkey);
+const gchar *history_list_find_last_path_by_key(const gchar *key);
 
 /* the returned GList is internal, don't free it */
 GList *history_list_get_by_key(const gchar *key);
index 31a64c9..0e3bb16 100644 (file)
@@ -237,8 +237,8 @@ static gint image_loader_idle_cb(gpointer data)
 
 static gint image_loader_begin(ImageLoader *il)
 {
-       int b;
-       unsigned int offset = 0;
+       gint b;
+       guint offset = 0;
 
        if (!il->loader || il->pixbuf) return FALSE;
 
index 29f4f07..53fad30 100644 (file)
@@ -209,7 +209,7 @@ static gint image_post_process_color(ImageWindow *imd, gint start_row, ExifData
        ColorManProfileType screen_type;
        const gchar *input_file;
        const gchar *screen_file;
-       unsigned char *profile = NULL;
+       guchar *profile = NULL;
        guint profile_len;
 
        if (imd->cm) return FALSE;
index 80f5d19..6ff1a96 100644 (file)
@@ -261,7 +261,7 @@ static void info_tab_general_image(InfoData *id, gpointer data)
 
        if (!tab->compression_done && mem_size > 0)
                {
-               buf = g_strdup_printf("%.1f%%", (double)tab->byte_size / mem_size * 100.0);
+               buf = g_strdup_printf("%.1f%%", (gdouble)tab->byte_size / mem_size * 100.0);
                gtk_label_set_text(GTK_LABEL(tab->label_compression), buf);
                g_free(buf);
 
@@ -276,7 +276,7 @@ static void info_tab_general_image(InfoData *id, gpointer data)
 
 static gchar *mode_number(mode_t m)
 {
-       int mb, mu, mg, mo;
+       gint mb, mu, mg, mo;
 
        mb = mu = mg = mo = 0;
 
index 869219c..858eeb8 100644 (file)
@@ -366,7 +366,7 @@ GtkWidget *layout_config_new(void)
        return lc->box;
 }
 
-static char num_to_text_char(gint n)
+static gchar num_to_text_char(gint n)
 {
        switch (n)
                {
index dc1772b..ca8cc23 100644 (file)
@@ -1157,7 +1157,7 @@ static GtkRadioActionEntry menu_split_radio_entries[] = {
 
 #undef CB
 
-static const char *menu_ui_description =
+static const gchar *menu_ui_description =
 "<ui>"
 "  <menubar name='MainMenu'>"
 "    <menu action='FileMenu'>"
index 39bd084..a91901d 100644 (file)
@@ -189,7 +189,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
 
 void layout_image_lirc_init(LayoutWindow *lw)
 {
-       int flags;
+       gint flags;
        
        DEBUG_1("Initializing LIRC...");
        lirc_fd = lirc_init(GQ_APPNAME_LC, get_debug_level() > 0);
index d62b142..91f5e0a 100644 (file)
@@ -105,9 +105,9 @@ gchar *expand_tilde(const gchar *filename)
 #ifndef G_OS_UNIX
        return g_strdup(filename);
 #else
-       const char *notilde;
-       const char *slash;
-       const char *home;
+       const gchar *notilde;
+       const gchar *slash;
+       const gchar *home;
 
        if (filename[0] != '~')
                return g_strdup(filename);
@@ -296,7 +296,7 @@ static void parse_command_line_process_file(const gchar *file_path, gchar **path
        parse_command_line_add_file(file_path, path, file, list, collection_list);
 }
 
-static void parse_command_line(int argc, char *argv[], gchar **path, gchar **file,
+static void parse_command_line(gint argc, gchar *argv[], gchar **path, gchar **file,
                               GList **cmd_list, GList **collection_list,
                               gchar **geometry)
 {
@@ -488,7 +488,7 @@ static void parse_command_line(int argc, char *argv[], gchar **path, gchar **fil
                }
 }
 
-static void parse_command_line_for_debug_option(int argc, char *argv[])
+static void parse_command_line_for_debug_option(gint argc, gchar *argv[])
 {
 #ifdef DEBUG
        const gchar *debug_option = "--debug";
@@ -655,7 +655,7 @@ void exit_program(void)
        exit_program_final();
 }
 
-int main(int argc, char *argv[])
+gint main(gint argc, gchar *argv[])
 {
        LayoutWindow *lw;
        gchar *path = NULL;
index 785714c..41de7a8 100644 (file)
@@ -239,7 +239,7 @@ void pan_calendar_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *he
 
        DEBUG_1("biggest day contains %d images", day_max);
 
-       grid = (gint)(sqrt((double)day_max) + 0.5) * (PAN_THUMB_SIZE + PAN_SHADOW_OFFSET * 2 + PAN_THUMB_GAP);
+       grid = (gint)(sqrt((gdouble)day_max) + 0.5) * (PAN_THUMB_SIZE + PAN_SHADOW_OFFSET * 2 + PAN_THUMB_GAP);
        day_width = MAX(PAN_CAL_DAY_WIDTH, grid);
        day_height = MAX(PAN_CAL_DAY_HEIGHT, grid);
 
@@ -323,7 +323,7 @@ void pan_calendar_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *he
                        PanItem *pi_day;
                        gint dx, dy;
                        gint n = 0;
-                       char fake_path[20];
+                       gchar fake_path[20];
 
                        dt = pan_date_to_time(year, month, day);
 
index 8d1be7b..fec2b42 100644 (file)
@@ -123,8 +123,8 @@ static void pan_flower_position(FlowerGroup *group, FlowerGroup *parent,
 
        a = 2*PI * group->diameter / parent->circumference;
 
-       x = (gint)((double)radius * cos(parent->angle + a / 2));
-       y = (gint)((double)radius * sin(parent->angle + a / 2));
+       x = (gint)((gdouble)radius * cos(parent->angle + a / 2));
+       y = (gint)((gdouble)radius * sin(parent->angle + a / 2));
 
        parent->angle += a;
 
@@ -294,7 +294,7 @@ static FlowerGroup *pan_flower_group(PanWindow *pw, FileData *dir_fd, gint x, gi
 
        group->width = pi_box->width;
        group->height = pi_box->y + pi_box->height;
-       group->diameter = (int)sqrt(group->width * group->width + group->height * group->height);
+       group->diameter = (gint)sqrt(group->width * group->width + group->height * group->height);
 
        group->children = NULL;
 
index f6fd311..d5ed48b 100644 (file)
@@ -27,7 +27,7 @@ void pan_grid_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height
 
        list = pan_list_tree(dir_fd, SORT_NAME, TRUE, pw->ignore_symlinks);
 
-       grid_size = (gint)sqrt((double)g_list_length(list));
+       grid_size = (gint)sqrt((gdouble)g_list_length(list));
        if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE)
                {
                grid_size = grid_size * (512 + PAN_THUMB_GAP) * pw->image_size / 100;
index 577ffc4..2dca820 100644 (file)
@@ -523,8 +523,8 @@ gint pan_item_thumb_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRe
                                     &rx, &ry, &rw, &rh))
                        {
                        gdk_pixbuf_composite(pi->pixbuf, pixbuf, rx - x, ry - y, rw, rh,
-                                            (double) tx - x,
-                                            (double) ty - y,
+                                            (gdouble) tx - x,
+                                            (gdouble) ty - y,
                                             1.0, 1.0, GDK_INTERP_NEAREST,
                                             255);
                        }
@@ -663,8 +663,8 @@ gint pan_item_image_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRe
                if (pi->pixbuf)
                        {
                        gdk_pixbuf_composite(pi->pixbuf, pixbuf, rx - x, ry - y, rw, rh,
-                                            (double) pi->x - x,
-                                            (double) pi->y - y,
+                                            (gdouble) pi->x - x,
+                                            (gdouble) pi->y - y,
                                             1.0, 1.0, GDK_INTERP_NEAREST,
                                             pi->color_a);
                        }
index 902281e..e988e40 100644 (file)
@@ -2030,8 +2030,8 @@ static void button_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
        rx = ry = 0;
        if (pr->scale)
                {
-               rx = (double)(pr->x_scroll + event->x - pr->x_offset) / pr->scale;
-               ry = (double)(pr->y_scroll + event->y - pr->y_offset) / pr->scale;
+               rx = (gdouble)(pr->x_scroll + event->x - pr->x_offset) / pr->scale;
+               ry = (gdouble)(pr->y_scroll + event->y - pr->y_offset) / pr->scale;
                }
 
        pi = pan_item_find_by_coord(pw, PAN_ITEM_BOX, rx, ry, "info");
index 0f2198a..54b6acb 100644 (file)
@@ -1412,10 +1412,10 @@ static gint pr_source_tile_visible(PixbufRenderer *pr, SourceTile *st)
        x2 = ((pr->x_scroll + pr->vis_width) / pr->tile_width) * pr->tile_width + pr->tile_width;
        y2 = ((pr->y_scroll + pr->vis_height) / pr->tile_height) * pr->tile_height + pr->tile_height;
 
-       return !((double)st->x * pr->scale > (double)x2 ||
-                (double)(st->x + pr->source_tile_width) * pr->scale < (double)x1 ||
-                (double)st->y * pr->scale > (double)y2 ||
-                (double)(st->y + pr->source_tile_height) * pr->scale < (double)y1);
+       return !((gdouble)st->x * pr->scale > (gdouble)x2 ||
+                (gdouble)(st->x + pr->source_tile_width) * pr->scale < (gdouble)x1 ||
+                (gdouble)st->y * pr->scale > (gdouble)y2 ||
+                (gdouble)(st->y + pr->source_tile_height) * pr->scale < (gdouble)y1);
 }
 
 static SourceTile *pr_source_tile_new(PixbufRenderer *pr, gint x, gint y)
@@ -1637,17 +1637,17 @@ static gint pr_source_tile_render(PixbufRenderer *pr, ImageTile *it,
                }
        else
                {
-               double scale_x, scale_y;
+               gdouble scale_x, scale_y;
                gint sx, sy, sw, sh;
 
                if (pr->image_width == 0 || pr->image_height == 0) return FALSE;
-               scale_x = (double)pr->width / pr->image_width;
-               scale_y = (double)pr->height / pr->image_height;
+               scale_x = (gdouble)pr->width / pr->image_width;
+               scale_y = (gdouble)pr->height / pr->image_height;
 
-               sx = (double)(it->x + x) / scale_x;
-               sy = (double)(it->y + y) / scale_y;
-               sw = (double)w / scale_x;
-               sh = (double)h / scale_y;
+               sx = (gdouble)(it->x + x) / scale_x;
+               sy = (gdouble)(it->y + y) / scale_y;
+               sw = (gdouble)w / scale_x;
+               sh = (gdouble)h / scale_y;
 
                if (pr->width < PR_MIN_SCALE_SIZE || pr->height < PR_MIN_SCALE_SIZE) fast = TRUE;
 
@@ -1667,10 +1667,10 @@ static gint pr_source_tile_render(PixbufRenderer *pr, ImageTile *it,
                        st = work->data;
                        work = work->next;
 
-                       stx = floor((double)st->x * scale_x);
-                       sty = floor((double)st->y * scale_y);
-                       stw = ceil((double)(st->x + pr->source_tile_width) * scale_x) - stx;
-                       sth = ceil((double)(st->y + pr->source_tile_height) * scale_y) - sty;
+                       stx = floor((gdouble)st->x * scale_x);
+                       sty = floor((gdouble)st->y * scale_y);
+                       stw = ceil((gdouble)(st->x + pr->source_tile_width) * scale_x) - stx;
+                       sth = ceil((gdouble)(st->y + pr->source_tile_height) * scale_y) - sty;
 
                        if (pr_clip_region(stx, sty, stw, sth,
                                           it->x + x, it->y + y, w, h,
@@ -1683,16 +1683,16 @@ static gint pr_source_tile_render(PixbufRenderer *pr, ImageTile *it,
                                        }
                                else
                                        {
-                                       double offset_x;
-                                       double offset_y;
+                                       gdouble offset_x;
+                                       gdouble offset_y;
 
                                        /* may need to use unfloored stx,sty values here */
-                                       offset_x = (double)(stx - it->x);
-                                       offset_y = (double)(sty - it->y);
+                                       offset_x = (gdouble)(stx - it->x);
+                                       offset_y = (gdouble)(sty - it->y);
 
                                        gdk_pixbuf_scale(st->pixbuf, it->pixbuf, rx - it->x, ry - it->y, rw, rh,
-                                                (double) 0.0 + offset_x,
-                                                (double) 0.0 + offset_y,
+                                                (gdouble) 0.0 + offset_x,
+                                                (gdouble) 0.0 + offset_y,
                                                 scale_x, scale_y,
                                                 (fast) ? GDK_INTERP_NEAREST : pr->zoom_quality);
                                        draw = TRUE;
@@ -1913,7 +1913,7 @@ static void pr_tile_free_space(PixbufRenderer *pr, guint space, ImageTile *it)
 
                tiles = (pr->vis_width / pr->tile_width + 1) * (pr->vis_height / pr->tile_height + 1);
                tile_max = MAX(tiles * pr->tile_width * pr->tile_height * 3,
-                              (gint)((double)pr->tile_cache_max * 1048576.0 * pr->scale));
+                              (gint)((gdouble)pr->tile_cache_max * 1048576.0 * pr->scale));
                }
        else
                {
@@ -2060,10 +2060,10 @@ static void pr_tile_prepare(PixbufRenderer *pr, ImageTile *it)
 
 
 static void pr_tile_coords_map_orientation(PixbufRenderer *pr,
-                                    double tile_x, double tile_y, /* coordinates of the tile */
+                                    gdouble tile_x, gdouble tile_y, /* coordinates of the tile */
                                     gint image_w, gint image_h,
-                                    double tile_w, double tile_h,
-                                    double *res_x, double *res_y)
+                                    gdouble tile_w, gdouble tile_h,
+                                    gdouble *res_x, gdouble *res_y)
 {
        *res_x = tile_x;
        *res_y = tile_y;
@@ -2527,7 +2527,7 @@ static void pr_tile_render(PixbufRenderer *pr, ImageTile *it,
        else if (pr->zoom == 1.0 || pr->scale == 1.0)
                {
 
-               double src_x, src_y;
+               gdouble src_x, src_y;
                gint pb_x, pb_y;
                gint pb_w, pb_h;
                pr_tile_coords_map_orientation(pr, it->x, it->y,
@@ -2543,8 +2543,8 @@ static void pr_tile_render(PixbufRenderer *pr, ImageTile *it,
                if (has_alpha)
                        {
                        gdk_pixbuf_composite_color(pr->pixbuf, it->pixbuf, pb_x, pb_y, pb_w, pb_h,
-                                        (double) 0.0 - src_x,
-                                        (double) 0.0 - src_y,
+                                        (gdouble) 0.0 - src_x,
+                                        (gdouble) 0.0 - src_y,
                                         1.0, 1.0, GDK_INTERP_NEAREST,
                                         255, it->x + pb_x, it->y + pb_y,
                                         PR_ALPHA_CHECK_SIZE, PR_ALPHA_CHECK1, PR_ALPHA_CHECK2);
@@ -2580,15 +2580,15 @@ static void pr_tile_render(PixbufRenderer *pr, ImageTile *it,
                }
        else
                {
-               double scale_x, scale_y;
-               double src_x, src_y;
+               gdouble scale_x, scale_y;
+               gdouble src_x, src_y;
                gint pb_x, pb_y;
                gint pb_w, pb_h;
 
                if (pr->image_width == 0 || pr->image_height == 0) return;
 
-               scale_x = (double)pr->width / pr->image_width;
-               scale_y = (double)pr->height / pr->image_height;
+               scale_x = (gdouble)pr->width / pr->image_width;
+               scale_y = (gdouble)pr->height / pr->image_height;
 
                pr_tile_coords_map_orientation(pr, it->x / scale_x, it->y /scale_y ,
                                            pr->image_width, pr->image_height,
@@ -2608,16 +2608,16 @@ static void pr_tile_render(PixbufRenderer *pr, ImageTile *it,
                if (!has_alpha)
                        {
                        gdk_pixbuf_scale(pr->pixbuf, it->pixbuf, pb_x, pb_y, pb_w, pb_h,
-                                        (double) 0.0 - src_x * scale_x,
-                                        (double) 0.0 - src_y * scale_y,
+                                        (gdouble) 0.0 - src_x * scale_x,
+                                        (gdouble) 0.0 - src_y * scale_y,
                                         scale_x, scale_y,
                                         (fast) ? GDK_INTERP_NEAREST : pr->zoom_quality);
                        }
                else
                        {
                        gdk_pixbuf_composite_color(pr->pixbuf, it->pixbuf, pb_x, pb_y, pb_w, pb_h,
-                                        (double) 0.0 - src_x * scale_x,
-                                        (double) 0.0 - src_y * scale_y,
+                                        (gdouble) 0.0 - src_x * scale_x,
+                                        (gdouble) 0.0 - src_y * scale_y,
                                         scale_x, scale_y,
                                         (fast) ? GDK_INTERP_NEAREST : pr->zoom_quality,
                                         255, it->x + pb_x, it->y + pb_y,
@@ -3258,8 +3258,8 @@ static void pr_zoom_sync(PixbufRenderer *pr, gdouble zoom,
                                break;
                        case PR_SCROLL_RESET_CENTER:
                                /* center new image */
-                               pr->x_scroll = ((double)pr->image_width / 2.0 * pr->scale) - pr->vis_width / 2;
-                               pr->y_scroll = ((double)pr->image_height / 2.0 * pr->scale) - pr->vis_height / 2;
+                               pr->x_scroll = ((gdouble)pr->image_width / 2.0 * pr->scale) - pr->vis_width / 2;
+                               pr->y_scroll = ((gdouble)pr->image_height / 2.0 * pr->scale) - pr->vis_height / 2;
                                break;
                        case PR_SCROLL_RESET_TOPLEFT:
                        default:
@@ -3543,10 +3543,10 @@ void pixbuf_renderer_set_scroll_center(PixbufRenderer *pr, gdouble x, gdouble y)
        dst_x = x * pr->width  - pr->vis_width  / 2 - pr->x_scroll + CLAMP(pr->subpixel_x_scroll, -1.0, 1.0);
        dst_y = y * pr->height - pr->vis_height / 2 - pr->y_scroll + CLAMP(pr->subpixel_y_scroll, -1.0, 1.0);
 
-       pr->subpixel_x_scroll = dst_x - (int)dst_x;
-       pr->subpixel_y_scroll = dst_y - (int)dst_y;
+       pr->subpixel_x_scroll = dst_x - (gint)dst_x;
+       pr->subpixel_y_scroll = dst_y - (gint)dst_y;
 
-       pixbuf_renderer_scroll(pr, (int)dst_x, (int)dst_y);
+       pixbuf_renderer_scroll(pr, (gint)dst_x, (gint)dst_y);
 }
 
 
@@ -3915,10 +3915,10 @@ void pixbuf_renderer_area_changed(PixbufRenderer *pr, gint src_x, gint src_y, gi
                height += 2;
                }
 
-       x1 = (gint)floor((double)x * pr->scale);
-       y1 = (gint)floor((double)y * pr->scale);
-       x2 = (gint)ceil((double)(x + width) * pr->scale);
-       y2 = (gint)ceil((double)(y + height) * pr->scale);
+       x1 = (gint)floor((gdouble)x * pr->scale);
+       y1 = (gint)floor((gdouble)y * pr->scale);
+       x2 = (gint)ceil((gdouble)(x + width) * pr->scale);
+       y2 = (gint)ceil((gdouble)(y + height) * pr->scale);
 
        pr_queue(pr, x1, y1, x2 - x1, y2 - y1, FALSE, TILE_RENDER_AREA, TRUE, TRUE);
 }
index fb2f1e9..b25c0bb 100644 (file)
@@ -26,7 +26,7 @@
  *-----------------------------------------------------------------------------
  */
 
-gboolean pixbuf_to_file_as_png(GdkPixbuf *pixbuf, const char *filename)
+gboolean pixbuf_to_file_as_png(GdkPixbuf *pixbuf, const gchar *filename)
 {
        GError *error = NULL;
        gint ret;
index e483b53..05f6112 100644 (file)
@@ -15,7 +15,7 @@
 #define PIXBUF_UTIL_H
 
 
-gboolean pixbuf_to_file_as_png (GdkPixbuf *pixbuf, const char *filename);
+gboolean pixbuf_to_file_as_png (GdkPixbuf *pixbuf, const gchar *filename);
 gboolean pixbuf_to_file_as_jpg(GdkPixbuf *pixbuf, const gchar *filename, gint quality);
 
 
index 7249f4d..52c48b8 100644 (file)
@@ -146,7 +146,7 @@ static void zoom_increment_cb(GtkWidget *spin, gpointer data)
 static void slideshow_delay_cb(GtkWidget *spin, gpointer data)
 {
        c_options->slideshow.delay = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) *
-                                  (double)SLIDESHOW_SUBSECOND_PRECISION + 0.01);
+                                  (gdouble)SLIDESHOW_SUBSECOND_PRECISION + 0.01);
 }
 
 /*
@@ -959,7 +959,7 @@ static void config_tab_general(GtkWidget *notebook)
        c_options->slideshow.delay = options->slideshow.delay;
        spin = pref_spin_new(group, _("Delay between image change:"), _("seconds"),
                             SLIDESHOW_MIN_SECONDS, SLIDESHOW_MAX_SECONDS, 1.0, 1,
-                            options->slideshow.delay ? (double)options->slideshow.delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0,
+                            options->slideshow.delay ? (gdouble)options->slideshow.delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0,
                             G_CALLBACK(slideshow_delay_cb), NULL);
        gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS);
 
@@ -1009,7 +1009,7 @@ static void config_tab_image(GtkWidget *notebook)
 
        c_options->image.zoom_increment = options->image.zoom_increment;
        spin = pref_spin_new(group, _("Zoom increment:"), NULL,
-                            0.1, 4.0, 0.1, 1, (double)options->image.zoom_increment / 10.0,
+                            0.1, 4.0, 0.1, 1, (gdouble)options->image.zoom_increment / 10.0,
                             G_CALLBACK(zoom_increment_cb), NULL);
        gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS);
 
index abaf078..2e3e4f4 100644 (file)
@@ -486,7 +486,7 @@ static gdouble print_paper_size_convert_units(gdouble value, PaperUnits src, Pap
 
 static PaperUnits paper_unit_default(void)
 {
-       const char *result;
+       const gchar *result;
 #if 0
        /* this is not used because it is not even slightly portable */
        #include <langinfo.h>
@@ -520,7 +520,7 @@ static gint print_layout_page_count(PrintWindow *pw);
 
 static gint print_preview_unit(gdouble points)
 {
-       return (int)(points / PRINT_PREVIEW_SCALE);
+       return (gint)(points / PRINT_PREVIEW_SCALE);
 }
 
 static void print_proof_size(PrintWindow *pw, gdouble *width, gdouble *height)
@@ -956,7 +956,7 @@ struct _PipeError {
 static sig_atomic_t pipe_handler_error = FALSE;
 static PipeError *pipe_handler_data = NULL;
 
-static void pipe_handler_sigpipe_cb(int fd)
+static void pipe_handler_sigpipe_cb(gint fd)
 {
        pipe_handler_error = TRUE;
 }
@@ -1609,7 +1609,7 @@ static gdouble convert_pango_dpi(gdouble points)
                klass = G_OBJECT_CLASS(GTK_SETTINGS_GET_CLASS(settings));
                if (g_object_class_find_property(klass, "gtk-xft-dpi"))
                        {
-                       int int_dpi;
+                       gint int_dpi;
                        g_object_get(settings, "gtk-xft-dpi", &int_dpi, NULL);
                        dpi = (gdouble)int_dpi / PANGO_SCALE;
                        }
index 9547a7e..73e32a2 100644 (file)
@@ -123,7 +123,7 @@ static gboolean remote_server_client_cb(GIOChannel *source, GIOCondition conditi
        return TRUE;
 }
 
-static void remote_server_client_add(RemoteConnection *rc, int fd)
+static void remote_server_client_add(RemoteConnection *rc, gint fd)
 {
        RemoteClient *client;
        GIOChannel *channel;
@@ -165,8 +165,8 @@ static void remote_server_clients_close(RemoteConnection *rc)
 static gboolean remote_server_read_cb(GIOChannel *source, GIOCondition condition, gpointer data)
 {
        RemoteConnection *rc = data;
-       int fd;
-       unsigned int alen;
+       gint fd;
+       guint alen;
 
        fd = accept(rc->fd, NULL, &alen);
        if (fd == -1)
@@ -200,7 +200,7 @@ static RemoteConnection *remote_server_open(const gchar *path)
        RemoteConnection *rc;
        struct sockaddr_un addr;
        gint sun_path_len;
-       int fd;
+       gint fd;
        GIOChannel *channel;
 
        if (remote_server_exists(path))
@@ -256,7 +256,7 @@ static RemoteConnection *remote_client_open(const gchar *path)
        struct stat st;
        struct sockaddr_un addr;
        gint sun_path_len;
-       int fd;
+       gint fd;
 
        if (stat(path, &st) != 0 || !S_ISSOCK(st.st_mode)) return NULL;
 
@@ -286,7 +286,7 @@ static RemoteConnection *remote_client_open(const gchar *path)
 
 static sig_atomic_t sigpipe_occured = FALSE;
 
-static void sighandler_sigpipe(int sig)
+static void sighandler_sigpipe(gint sig)
 {
        sigpipe_occured = TRUE;
 }
@@ -669,7 +669,7 @@ void remote_help(void)
                }
 }
 
-GList *remote_build_list(GList *list, int argc, char *argv[], GList **errors)
+GList *remote_build_list(GList *list, gint argc, gchar *argv[], GList **errors)
 {
        gint i;
 
index 84d8a04..29b39ee 100644 (file)
 
 typedef struct _RemoteConnection RemoteConnection;
 
-typedef void RemoteReadFunc(RemoteConnection *rc, const char *text, gpointer data);
+typedef void RemoteReadFunc(RemoteConnection *rc, const gchar *text, gpointer data);
 
 struct _RemoteConnection {
        gint server;
-       int fd;
+       gint fd;
        gchar *path;
 
        gint channel_id;
@@ -33,7 +33,7 @@ struct _RemoteConnection {
 
 
 void remote_close(RemoteConnection *rc);
-GList *remote_build_list(GList *list, int argc, char *argv[], GList **errors);
+GList *remote_build_list(GList *list, gint argc, gchar *argv[], GList **errors);
 void remote_help(void);
 void remote_control(const gchar *arg_exec, GList *remote_list, const gchar *path,
                    GList *cmd_list, GList *collection_list);
index a52651e..253b44b 100644 (file)
@@ -232,7 +232,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) {
-               int fail = 0;
+               gint fail = 0;
 
 #ifdef HAVE_FFLUSH
                fail = (fflush(ssi->fp) == EOF);
index 247c722..0ee308d 100644 (file)
@@ -68,7 +68,7 @@ void image_sim_free(ImageSimilarityData *sd)
        g_free(sd);
 }
 
-static int image_sim_channel_eq_sort_cb(const void *a, const void *b)
+static gint image_sim_channel_eq_sort_cb(const void *a, const void *b)
 {
        gint *pa = (void *)a;
        gint *pb = (void *)b;
index bea4bbf..05a4c8e 100644 (file)
@@ -76,7 +76,7 @@ static GList *generate_random_list(SlideShowData *ss)
 
        while (src_list)
                {
-               gint p = (double)rand() / ((double)RAND_MAX + 1.0) * g_list_length(src_list);
+               gint p = (gdouble)rand() / ((gdouble)RAND_MAX + 1.0) * g_list_length(src_list);
                work = g_list_nth(src_list, p);
                list = g_list_prepend(list, work->data);
                src_list = g_list_remove(src_list, work->data);
index 86493a4..5642353 100644 (file)
@@ -186,16 +186,16 @@ static void thumb_loader_done_cb(ImageLoader *il, gpointer data)
                {
                gint w, h;
 
-               if (((double)tl->max_w / pw) < ((double)tl->max_h / ph))
+               if (((gdouble)tl->max_w / pw) < ((gdouble)tl->max_h / ph))
                        {
                        w = tl->max_w;
-                       h = (double)w / pw * ph;
+                       h = (gdouble)w / pw * ph;
                        if (h < 1) h = 1;
                        }
                else
                        {
                        h = tl->max_h;
-                       w = (double)h / ph * pw;
+                       w = (gdouble)h / ph * pw;
                        if (w < 1) w = 1;
                        }
                
@@ -504,7 +504,7 @@ void thumb_loader_free(ThumbLoader *tl)
 }
 
 #if 0
-gint thumb_from_xpm_d(const char **data, gint max_w, gint max_h, GdkPixmap **pixmap, GdkBitmap **mask)
+gint thumb_from_xpm_d(const gchar **data, gint max_w, gint max_h, GdkPixmap **pixmap, GdkBitmap **mask)
 {
        GdkPixbuf *pixbuf;
        gint w, h;
index ae02b32..62e4213 100644 (file)
@@ -275,7 +275,7 @@ gint filetime_set(const gchar *s, time_t tval)
        return ret;
 }
 
-gint access_file(const gchar *s, int mode)
+gint access_file(const gchar *s, gint mode)
 {
        gchar *sl;
        gint ret;
@@ -322,7 +322,7 @@ gint symlink_utf8(const gchar *source, const gchar *target)
        return ret;
 }
 
-gint mkdir_utf8(const gchar *s, int mode)
+gint mkdir_utf8(const gchar *s, gint mode)
 {
        gchar *sl;
        gint ret;
@@ -428,9 +428,9 @@ gint copy_file(const gchar *s, const gchar *t)
 
        if (!fi || !fo) return FALSE;
 
-       while ((b = fread(buf, sizeof(char), sizeof(buf), fi)) && b != 0)
+       while ((b = fread(buf, sizeof(gchar), sizeof(buf), fi)) && b != 0)
                {
-               if (fwrite(buf, sizeof(char), b, fo) != b)
+               if (fwrite(buf, sizeof(gchar), b, fo) != b)
                        {
                        fclose(fi);
                        fclose(fo);
index 3749040..b9c8ca8 100644 (file)
@@ -44,10 +44,10 @@ gint islink(const gchar *s);
 gint64 filesize(const gchar *s);
 time_t filetime(const gchar *s);
 gint filetime_set(const gchar *s, time_t tval);
-gint access_file(const gchar *s, int mode);
+gint access_file(const gchar *s, gint mode);
 gint unlink_file(const gchar *s);
 gint symlink_utf8(const gchar *source, const gchar *target);
-gint mkdir_utf8(const gchar *s, int mode);
+gint mkdir_utf8(const gchar *s, gint mode);
 gint rmdir_utf8(const gchar *s);
 gint copy_file_attributes(const gchar *s, const gchar *t, gint perms, gint mtime);
 gint copy_file(const gchar *s, const gchar *t);
index fce6189..bd3ba96 100644 (file)
@@ -2031,7 +2031,7 @@ static gboolean file_util_rename_dir_scan(UtilityData *ud, FileData *fd)
        return ok;
 }
 
-static gboolean file_util_rename_dir_prepare(UtilityData *ud, const char *new_path)
+static gboolean file_util_rename_dir_prepare(UtilityData *ud, const gchar *new_path)
 {
        gboolean ok;
        GList *work;
@@ -2081,7 +2081,7 @@ static gboolean file_util_rename_dir_prepare(UtilityData *ud, const char *new_pa
 }
        
 
-static void file_util_rename_dir_full(FileData *fd, const char *new_path, GtkWidget *parent, UtilityPhase phase)
+static void file_util_rename_dir_full(FileData *fd, const gchar *new_path, GtkWidget *parent, UtilityPhase phase)
 {
        UtilityData *ud;
 
@@ -2112,7 +2112,7 @@ static void file_util_rename_dir_full(FileData *fd, const char *new_path, GtkWid
        file_util_dialog_run(ud);
 }
 
-static void file_util_create_dir_full(FileData *fd, const char *dest_path, GtkWidget *parent, UtilityPhase phase)
+static void file_util_create_dir_full(FileData *fd, const gchar *dest_path, GtkWidget *parent, UtilityPhase phase)
 {
        UtilityData *ud;
 
index 75a558f..decbe41 100644 (file)
@@ -97,7 +97,7 @@ static gchar *command_result(const gchar *binary, const gchar *command)
        f = popen(command, "r");
        if (!f) return NULL;
 
-       while ((l = fread(buf, sizeof(char), sizeof(buf), f)) > 0)
+       while ((l = fread(buf, sizeof(gchar), sizeof(buf), f)) > 0)
                {
                if (!result)
                        {