Mercurial > geeqie
changeset 1000:4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
line wrap: on
line diff
--- a/src/cache.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/cache.c Tue Aug 26 22:22:51 2008 +0000 @@ -535,7 +535,7 @@ 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;
--- a/src/cache.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/cache.h Tue Aug 26 22:22:51 2008 +0000 @@ -42,7 +42,7 @@ gint width; gint height; time_t date; - long checksum; + glong checksum; guchar md5sum[16]; ImageSimilarityData *sim; @@ -64,7 +64,7 @@ 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);
--- a/src/collect-table.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/collect-table.c Tue Aug 26 22:22:51 2008 +0000 @@ -1335,7 +1335,7 @@ 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);
--- a/src/color-man.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/color-man.c Tue Aug 26 22:22:51 2008 +0000 @@ -97,7 +97,7 @@ } 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 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_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 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 @@ } 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_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 */
--- a/src/color-man.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/color-man.h Tue Aug 26 22:22:51 2008 +0000 @@ -51,7 +51,7 @@ 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);
--- a/src/debug.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/debug.c Tue Aug 26 22:22:51 2008 +0000 @@ -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 @@ 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; }
--- a/src/debug.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/debug.h Tue Aug 26 22:22:51 2008 +0000 @@ -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
--- a/src/dupe.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/dupe.h Tue Aug 26 22:22:51 2008 +0000 @@ -41,7 +41,7 @@ FileData *fd; - long checksum; + glong checksum; gchar *md5sum; gint width; gint height;
--- a/src/editors.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/editors.c Tue Aug 26 22:22:51 2008 +0000 @@ -231,7 +231,7 @@ 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 : "");
--- a/src/exif-common.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/exif-common.c Tue Aug 26 22:22:51 2008 +0000 @@ -42,15 +42,15 @@ #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 @@ 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 @@ 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_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 @@ { 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_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_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 @@ { 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 @@ 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 @@ 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 @@ 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 @@ if (chunk_count > 0) { - unsigned char *cp_data; + guchar *cp_data; guint cp_length = 0; guint i;
--- a/src/exif-int.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/exif-int.h Tue Aug 26 22:22:51 2008 +0000 @@ -94,7 +94,7 @@ struct _ExifTextList { gint value; - const gchar* description; + const gchar *description; }; #define EXIF_TEXT_LIST_END { -1, NULL } @@ -143,10 +143,10 @@ #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 @@ 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);
--- a/src/exif.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/exif.c Tue Aug 26 22:22:51 2008 +0000 @@ -481,10 +481,10 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } -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 @@ 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 @@ { 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 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } 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_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 @@ 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 @@ */ 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 @@ } 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 @@ 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 @@ 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 @@ 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; void *f; - int size, res; + gint size, res; gchar *pathl; if (!path) return NULL; @@ -1182,10 +1182,10 @@ 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 @@ 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 @@ 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 @@ #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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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; }
--- a/src/exif.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/exif.h Tue Aug 26 22:22:51 2008 +0000 @@ -111,7 +111,7 @@ 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_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);
--- a/src/filedata.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/filedata.c Tue Aug 26 22:22:51 2008 +0000 @@ -90,16 +90,16 @@ } 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 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 @@ 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 @@ 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_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;
--- a/src/format_canon.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_canon.c Tue Aug 26 22:22:51 2008 +0000 @@ -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 @@ 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 @@ 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 @@ #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 @@ } #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;
--- a/src/format_canon.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_canon.h Tue Aug 26 22:22:51 2008 +0000 @@ -23,10 +23,10 @@ #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 @@ "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 }
--- a/src/format_fuji.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_fuji.c Tue Aug 26 22:22:51 2008 +0000 @@ -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 @@ -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;
--- a/src/format_fuji.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_fuji.h Tue Aug 26 22:22:51 2008 +0000 @@ -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 @@ "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 }
--- a/src/format_nikon.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_nikon.c Tue Aug 26 22:22:51 2008 +0000 @@ -38,12 +38,12 @@ *----------------------------------------------------------------------------- */ -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 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 @@ 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 @@ }; -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;
--- a/src/format_nikon.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_nikon.h Tue Aug 26 22:22:51 2008 +0000 @@ -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 @@ 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 }, \
--- a/src/format_olympus.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_olympus.c Tue Aug 26 22:22:51 2008 +0000 @@ -35,12 +35,12 @@ *----------------------------------------------------------------------------- */ -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 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 @@ 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 @@ 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;
--- a/src/format_olympus.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_olympus.h Tue Aug 26 22:22:51 2008 +0000 @@ -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 @@ "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, \
--- a/src/format_raw.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_raw.c Tue Aug 26 22:22:51 2008 +0000 @@ -82,7 +82,7 @@ }; -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 @@ 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 @@ 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 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 @@ 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 @@ } -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 @@ } -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 @@ } -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 @@ 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 @@ */ #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 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 @@ 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;
--- a/src/format_raw.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/format_raw.h Tue Aug 26 22:22:51 2008 +0000 @@ -31,19 +31,19 @@ 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 @@ 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 @@ "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
--- a/src/histogram.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/histogram.c Tue Aug 26 22:22:51 2008 +0000 @@ -164,7 +164,7 @@ /* FIXME: use the coordinates correctly */ gint i; gulong max = 0; - double logmax; + gdouble logmax; if (!histogram) return 0;
--- a/src/history_list.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/history_list.c Tue Aug 26 22:22:51 2008 +0000 @@ -179,7 +179,7 @@ g_free(hd); } -static HistoryData *history_list_find_by_key(const gchar* key) +static HistoryData *history_list_find_by_key(const gchar *key) { GList *work = history_list; @@ -194,7 +194,7 @@ return NULL; } -const gchar *history_list_find_last_path_by_key(const gchar* key) +const gchar *history_list_find_last_path_by_key(const gchar *key) { HistoryData *hd;
--- a/src/history_list.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/history_list.h Tue Aug 26 22:22:51 2008 +0000 @@ -25,7 +25,7 @@ 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 gchar* key); +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);
--- a/src/image-load.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/image-load.c Tue Aug 26 22:22:51 2008 +0000 @@ -237,8 +237,8 @@ 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;
--- a/src/image.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/image.c Tue Aug 26 22:22:51 2008 +0000 @@ -209,7 +209,7 @@ 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;
--- a/src/info.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/info.c Tue Aug 26 22:22:51 2008 +0000 @@ -261,7 +261,7 @@ 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 gchar *mode_number(mode_t m) { - int mb, mu, mg, mo; + gint mb, mu, mg, mo; mb = mu = mg = mo = 0;
--- a/src/layout_config.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/layout_config.c Tue Aug 26 22:22:51 2008 +0000 @@ -366,7 +366,7 @@ return lc->box; } -static char num_to_text_char(gint n) +static gchar num_to_text_char(gint n) { switch (n) {
--- a/src/layout_util.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/layout_util.c Tue Aug 26 22:22:51 2008 +0000 @@ -1157,7 +1157,7 @@ #undef CB -static const char *menu_ui_description = +static const gchar *menu_ui_description = "<ui>" " <menubar name='MainMenu'>" " <menu action='FileMenu'>"
--- a/src/lirc.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/lirc.c Tue Aug 26 22:22:51 2008 +0000 @@ -189,7 +189,7 @@ 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);
--- a/src/main.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/main.c Tue Aug 26 22:22:51 2008 +0000 @@ -105,9 +105,9 @@ #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 @@ 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_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 @@ exit_program_final(); } -int main(int argc, char *argv[]) +gint main(gint argc, gchar *argv[]) { LayoutWindow *lw; gchar *path = NULL;
--- a/src/pan-calendar.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/pan-calendar.c Tue Aug 26 22:22:51 2008 +0000 @@ -239,7 +239,7 @@ 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 @@ 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);
--- a/src/pan-folder.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/pan-folder.c Tue Aug 26 22:22:51 2008 +0000 @@ -123,8 +123,8 @@ 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 @@ 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;
--- a/src/pan-grid.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/pan-grid.c Tue Aug 26 22:22:51 2008 +0000 @@ -27,7 +27,7 @@ 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;
--- a/src/pan-item.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/pan-item.c Tue Aug 26 22:22:51 2008 +0000 @@ -523,8 +523,8 @@ &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 @@ 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); }
--- a/src/pan-view.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/pan-view.c Tue Aug 26 22:22:51 2008 +0000 @@ -2030,8 +2030,8 @@ 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");
--- a/src/pixbuf-renderer.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/pixbuf-renderer.c Tue Aug 26 22:22:51 2008 +0000 @@ -1412,10 +1412,10 @@ 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 @@ } 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; - - sx = (double)(it->x + x) / scale_x; - sy = (double)(it->y + y) / scale_y; - sw = (double)w / scale_x; - sh = (double)h / scale_y; + scale_x = (gdouble)pr->width / pr->image_width; + scale_y = (gdouble)pr->height / pr->image_height; + + 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 @@ 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 @@ } 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 @@ 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_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 @@ 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 @@ 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 @@ } 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 @@ 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 @@ 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 @@ 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; - - pixbuf_renderer_scroll(pr, (int)dst_x, (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, (gint)dst_x, (gint)dst_y); } @@ -3915,10 +3915,10 @@ 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); }
--- a/src/pixbuf_util.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/pixbuf_util.c Tue Aug 26 22:22:51 2008 +0000 @@ -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;
--- a/src/pixbuf_util.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/pixbuf_util.h Tue Aug 26 22:22:51 2008 +0000 @@ -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);
--- a/src/preferences.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/preferences.c Tue Aug 26 22:22:51 2008 +0000 @@ -146,7 +146,7 @@ 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 @@ 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 @@ 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);
--- a/src/print.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/print.c Tue Aug 26 22:22:51 2008 +0000 @@ -486,7 +486,7 @@ 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_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 @@ 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 @@ 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; }
--- a/src/remote.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/remote.c Tue Aug 26 22:22:51 2008 +0000 @@ -123,7 +123,7 @@ 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 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 @@ 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 @@ 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 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 @@ } } -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;
--- a/src/remote.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/remote.h Tue Aug 26 22:22:51 2008 +0000 @@ -17,11 +17,11 @@ 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 @@ 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);
--- a/src/secure_save.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/secure_save.c Tue Aug 26 22:22:51 2008 +0000 @@ -232,7 +232,7 @@ * 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);
--- a/src/similar.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/similar.c Tue Aug 26 22:22:51 2008 +0000 @@ -68,7 +68,7 @@ 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;
--- a/src/slideshow.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/slideshow.c Tue Aug 26 22:22:51 2008 +0000 @@ -76,7 +76,7 @@ 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);
--- a/src/thumb.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/thumb.c Tue Aug 26 22:22:51 2008 +0000 @@ -186,16 +186,16 @@ { 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 @@ } #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;
--- a/src/ui_fileops.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/ui_fileops.c Tue Aug 26 22:22:51 2008 +0000 @@ -275,7 +275,7 @@ 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 @@ 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 @@ 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);
--- a/src/ui_fileops.h Tue Aug 26 21:19:33 2008 +0000 +++ b/src/ui_fileops.h Tue Aug 26 22:22:51 2008 +0000 @@ -44,10 +44,10 @@ 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);
--- a/src/utilops.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/utilops.c Tue Aug 26 22:22:51 2008 +0000 @@ -2031,7 +2031,7 @@ 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 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 @@ 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;
--- a/src/window.c Tue Aug 26 21:19:33 2008 +0000 +++ b/src/window.c Tue Aug 26 22:22:51 2008 +0000 @@ -97,7 +97,7 @@ 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) {