changeset 1977:af653599660d lm

More use of const, fix up a warning.
author Laurent Monin <zas@norz.org>
date Mon, 14 May 2012 23:01:01 +0200
parents e9ebd12f68f7
children
files src/jpeg_parser.c src/jpeg_parser.h
diffstat 2 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/jpeg_parser.c	Mon May 14 23:00:19 2012 +0200
+++ b/src/jpeg_parser.c	Mon May 14 23:01:01 2012 +0200
@@ -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 @@
 
 
 
-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 @@
 		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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 		if (mpo->images) g_free(mpo->images);
 		g_free(mpo);
 		}
-}
\ No newline at end of file
+}
--- a/src/jpeg_parser.h	Mon May 14 23:00:19 2012 +0200
+++ b/src/jpeg_parser.h	Mon May 14 23:01:01 2012 +0200
@@ -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 @@
 	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