summaryrefslogtreecommitdiff
path: root/source4/lib/zlib/zlib.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-08-15 13:32:51 +0200
committerStefan Metzmacher <metze@samba.org>2008-08-18 15:25:40 +0200
commit5e4f668468d83b09765c4b15ff1b40b88401fb00 (patch)
treed20132113c89c212afaf0871736fc08d4674a9e5 /source4/lib/zlib/zlib.h
parent41fdbffa72cab3c4f18ef5f34ab2fa0ec10d4d53 (diff)
downloadsamba-5e4f668468d83b09765c4b15ff1b40b88401fb00.tar.gz
samba-5e4f668468d83b09765c4b15ff1b40b88401fb00.tar.bz2
samba-5e4f668468d83b09765c4b15ff1b40b88401fb00.zip
zlib: fix compiler warnings
metze (This used to be commit ce44a608f66bf27070fd43d576551fde6f545d7c)
Diffstat (limited to 'source4/lib/zlib/zlib.h')
-rw-r--r--source4/lib/zlib/zlib.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/source4/lib/zlib/zlib.h b/source4/lib/zlib/zlib.h
index e80eed9a7e..5549f9cf57 100644
--- a/source4/lib/zlib/zlib.h
+++ b/source4/lib/zlib/zlib.h
@@ -80,7 +80,7 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address));
struct internal_state;
typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
+ const Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */
@@ -88,7 +88,7 @@ typedef struct z_stream_s {
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
- char *msg; /* last error message, NULL if no error */
+ const char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */
@@ -210,6 +210,16 @@ typedef gz_header FAR *gz_headerp;
#define zlib_version zlibVersion()
/* for compatibility with versions < 1.0.2 */
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
+/** Use gcc attribute to check printf fns. a1 is the 1-based index of
+ * the parameter containing the format, and a2 the index of the first
+ * argument. Note that some gcc 2.x versions don't handle this
+ * properly **/
+#define _Z_PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define _Z_PRINTF_ATTRIBUTE(a1, a2)
+#endif
+
/* basic functions */
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
@@ -887,7 +897,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
match the version of the header file.
*/
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef unsigned (*in_func) OF((void FAR *, unsigned const char FAR * FAR *));
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
@@ -1132,7 +1142,8 @@ ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
(0 in case of error).
*/
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...))
+ _Z_PRINTF_ATTRIBUTE(2, 3);
/*
Converts, formats, and writes the args to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of