From 62d6112a7981ad7c34f3b43cffdf00d4662a4f25 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sun, 12 Aug 2012 18:08:52 -0700 Subject: Clean up the usage of z_const and respect const usage within zlib. This patch allows zlib to compile cleanly with the -Wcast-qual gcc warning enabled, but only if ZLIB_CONST is defined, which adds const to next_in and msg in z_stream and in the in_func prototype. A --const option is added to ./configure which adds -DZLIB_CONST to the compile flags, and adds -Wcast-qual to the compile flags when ZLIBGCCWARN is set in the environment. --- gzread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gzread.c') diff --git a/gzread.c b/gzread.c index 8ace830..52985c9 100644 --- a/gzread.c +++ b/gzread.c @@ -58,7 +58,8 @@ local int gz_avail(state) return -1; if (state->eof == 0) { if (strm->avail_in) { /* copy what's there to the start */ - unsigned char *p = state->in, *q = strm->next_in; + unsigned char *p = state->in; + unsigned const char *q = strm->next_in; unsigned n = strm->avail_in; do { *p++ = *q++; -- cgit v1.2.1