Remove commented out code.
[geeqie.git] / src / format_raw.c
index aaa75c6..cc5b719 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Geeqie
  * (C) 2006 John Ellis
- * Copyright (C) 2008 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
  *
  *  Authors:
  *    Original version 2005 Lars Ellenberg, base on dcraw by David coffin.
@@ -42,7 +42,7 @@ struct _FormatRawEntry {
        const gchar *extension;
        FormatRawMatchType magic_type;
        const guint magic_offset;
-       const void *magic_pattern;
+       gconstpointer magic_pattern;
        const guint magic_length;
        const FormatRawExifType exif_type;
        FormatRawExifParseFunc exif_func;
@@ -67,7 +67,7 @@ static FormatRawEntry format_raw_list[] = {
 typedef struct _FormatExifEntry FormatExifEntry;
 struct _FormatExifEntry {
        FormatExifMatchType header_type;
-       const void *header_pattern;
+       gconstpointer header_pattern;
        const guint header_length;
        const gchar *description;
        FormatExifParseFunc func_parse;
@@ -90,7 +90,7 @@ static guint tiff_table(guchar *data, const guint len, guint offset, ExifByteOrd
        guint i;
 
        if (len < offset + 2) return 0;
-       if (type < 0 || type > EXIF_FORMAT_COUNT) return 0;
+       if (type > EXIF_FORMAT_COUNT) return 0;
 
        count = exif_byte_get_int16(data + offset, bo);
        offset += 2;
@@ -133,9 +133,9 @@ static guint tiff_table(guchar *data, const guint len, guint offset, ExifByteOrd
        return exif_byte_get_int32(data + offset + count * 12, bo);
 }
 
-static gint format_tiff_find_tag_data(guchar *data, const guint len,
-                                     guint tag, ExifFormatType type,
-                                     guint *result_offset, guint *result_count)
+static gboolean format_tiff_find_tag_data(guchar *data, const guint len,
+                                         guint tag, ExifFormatType type,
+                                         guint *result_offset, guint *result_count)
 {
        ExifByteOrder bo;
        guint offset;
@@ -182,7 +182,7 @@ static gint format_tiff_find_tag_data(guchar *data, const guint len,
 static FormatRawEntry *format_raw_find(guchar *data, const guint len)
 {
        gint n;
-       gint tiff;
+       gboolean tiff;
        guint make_count = 0;
        guint make_offset = 0;
 
@@ -230,13 +230,13 @@ static FormatRawEntry *format_raw_find(guchar *data, const guint len)
        return NULL;
 }
 
-static gint format_raw_parse(FormatRawEntry *entry,
-                            guchar *data, const guint len,
-                            guint *image_offset, guint *exif_offset)
+static gboolean format_raw_parse(FormatRawEntry *entry,
+                                guchar *data, const guint len,
+                                guint *image_offset, guint *exif_offset)
 {
        guint io = 0;
        guint eo = 0;
-       gint found;
+       gboolean found;
 
        if (!entry || !entry->func_parse) return FALSE;
 
@@ -257,8 +257,8 @@ static gint format_raw_parse(FormatRawEntry *entry,
        return TRUE;
 }
 
-gint format_raw_img_exif_offsets(guchar *data, const guint len,
-                                guint *image_offset, guint *exif_offset)
+gboolean format_raw_img_exif_offsets(guchar *data, const guint len,
+                                    guint *image_offset, guint *exif_offset)
 {
        FormatRawEntry *entry;
 
@@ -294,15 +294,15 @@ FormatRawExifType format_raw_exif_offset(guchar *data, const guint len, guint *e
 }
 
 
-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)
+gboolean 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;
-       void *map_data = NULL;
+       gpointer map_data = NULL;
        size_t map_len = 0;
        struct stat st;
-       gint success;
+       gboolean success;
 
        if (!header_data || fd < 0) return FALSE;
 
@@ -310,7 +310,7 @@ gint format_raw_img_exif_offsets_fd(gint fd, const gchar *path,
        if (path)
                {
                const gchar *ext;
-               gint match = FALSE;
+               gboolean match = FALSE;
                gint i;
 
                ext = strrchr(path, '.');
@@ -321,7 +321,7 @@ gint format_raw_img_exif_offsets_fd(gint fd, const gchar *path,
                while (!match && format_raw_list[i].magic_pattern)
                        {
                        if (format_raw_list[i].extension &&
-                           strcasecmp(format_raw_list[i].extension, ext) == 0)
+                           g_ascii_strcasecmp(format_raw_list[i].extension, ext) == 0)
                                {
                                match = TRUE;
                                }
@@ -414,8 +414,8 @@ static FormatExifEntry *format_exif_makernote_find(ExifData *exif, guchar *tiff,
        return FALSE;
 }
 
-gint format_exif_makernote_parse(ExifData *exif, guchar *tiff, guint offset,
-                                guint size, ExifByteOrder bo)
+gboolean format_exif_makernote_parse(ExifData *exif, guchar *tiff, guint offset,
+                                    guint size, ExifByteOrder bo)
 {
        FormatExifEntry *entry;
 
@@ -523,8 +523,8 @@ static guint format_debug_tiff_table(guchar *data, const guint len, guint offset
        return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
 }
 
-gint format_debug_tiff_raw(guchar *data, const guint len,
-                          guint *image_offset, guint *exif_offset)
+gboolean format_debug_tiff_raw(guchar *data, const guint len,
+                              guint *image_offset, guint *exif_offset)
 {
        ExifByteOrder bo;
        gint level;
@@ -565,3 +565,4 @@ gint format_debug_tiff_raw(guchar *data, const guint len,
 
 #endif
 /* not HAVE_EXIV2 */
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */