*/
if (s->strstart >= wsize+MAX_DIST(s)) {
- zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
+ memcpy(s->window, s->window+wsize, (unsigned)wsize);
s->match_start -= wsize;
s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
s->block_start -= (long) wsize;
init = s->window_size - curr;
if (init > WIN_INIT)
init = WIN_INIT;
- zmemzero(s->window + curr, (unsigned)init);
+ memzero(s->window + curr, 0, (unsigned)init);
s->high_water = curr + init;
}
else if (s->high_water < (ulg)curr + WIN_INIT) {
init = (ulg)curr + WIN_INIT - s->high_water;
if (init > s->window_size - s->high_water)
init = s->window_size - s->high_water;
- zmemzero(s->window + s->high_water, (unsigned)init);
+ memzero(s->window + s->high_water, 0, (unsigned)init);
s->high_water += init;
}
}
return;
}
#endif
- zmemcpy(dst, strm->next_in, size);
+ memcpy(dst, strm->next_in, size);
strm->adler = crc32(strm->adler, dst, size);
}
*/
#define CLEAR_HASH(s) \
s->head[s->hash_size-1] = NIL; \
- zmemzero((Byte *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+ memzero((Byte *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head));
/* ========================================================================= */
int ZEXPORT deflateInit_(strm, level, version, stream_size)
if (len > strm->avail_out) len = strm->avail_out;
if (len == 0) return;
- zmemcpy(strm->next_out, s->pending_out, len);
+ memcpy(strm->next_out, s->pending_out, len);
strm->next_out += len;
s->pending_out += len;
strm->total_out += len;
ss = source->state;
- zmemcpy((voidp)dest, (voidp)source, sizeof(z_stream));
+ memcpy((voidp)dest, (voidp)source, sizeof(z_stream));
ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
if (ds == Z_NULL) return Z_MEM_ERROR;
dest->state = (struct internal_state *) ds;
- zmemcpy((voidp)ds, (voidp)ss, sizeof(deflate_state));
+ memcpy((voidp)ds, (voidp)ss, sizeof(deflate_state));
ds->strm = dest;
ds->window = (Byte *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
return Z_MEM_ERROR;
}
- zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
- zmemcpy((voidp)ds->prev, (voidp)ss->prev, ds->w_size * sizeof(Pos));
- zmemcpy((voidp)ds->head, (voidp)ss->head, ds->hash_size * sizeof(Pos));
- zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+ memcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+ memcpy((voidp)ds->prev, (voidp)ss->prev, ds->w_size * sizeof(Pos));
+ memcpy((voidp)ds->head, (voidp)ss->head, ds->hash_size * sizeof(Pos));
+ memcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
else
#endif
{
- zmemcpy(buf, strm->next_in, len);
+ memcpy(buf, strm->next_in, len);
if (strm->state->wrap == 1)
strm->adler = adler32(strm->adler, buf, len);
}
local void check_match(deflate_state *s, IPos start, IPos match, int length)
{
/* check that the match is indeed a match */
- if (zmemcmp(s->window + match,
+ if (memcmp(s->window + match,
s->window + start, length) != EQUAL) {
fprintf(stderr, " start %u, match %u, length %d\n",
start, match, length);
*/
if (s->strstart >= wsize+MAX_DIST(s)) {
- zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
+ memcpy(s->window, s->window+wsize, (unsigned)wsize);
s->match_start -= wsize;
s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
s->block_start -= (long) wsize;
init = s->window_size - curr;
if (init > WIN_INIT)
init = WIN_INIT;
- zmemzero(s->window + curr, (unsigned)init);
+ memzero(s->window + curr, 0, (unsigned)init);
s->high_water = curr + init;
}
else if (s->high_water < (ulg)curr + WIN_INIT) {
init = (ulg)curr + WIN_INIT - s->high_water;
if (init > s->window_size - s->high_water)
init = s->window_size - s->high_water;
- zmemzero(s->window + s->high_water, (unsigned)init);
+ memzero(s->window + s->high_water, 0, (unsigned)init);
s->high_water += init;
}
}
ROOM();
if (copy > have) copy = have;
if (copy > left) copy = left;
- zmemcpy(put, next, copy);
+ memcpy(put, next, copy);
have -= copy;
next += copy;
left -= copy;
/* copy state->wsize or less output bytes into the circular window */
if (copy >= state->wsize) {
- zmemcpy(state->window, end - state->wsize, state->wsize);
+ memcpy(state->window, end - state->wsize, state->wsize);
state->wnext = 0;
state->whave = state->wsize;
}
else {
dist = state->wsize - state->wnext;
if (dist > copy) dist = copy;
- zmemcpy(state->window + state->wnext, end - copy, dist);
+ memcpy(state->window + state->wnext, end - copy, dist);
copy -= dist;
if (copy) {
- zmemcpy(state->window, end - copy, copy);
+ memcpy(state->window, end - copy, copy);
state->wnext = copy;
state->whave = state->wsize;
}
if (state->head != Z_NULL &&
state->head->extra != Z_NULL) {
len = state->head->extra_len - state->length;
- zmemcpy(state->head->extra + len, next,
+ memcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);
}
if (copy > have) copy = have;
if (copy > left) copy = left;
if (copy == 0) goto inf_leave;
- zmemcpy(put, next, copy);
+ memcpy(put, next, copy);
have -= copy;
next += copy;
left -= copy;
/* copy dictionary */
if (state->whave && dictionary != Z_NULL) {
- zmemcpy(dictionary, state->window + state->wnext,
+ memcpy(dictionary, state->window + state->wnext,
state->whave - state->wnext);
- zmemcpy(dictionary + state->whave - state->wnext,
+ memcpy(dictionary + state->whave - state->wnext,
state->window, state->wnext);
}
if (dictLength != Z_NULL)
}
/* copy state */
- zmemcpy((voidp)dest, (voidp)source, sizeof(z_stream));
- zmemcpy((voidp)copy, (voidp)state, sizeof(struct inflate_state));
+ memcpy((voidp)dest, (voidp)source, sizeof(z_stream));
+ memcpy((voidp)copy, (voidp)state, sizeof(struct inflate_state));
if (state->lencode >= state->codes &&
state->lencode <= state->codes + ENOUGH - 1) {
copy->lencode = copy->codes + (state->lencode - state->codes);
copy->next = copy->codes + (state->next - state->codes);
if (window != Z_NULL) {
wsize = 1U << state->wbits;
- zmemcpy(window, state->window, wsize);
+ memcpy(window, state->window, wsize);
}
copy->window = window;
dest->state = (struct internal_state *)copy;
/* functions */
-#define zmemcpy memcpy
-#define zmemcmp memcmp
-#define zmemzero(dest, len) memset(dest, 0, len)
-
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>