summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-spdy.c3
-rw-r--r--epan/tvbuff_zlib.c1
-rw-r--r--wiretap/file_wrappers.c9
-rw-r--r--wiretap/wtap.c4
4 files changed, 11 insertions, 6 deletions
diff --git a/epan/dissectors/packet-spdy.c b/epan/dissectors/packet-spdy.c
index 7bca0b2474..a16d4cf61d 100644
--- a/epan/dissectors/packet-spdy.c
+++ b/epan/dissectors/packet-spdy.c
@@ -42,7 +42,6 @@
#include "packet-ssl.h"
#ifdef HAVE_LIBZ
-#define ZLIB_CONST
#include <zlib.h>
#endif
@@ -962,7 +961,7 @@ static guint8* spdy_decompress_header_block(tvbuff_t *tvb,
const guint8 *hptr = tvb_get_ptr(tvb, offset, length);
guint8 *uncomp_block = (guint8 *)wmem_alloc(wmem_packet_scope(), DECOMPRESS_BUFSIZE);
- decomp->next_in = hptr;
+ decomp->next_in = (Bytef *)hptr;
decomp->avail_in = length;
decomp->next_out = uncomp_block;
decomp->avail_out = DECOMPRESS_BUFSIZE;
diff --git a/epan/tvbuff_zlib.c b/epan/tvbuff_zlib.c
index 218ff53cb2..c92a5d506d 100644
--- a/epan/tvbuff_zlib.c
+++ b/epan/tvbuff_zlib.c
@@ -28,7 +28,6 @@
#include <string.h>
#ifdef HAVE_LIBZ
-#define ZLIB_CONST
#include <zlib.h>
#endif
diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c
index 07daad1d6d..5918a55f6f 100644
--- a/wiretap/file_wrappers.c
+++ b/wiretap/file_wrappers.c
@@ -48,7 +48,6 @@
#include <wsutil/file_util.h>
#ifdef HAVE_LIBZ
-#define ZLIB_CONST
#include <zlib.h>
#endif /* HAVE_LIBZ */
@@ -129,7 +128,7 @@ struct wtap_reader {
const char *err_info; /* additional error information string for some errors */
guint avail_in; /* number of bytes available at next_in */
- const guint8 *next_in; /* next input byte */
+ unsigned char *next_in; /* next input byte */
#ifdef HAVE_LIBZ
/* zlib inflate stream */
z_stream strm; /* stream structure in-place (not a pointer) */
@@ -1673,7 +1672,7 @@ gzwfile_write(GZWFILE_T state, const void *buf, guint len)
n = state->size - strm->avail_in;
if (n > len)
n = len;
- memcpy((Bytef *)strm->next_in + strm->avail_in, buf, n);
+ memcpy(strm->next_in + strm->avail_in, buf, n);
strm->avail_in += n;
state->pos += n;
buf = (const char *)buf + n;
@@ -1689,7 +1688,11 @@ gzwfile_write(GZWFILE_T state, const void *buf, guint len)
/* directly compress user buffer to file */
strm->avail_in = len;
+#if ZLIB_CONST
strm->next_in = (z_const Bytef *)buf;
+#else
+ strm->next_in = (Bytef *)buf;
+#endif
state->pos += len;
if (gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index c4c35e8a74..30b66cd46f 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -27,6 +27,10 @@
#include <sys/types.h>
#endif
+#ifdef HAVE_LIBZ
+#include <zlib.h>
+#endif
+
#include "wtap-int.h"
#include "file_wrappers.h"