aboutsummaryrefslogtreecommitdiff
path: root/zutil.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-08-12 18:08:52 -0700
committerMark Adler <madler@alumni.caltech.edu>2012-08-13 00:02:40 -0700
commit62d6112a7981ad7c34f3b43cffdf00d4662a4f25 (patch)
treeaed93070f7e1be31868dce1d62a1de6ffc1360f9 /zutil.h
parentfb4e0599a5ddaef9eee726f786b9edef4943432b (diff)
downloadzlib-62d6112a7981ad7c34f3b43cffdf00d4662a4f25.tar.gz
zlib-62d6112a7981ad7c34f3b43cffdf00d4662a4f25.tar.bz2
zlib-62d6112a7981ad7c34f3b43cffdf00d4662a4f25.zip
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.
Diffstat (limited to 'zutil.h')
-rw-r--r--zutil.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/zutil.h b/zutil.h
index 4e3dcc6..0f02cbe 100644
--- a/zutil.h
+++ b/zutil.h
@@ -44,13 +44,13 @@ typedef unsigned short ush;
44typedef ush FAR ushf; 44typedef ush FAR ushf;
45typedef unsigned long ulg; 45typedef unsigned long ulg;
46 46
47extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ 47extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
48/* (size given to avoid silly warnings with Visual C++) */ 48/* (size given to avoid silly warnings with Visual C++) */
49 49
50#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] 50#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
51 51
52#define ERR_RETURN(strm,err) \ 52#define ERR_RETURN(strm,err) \
53 return (strm->msg = (char*)ERR_MSG(err), (err)) 53 return (strm->msg = ERR_MSG(err), (err))
54/* To be used only when the state is known to be valid */ 54/* To be used only when the state is known to be valid */
55 55
56 /* common constants */ 56 /* common constants */