aboutsummaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2016-10-11 22:15:50 -0700
committerMark Adler <madler@alumni.caltech.edu>2016-10-11 22:15:50 -0700
commit7096424f23df1b1813237fb5f8bc8f34cfcedd0c (patch)
treec41e8ef447e7e6764be5f3ba822fdc0c8da049f1 /inflate.c
parent2edb94a3025d288dc251bc6cbb2c02e60fbd7438 (diff)
downloadzlib-7096424f23df1b1813237fb5f8bc8f34cfcedd0c.tar.gz
zlib-7096424f23df1b1813237fb5f8bc8f34cfcedd0c.tar.bz2
zlib-7096424f23df1b1813237fb5f8bc8f34cfcedd0c.zip
Clean up type conversions.
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/inflate.c b/inflate.c
index 2f3fcc9..eb1b4ce 100644
--- a/inflate.c
+++ b/inflate.c
@@ -241,10 +241,10 @@ int value;
241 state->bits = 0; 241 state->bits = 0;
242 return Z_OK; 242 return Z_OK;
243 } 243 }
244 if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; 244 if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR;
245 value &= (1L << bits) - 1; 245 value &= (1L << bits) - 1;
246 state->hold += (unsigned)value << state->bits; 246 state->hold += (unsigned)value << state->bits;
247 state->bits += bits; 247 state->bits += (uInt)bits;
248 return Z_OK; 248 return Z_OK;
249} 249}
250 250
@@ -767,7 +767,7 @@ int flush;
767 if (state->head != Z_NULL && 767 if (state->head != Z_NULL &&
768 state->head->name != Z_NULL && 768 state->head->name != Z_NULL &&
769 state->length < state->head->name_max) 769 state->length < state->head->name_max)
770 state->head->name[state->length++] = len; 770 state->head->name[state->length++] = (Bytef)len;
771 } while (len && copy < have); 771 } while (len && copy < have);
772 if ((state->flags & 0x0200) && (state->wrap & 4)) 772 if ((state->flags & 0x0200) && (state->wrap & 4))
773 state->check = crc32(state->check, next, copy); 773 state->check = crc32(state->check, next, copy);
@@ -788,7 +788,7 @@ int flush;
788 if (state->head != Z_NULL && 788 if (state->head != Z_NULL &&
789 state->head->comment != Z_NULL && 789 state->head->comment != Z_NULL &&
790 state->length < state->head->comm_max) 790 state->length < state->head->comm_max)
791 state->head->comment[state->length++] = len; 791 state->head->comment[state->length++] = (Bytef)len;
792 } while (len && copy < have); 792 } while (len && copy < have);
793 if ((state->flags & 0x0200) && (state->wrap & 4)) 793 if ((state->flags & 0x0200) && (state->wrap & 4))
794 state->check = crc32(state->check, next, copy); 794 state->check = crc32(state->check, next, copy);
@@ -1249,7 +1249,7 @@ int flush;
1249 if ((state->wrap & 4) && out) 1249 if ((state->wrap & 4) && out)
1250 strm->adler = state->check = 1250 strm->adler = state->check =
1251 UPDATE(state->check, strm->next_out - out, out); 1251 UPDATE(state->check, strm->next_out - out, out);
1252 strm->data_type = state->bits + (state->last ? 64 : 0) + 1252 strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
1253 (state->mode == TYPE ? 128 : 0) + 1253 (state->mode == TYPE ? 128 : 0) +
1254 (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); 1254 (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
1255 if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) 1255 if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
@@ -1500,6 +1500,7 @@ int subvert;
1500 state->sane = !subvert; 1500 state->sane = !subvert;
1501 return Z_OK; 1501 return Z_OK;
1502#else 1502#else
1503 (void)subvert;
1503 state->sane = 1; 1504 state->sane = 1;
1504 return Z_DATA_ERROR; 1505 return Z_DATA_ERROR;
1505#endif 1506#endif
@@ -1537,7 +1538,7 @@ unsigned long ZEXPORT inflateCodesUsed(strm)
1537z_streamp strm; 1538z_streamp strm;
1538{ 1539{
1539 struct inflate_state FAR *state; 1540 struct inflate_state FAR *state;
1540 if (strm == Z_NULL || strm->state == Z_NULL) return -1L; 1541 if (strm == Z_NULL || strm->state == Z_NULL) return (unsigned long)0 - 1;
1541 state = (struct inflate_state FAR *)strm->state; 1542 state = (struct inflate_state FAR *)strm->state;
1542 return state->next - state->codes; 1543 return (unsigned long)(state->next - state->codes);
1543} 1544}