summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <fork@madler.net>2022-10-06 15:29:02 -0700
committerMark Adler <fork@madler.net>2022-10-06 20:43:18 -0700
commit2d283adfee7b944860ebf38f307a18ff6265b086 (patch)
tree80910eaa71df9167488fd9f16700dd9a97e60808
parent9331fecc10d1409b8f63cbb3cc2365596255d672 (diff)
downloadzlib-2d283adfee7b944860ebf38f307a18ff6265b086.tar.gz
zlib-2d283adfee7b944860ebf38f307a18ff6265b086.tar.bz2
zlib-2d283adfee7b944860ebf38f307a18ff6265b086.zip
Fix c89 compatibility in minizip's ioapi.c. [gvollant]
-rw-r--r--contrib/minizip/ioapi.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/contrib/minizip/ioapi.c b/contrib/minizip/ioapi.c
index d666e5a..baa6776 100644
--- a/contrib/minizip/ioapi.c
+++ b/contrib/minizip/ioapi.c
@@ -94,9 +94,9 @@ static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
94 94
95static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) 95static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
96{ 96{
97 (void)opaque;
98 FILE* file = NULL; 97 FILE* file = NULL;
99 const char* mode_fopen = NULL; 98 const char* mode_fopen = NULL;
99 (void)opaque;
100 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) 100 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
101 mode_fopen = "rb"; 101 mode_fopen = "rb";
102 else 102 else
@@ -113,9 +113,9 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in
113 113
114static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) 114static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
115{ 115{
116 (void)opaque;
117 FILE* file = NULL; 116 FILE* file = NULL;
118 const char* mode_fopen = NULL; 117 const char* mode_fopen = NULL;
118 (void)opaque;
119 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) 119 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
120 mode_fopen = "rb"; 120 mode_fopen = "rb";
121 else 121 else
@@ -133,24 +133,24 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename,
133 133
134static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) 134static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
135{ 135{
136 (void)opaque;
137 uLong ret; 136 uLong ret;
137 (void)opaque;
138 ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); 138 ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
139 return ret; 139 return ret;
140} 140}
141 141
142static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) 142static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
143{ 143{
144 (void)opaque;
145 uLong ret; 144 uLong ret;
145 (void)opaque;
146 ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); 146 ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
147 return ret; 147 return ret;
148} 148}
149 149
150static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) 150static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
151{ 151{
152 (void)opaque;
153 long ret; 152 long ret;
153 (void)opaque;
154 ret = ftell((FILE *)stream); 154 ret = ftell((FILE *)stream);
155 return ret; 155 return ret;
156} 156}
@@ -158,17 +158,17 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
158 158
159static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) 159static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
160{ 160{
161 (void)opaque;
162 ZPOS64_T ret; 161 ZPOS64_T ret;
162 (void)opaque;
163 ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream); 163 ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream);
164 return ret; 164 return ret;
165} 165}
166 166
167static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) 167static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
168{ 168{
169 (void)opaque;
170 int fseek_origin=0; 169 int fseek_origin=0;
171 long ret; 170 long ret;
171 (void)opaque;
172 switch (origin) 172 switch (origin)
173 { 173 {
174 case ZLIB_FILEFUNC_SEEK_CUR : 174 case ZLIB_FILEFUNC_SEEK_CUR :
@@ -190,9 +190,9 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs
190 190
191static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) 191static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
192{ 192{
193 (void)opaque;
194 int fseek_origin=0; 193 int fseek_origin=0;
195 long ret; 194 long ret;
195 (void)opaque;
196 switch (origin) 196 switch (origin)
197 { 197 {
198 case ZLIB_FILEFUNC_SEEK_CUR : 198 case ZLIB_FILEFUNC_SEEK_CUR :
@@ -217,16 +217,16 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
217 217
218static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) 218static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
219{ 219{
220 (void)opaque;
221 int ret; 220 int ret;
221 (void)opaque;
222 ret = fclose((FILE *)stream); 222 ret = fclose((FILE *)stream);
223 return ret; 223 return ret;
224} 224}
225 225
226static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) 226static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
227{ 227{
228 (void)opaque;
229 int ret; 228 int ret;
229 (void)opaque;
230 ret = ferror((FILE *)stream); 230 ret = ferror((FILE *)stream);
231 return ret; 231 return ret;
232} 232}