diff options
Diffstat (limited to 'deflate.c')
| -rw-r--r-- | deflate.c | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -170,8 +170,7 @@ local const config configuration_table[10] = { | |||
| 170 | #define CLEAR_HASH(s) \ | 170 | #define CLEAR_HASH(s) \ |
| 171 | do { \ | 171 | do { \ |
| 172 | s->head[s->hash_size - 1] = NIL; \ | 172 | s->head[s->hash_size - 1] = NIL; \ |
| 173 | zmemzero((Bytef *)s->head, \ | 173 | zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \ |
| 174 | (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \ | ||
| 175 | s->slid = 0; \ | 174 | s->slid = 0; \ |
| 176 | } while (0) | 175 | } while (0) |
| 177 | 176 | ||
| @@ -1331,13 +1330,13 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { | |||
| 1331 | 1330 | ||
| 1332 | ss = source->state; | 1331 | ss = source->state; |
| 1333 | 1332 | ||
| 1334 | zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); | 1333 | zmemcpy(dest, source, sizeof(z_stream)); |
| 1335 | 1334 | ||
| 1336 | ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); | 1335 | ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); |
| 1337 | if (ds == Z_NULL) return Z_MEM_ERROR; | 1336 | if (ds == Z_NULL) return Z_MEM_ERROR; |
| 1338 | zmemzero(ds, sizeof(deflate_state)); | 1337 | zmemzero(ds, sizeof(deflate_state)); |
| 1339 | dest->state = (struct internal_state FAR *) ds; | 1338 | dest->state = (struct internal_state FAR *) ds; |
| 1340 | zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state)); | 1339 | zmemcpy(ds, ss, sizeof(deflate_state)); |
| 1341 | ds->strm = dest; | 1340 | ds->strm = dest; |
| 1342 | 1341 | ||
| 1343 | ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); | 1342 | ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); |
| @@ -1352,10 +1351,10 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { | |||
| 1352 | } | 1351 | } |
| 1353 | /* following zmemcpy's do not work for 16-bit MSDOS */ | 1352 | /* following zmemcpy's do not work for 16-bit MSDOS */ |
| 1354 | zmemcpy(ds->window, ss->window, ss->high_water); | 1353 | zmemcpy(ds->window, ss->window, ss->high_water); |
| 1355 | zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, | 1354 | zmemcpy(ds->prev, ss->prev, |
| 1356 | (ss->slid || ss->strstart - ss->insert > ds->w_size ? ds->w_size : | 1355 | (ss->slid || ss->strstart - ss->insert > ds->w_size ? ds->w_size : |
| 1357 | ss->strstart - ss->insert) * sizeof(Pos)); | 1356 | ss->strstart - ss->insert) * sizeof(Pos)); |
| 1358 | zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); | 1357 | zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos)); |
| 1359 | 1358 | ||
| 1360 | ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); | 1359 | ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); |
| 1361 | zmemcpy(ds->pending_out, ss->pending_out, ss->pending); | 1360 | zmemcpy(ds->pending_out, ss->pending_out, ss->pending); |
