From: Laurent Monin Date: Mon, 14 May 2012 21:01:01 +0000 (+0200) Subject: More use of const, fix up a warning. X-Git-Tag: v1.2~131 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=20544048d99f4074e1aec280101b973bb2003cee More use of const, fix up a warning. --- diff --git a/src/jpeg_parser.c b/src/jpeg_parser.c index 990ec4bf..4fc83329 100644 --- a/src/jpeg_parser.c +++ b/src/jpeg_parser.c @@ -13,7 +13,7 @@ #include "main.h" #include "jpeg_parser.h" -gboolean jpeg_segment_find(guchar *data, guint size, +gboolean jpeg_segment_find(const guchar *data, guint size, guchar app_marker, const gchar *magic, guint magic_len, guint *seg_offset, guint *seg_length) { @@ -64,7 +64,7 @@ typedef enum { -guint16 tiff_byte_get_int16(guchar *f, TiffByteOrder bo) +guint16 tiff_byte_get_int16(const guchar *f, TiffByteOrder bo) { guint16 align_buf; @@ -76,7 +76,7 @@ guint16 tiff_byte_get_int16(guchar *f, TiffByteOrder bo) return GUINT16_FROM_BE(align_buf); } -guint32 tiff_byte_get_int32(guchar *f, TiffByteOrder bo) +guint32 tiff_byte_get_int32(const guchar *f, TiffByteOrder bo) { guint32 align_buf; @@ -120,7 +120,7 @@ void tiff_byte_put_int32(guchar *f, guint32 n, TiffByteOrder bo) memcpy(f, &align_buf, sizeof(guint32)); } -gint tiff_directory_offset(guchar *data, const guint len, +gint tiff_directory_offset(const guchar *data, const guint len, guint *offset, TiffByteOrder *bo) { if (len < 8) return FALSE; @@ -148,12 +148,12 @@ gint tiff_directory_offset(guchar *data, const guint len, return (*offset < len); } -typedef gint (* FuncParseIFDEntry)(guchar *tiff, guint offset, +typedef gint (* FuncParseIFDEntry)(const guchar *tiff, guint offset, guint size, TiffByteOrder bo, gpointer data); -gint tiff_parse_IFD_table(guchar *tiff, guint offset, +gint tiff_parse_IFD_table(const guchar *tiff, guint offset, guint size, TiffByteOrder bo, guint *next_offset, FuncParseIFDEntry parse_entry, gpointer data) @@ -182,7 +182,7 @@ gint tiff_parse_IFD_table(guchar *tiff, guint offset, return 0; } -static gint mpo_parse_Index_IFD_entry(guchar *tiff, guint offset, +static gint mpo_parse_Index_IFD_entry(const guchar *tiff, guint offset, guint size, TiffByteOrder bo, gpointer data) { @@ -254,7 +254,7 @@ static gint mpo_parse_Index_IFD_entry(guchar *tiff, guint offset, return 0; } -static gint mpo_parse_Attributes_IFD_entry(guchar *tiff, guint offset, +static gint mpo_parse_Attributes_IFD_entry(const guchar *tiff, guint offset, guint size, TiffByteOrder bo, gpointer data) { @@ -310,7 +310,7 @@ Roll Angle RollAngle 45581 B20D return 0; } -MPOData *jpeg_get_mpo_data(guchar *data, guint size) +MPOData *jpeg_get_mpo_data(const guchar *data, guint size) { guint seg_offset; guint seg_size; @@ -383,4 +383,4 @@ void jpeg_mpo_data_free(MPOData *mpo) if (mpo->images) g_free(mpo->images); g_free(mpo); } -} \ No newline at end of file +} diff --git a/src/jpeg_parser.h b/src/jpeg_parser.h index d3f4b1a9..0d653439 100644 --- a/src/jpeg_parser.h +++ b/src/jpeg_parser.h @@ -31,7 +31,7 @@ NNN.: the data in this segment */ -gboolean jpeg_segment_find(guchar *data, guint size, +gboolean jpeg_segment_find(const guchar *data, guint size, guchar app_marker, const gchar *magic, guint magic_len, guint *seg_offset, guint *seg_length); @@ -76,7 +76,7 @@ struct _MPOData { MPOEntry *images; }; -MPOData* jpeg_get_mpo_data(guchar *data, guint size); +MPOData* jpeg_get_mpo_data(const guchar *data, guint size); void jpeg_mpo_data_free(MPOData *mpo); -#endif \ No newline at end of file +#endif