summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2013-04-13 18:04:06 -0700
committerMark Adler <madler@alumni.caltech.edu>2013-04-13 18:04:06 -0700
commit70252daf893a5e181d8b6eb7da6cec9fab044ecc (patch)
treec0dc89fcc00e9a135db770309393155aaee659c3
parent9b703f200055eb93c3abfbf311076ceeb827c80a (diff)
downloadzlib-70252daf893a5e181d8b6eb7da6cec9fab044ecc.tar.gz
zlib-70252daf893a5e181d8b6eb7da6cec9fab044ecc.tar.bz2
zlib-70252daf893a5e181d8b6eb7da6cec9fab044ecc.zip
Add casts in gzwrite.c for pointer differences.
-rw-r--r--gzguts.h3
-rw-r--r--gzwrite.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/gzguts.h b/gzguts.h
index c22814d..d87659d 100644
--- a/gzguts.h
+++ b/gzguts.h
@@ -142,7 +142,8 @@
142# define DEF_MEM_LEVEL MAX_MEM_LEVEL 142# define DEF_MEM_LEVEL MAX_MEM_LEVEL
143#endif 143#endif
144 144
145/* default i/o buffer size -- double this for output when reading */ 145/* default i/o buffer size -- double this for output when reading (this and
146 twice this must be able to fit in an unsigned type) */
146#define GZBUFSIZE 8192 147#define GZBUFSIZE 8192
147 148
148/* gzip modes, also provide a little integrity check on the passed structure */ 149/* gzip modes, also provide a little integrity check on the passed structure */
diff --git a/gzwrite.c b/gzwrite.c
index 3729a29..aa767fb 100644
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -211,7 +211,7 @@ int ZEXPORT gzwrite(file, buf, len)
211 211
212 if (strm->avail_in == 0) 212 if (strm->avail_in == 0)
213 strm->next_in = state->in; 213 strm->next_in = state->in;
214 have = strm->next_in + strm->avail_in - state->in; 214 have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
215 copy = state->size - have; 215 copy = state->size - have;
216 if (copy > len) 216 if (copy > len)
217 copy = len; 217 copy = len;
@@ -273,7 +273,7 @@ int ZEXPORT gzputc(file, c)
273 if (state->size) { 273 if (state->size) {
274 if (strm->avail_in == 0) 274 if (strm->avail_in == 0)
275 strm->next_in = state->in; 275 strm->next_in = state->in;
276 have = strm->next_in + strm->avail_in - state->in; 276 have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
277 if (have < state->size) { 277 if (have < state->size) {
278 state->in[have] = c; 278 state->in[have] = c;
279 strm->avail_in++; 279 strm->avail_in++;