24 "insufficient memory",
26 "incompatible version",
40 switch ((
int)(
sizeof(
uInt))) {
42 case 4: flags += 1;
break;
43 case 8: flags += 2;
break;
46 switch ((
int)(
sizeof(
uLong))) {
48 case 4: flags += 1 << 2;
break;
49 case 8: flags += 2 << 2;
break;
50 default: flags += 3 << 2;
52 switch ((
int)(
sizeof(
voidpf))) {
54 case 4: flags += 1 << 4;
break;
55 case 8: flags += 2 << 4;
break;
56 default: flags += 3 << 4;
58 switch ((
int)(
sizeof(
z_off_t))) {
60 case 4: flags += 1 << 6;
break;
61 case 8: flags += 2 << 6;
break;
62 default: flags += 3 << 6;
67 #if defined(ASMV) || defined(ASMINF)
76 #ifdef DYNAMIC_CRC_TABLE
85 #ifdef PKZIP_BUG_WORKAROUND
91 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
94 # ifdef HAS_vsprintf_void
98 # ifdef HAS_vsnprintf_void
106 # ifdef HAS_sprintf_void
110 # ifdef HAS_snprintf_void
128 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);
205 local int next_ptr = 0;
207 typedef struct ptr_table_s {
212 local ptr_table table[MAX_PTR];
223 ulg bsize = (
ulg)items*size;
228 if (bsize < 65520L) {
229 buf = farmalloc(bsize);
230 if (*(
ush*)&buf != 0)
return buf;
232 buf = farmalloc(bsize + 16L);
234 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
235 table[next_ptr].org_ptr = buf;
238 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
240 table[next_ptr++].new_ptr = buf;
247 if (*(
ush*)&ptr != 0) {
252 for (n = 0; n < next_ptr; n++) {
253 if (ptr != table[n].new_ptr)
continue;
255 farfree(table[n].org_ptr);
256 while (++n < next_ptr) {
257 table[n-1] = table[n];
263 Assert(0,
"zcfree: ptr not found");
274 #if (!defined(_MSC_VER) || (_MSC_VER <= 600))
275 # define _halloc halloc
276 # define _hfree hfree
281 if (opaque) opaque = 0;
282 return _halloc((
long)items, size);
287 if (opaque) opaque = 0;
309 if (opaque) items += size - size;
310 return sizeof(
uInt) > 2 ? (
voidpf)malloc(items * size) :
311 (
voidpf)calloc(items, size);