diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:17:02 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:17:02 -0700 |
commit | ff11b0a61f7345572ff2e413173d3179486162f2 (patch) | |
tree | f3c9e2563c4f0ac6684a0012ad48423d4c6aa798 /zutil.c | |
parent | e26a448e9673d67dc2866e11a48d24fc352e5f80 (diff) | |
download | zlib-ff11b0a61f7345572ff2e413173d3179486162f2.tar.gz zlib-ff11b0a61f7345572ff2e413173d3179486162f2.tar.bz2 zlib-ff11b0a61f7345572ff2e413173d3179486162f2.zip |
zlib 1.0.4v1.0.4
Diffstat (limited to 'zutil.c')
-rw-r--r-- | zutil.c | 25 |
1 files changed, 20 insertions, 5 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.15 1996/05/23 17:11:36 me Exp $ */ | 6 | /* $Id: zutil.c,v 1.17 1996/07/24 13:41:12 me Exp $ */ |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | 9 | ||
@@ -28,17 +28,19 @@ const char *z_errmsg[10] = { | |||
28 | ""}; | 28 | ""}; |
29 | 29 | ||
30 | 30 | ||
31 | char *zlibVersion() | 31 | const char *zlibVersion() |
32 | { | 32 | { |
33 | return ZLIB_VERSION; | 33 | return ZLIB_VERSION; |
34 | } | 34 | } |
35 | 35 | ||
36 | #ifdef DEBUG | ||
36 | void z_error (m) | 37 | void z_error (m) |
37 | char *m; | 38 | char *m; |
38 | { | 39 | { |
39 | fprintf(stderr, "%s\n", m); | 40 | fprintf(stderr, "%s\n", m); |
40 | exit(1); | 41 | exit(1); |
41 | } | 42 | } |
43 | #endif | ||
42 | 44 | ||
43 | #ifndef HAVE_MEMCPY | 45 | #ifndef HAVE_MEMCPY |
44 | 46 | ||
@@ -53,6 +55,19 @@ void zmemcpy(dest, source, len) | |||
53 | } while (--len != 0); | 55 | } while (--len != 0); |
54 | } | 56 | } |
55 | 57 | ||
58 | int zmemcmp(s1, s2, len) | ||
59 | Bytef* s1; | ||
60 | Bytef* s2; | ||
61 | uInt len; | ||
62 | { | ||
63 | uInt j; | ||
64 | |||
65 | for (j = 0; j < len; j++) { | ||
66 | if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; | ||
67 | } | ||
68 | return 0; | ||
69 | } | ||
70 | |||
56 | void zmemzero(dest, len) | 71 | void zmemzero(dest, len) |
57 | Bytef* dest; | 72 | Bytef* dest; |
58 | uInt len; | 73 | uInt len; |
@@ -138,14 +153,14 @@ void zcfree (voidpf opaque, voidpf ptr) | |||
138 | return; | 153 | return; |
139 | } | 154 | } |
140 | ptr = opaque; /* just to make some compilers happy */ | 155 | ptr = opaque; /* just to make some compilers happy */ |
141 | z_error("zcfree: ptr not found"); | 156 | Assert(0, "zcfree: ptr not found"); |
142 | } | 157 | } |
143 | #endif | 158 | #endif |
144 | #endif /* __TURBOC__ */ | 159 | #endif /* __TURBOC__ */ |
145 | 160 | ||
146 | 161 | ||
147 | #if defined(M_I86) && !(defined(__WATCOMC__) && defined(__386__)) | 162 | #if defined(M_I86) && !defined(__32BIT__) |
148 | /* Microsoft C */ | 163 | /* Microsoft C in 16-bit mode */ |
149 | 164 | ||
150 | # define MY_ZCALLOC | 165 | # define MY_ZCALLOC |
151 | 166 | ||