aboutsummaryrefslogtreecommitdiff
path: root/zutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'zutil.c')
-rw-r--r--zutil.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/zutil.c b/zutil.c
index dfc38ec..4a8118d 100644
--- a/zutil.c
+++ b/zutil.c
@@ -1,5 +1,5 @@
1/* zutil.c -- target dependent utility functions for the compression library 1/* zutil.c -- target dependent utility functions for the compression library
2 * Copyright (C) 1995-2002 Jean-loup Gailly. 2 * Copyright (C) 1995-2003 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
@@ -13,7 +13,7 @@ struct internal_state {int dummy;}; /* for buggy compilers */
13extern void exit OF((int)); 13extern void exit OF((int));
14#endif 14#endif
15 15
16const char *z_errmsg[10] = { 16const char * const z_errmsg[10] = {
17"need dictionary", /* Z_NEED_DICT 2 */ 17"need dictionary", /* Z_NEED_DICT 2 */
18"stream end", /* Z_STREAM_END 1 */ 18"stream end", /* Z_STREAM_END 1 */
19"", /* Z_OK 0 */ 19"", /* Z_OK 0 */
@@ -95,6 +95,7 @@ void zmemzero(dest, len)
95 95
96#ifdef __TURBOC__ 96#ifdef __TURBOC__
97#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__) 97#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)
98#if !defined(__linux)
98/* Small and medium model in Turbo C are for now limited to near allocation 99/* Small and medium model in Turbo C are for now limited to near allocation
99 * with reduced MAX_WBITS and MAX_MEM_LEVEL 100 * with reduced MAX_WBITS and MAX_MEM_LEVEL
100 */ 101 */
@@ -170,6 +171,7 @@ void zcfree (voidpf opaque, voidpf ptr)
170 Assert(0, "zcfree: ptr not found"); 171 Assert(0, "zcfree: ptr not found");
171} 172}
172#endif 173#endif
174#endif
173#endif /* __TURBOC__ */ 175#endif /* __TURBOC__ */
174 176
175 177
@@ -201,6 +203,7 @@ void zcfree (voidpf opaque, voidpf ptr)
201#ifndef MY_ZCALLOC /* Any system without a special alloc function */ 203#ifndef MY_ZCALLOC /* Any system without a special alloc function */
202 204
203#ifndef STDC 205#ifndef STDC
206extern voidp malloc OF((uInt size));
204extern voidp calloc OF((uInt items, uInt size)); 207extern voidp calloc OF((uInt items, uInt size));
205extern void free OF((voidpf ptr)); 208extern void free OF((voidpf ptr));
206#endif 209#endif
@@ -211,7 +214,8 @@ voidpf zcalloc (opaque, items, size)
211 unsigned size; 214 unsigned size;
212{ 215{
213 if (opaque) items += size - size; /* make compiler happy */ 216 if (opaque) items += size - size; /* make compiler happy */
214 return (voidpf)calloc(items, size); 217 return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
218 (voidpf)calloc(items, size);
215} 219}
216 220
217void zcfree (opaque, ptr) 221void zcfree (opaque, ptr)