25 "insufficient memory",
27 "incompatible version",
41 switch ((
int)(
sizeof(
uInt))) {
43 case 4: flags += 1;
break;
44 case 8: flags += 2;
break;
47 switch ((
int)(
sizeof(
uLong))) {
49 case 4: flags += 1 << 2;
break;
50 case 8: flags += 2 << 2;
break;
51 default: flags += 3 << 2;
53 switch ((
int)(
sizeof(
voidpf))) {
55 case 4: flags += 1 << 4;
break;
56 case 8: flags += 2 << 4;
break;
57 default: flags += 3 << 4;
59 switch ((
int)(
sizeof(
z_off_t))) {
61 case 4: flags += 1 << 6;
break;
62 case 8: flags += 2 << 6;
break;
63 default: flags += 3 << 6;
68 #if defined(ASMV) || defined(ASMINF)
77 #ifdef DYNAMIC_CRC_TABLE
86 #ifdef PKZIP_BUG_WORKAROUND
95 # ifdef HAS_vsprintf_void
99 # ifdef HAS_vsnprintf_void
107 # ifdef HAS_sprintf_void
111 # ifdef HAS_snprintf_void
124 int z_verbose = verbose;
129 fprintf(stderr,
"%s\n", m);
142 #if defined(_WIN32_WCE)
157 if (len == 0)
return;
160 }
while (--len != 0);
170 for (j = 0; j < len; j++) {
171 if (s1[j] != s2[j])
return 2*(s1[j] > s2[j])-1;
180 if (len == 0)
return;
183 }
while (--len != 0);
204 local int next_ptr = 0;
206 typedef struct ptr_table_s {
211 local ptr_table table[MAX_PTR];
222 ulg bsize = (
ulg)items*size;
227 if (bsize < 65520L) {
228 buf = farmalloc(bsize);
229 if (*(
ush*)&buf != 0)
return buf;
231 buf = farmalloc(bsize + 16L);
233 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
234 table[next_ptr].org_ptr = buf;
237 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
239 table[next_ptr++].new_ptr = buf;
246 if (*(
ush*)&ptr != 0) {
251 for (n = 0; n < next_ptr; n++) {
252 if (ptr != table[n].new_ptr)
continue;
254 farfree(table[n].org_ptr);
255 while (++n < next_ptr) {
256 table[n-1] = table[
n];
262 Assert(0,
"zcfree: ptr not found");
273 #if (!defined(_MSC_VER) || (_MSC_VER <= 600))
274 # define _halloc halloc
275 # define _hfree hfree
280 if (opaque) opaque = 0;
281 return _halloc((
long)items, size);
286 if (opaque) opaque = 0;
305 if (opaque) items += size -
size;
306 return sizeof(
uInt) > 2 ? (
voidpf)malloc(items * size) :
307 (
voidpf)calloc(items, size);