diff options
Diffstat (limited to 'zutil.c')
-rw-r--r-- | zutil.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -3,7 +3,7 @@ | |||
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 | ||
6 | /* $Id: zutil.c,v 1.5 1995/04/14 21:30:23 jloup Exp $ */ | 6 | /* $Id: zutil.c,v 1.6 1995/04/29 14:54:02 jloup Exp $ */ |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | 9 | ||
@@ -55,7 +55,7 @@ void zmemzero(dest, len) | |||
55 | } | 55 | } |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | #if defined(MSDOS) && !defined(USE_CALLOC) | 58 | #if defined(MSDOS) && !defined(__SMALL__) && !defined(M_I86SM) |
59 | # ifdef __TURBOC__ | 59 | # ifdef __TURBOC__ |
60 | 60 | ||
61 | /* Turbo C malloc() does not allow dynamic allocation of 64K bytes | 61 | /* Turbo C malloc() does not allow dynamic allocation of 64K bytes |
@@ -84,7 +84,7 @@ local ptr_table table[MAX_PTR]; | |||
84 | 84 | ||
85 | voidp zcalloc (voidp opaque, unsigned items, unsigned size) | 85 | voidp zcalloc (voidp opaque, unsigned items, unsigned size) |
86 | { | 86 | { |
87 | voidp buf; | 87 | voidp buf = opaque; /* just to make some compilers happy */ |
88 | ulg bsize = (ulg)items*size; | 88 | ulg bsize = (ulg)items*size; |
89 | 89 | ||
90 | if (bsize < 65536L) { | 90 | if (bsize < 65536L) { |
@@ -121,6 +121,7 @@ void zcfree (voidp opaque, voidp ptr) | |||
121 | next_ptr--; | 121 | next_ptr--; |
122 | return; | 122 | return; |
123 | } | 123 | } |
124 | ptr = opaque; /* just to make some compilers happy */ | ||
124 | z_error("zcfree: ptr not found"); | 125 | z_error("zcfree: ptr not found"); |
125 | } | 126 | } |
126 | 127 | ||
@@ -133,11 +134,13 @@ void zcfree (voidp opaque, voidp ptr) | |||
133 | 134 | ||
134 | voidp zcalloc (voidp opaque, unsigned items, unsigned size) | 135 | voidp zcalloc (voidp opaque, unsigned items, unsigned size) |
135 | { | 136 | { |
137 | if (opaque) opaque = 0; /* to make compiler happy */ | ||
136 | return _halloc((long)items, size); | 138 | return _halloc((long)items, size); |
137 | } | 139 | } |
138 | 140 | ||
139 | void zcfree (voidp opaque, voidp ptr) | 141 | void zcfree (voidp opaque, voidp ptr) |
140 | { | 142 | { |
143 | if (opaque) opaque = 0; /* to make compiler happy */ | ||
141 | _hfree(ptr); | 144 | _hfree(ptr); |
142 | } | 145 | } |
143 | 146 | ||