Fix c89 compatibility in minizip's ioapi.c. [gvollant]

This commit is contained in:
Mark Adler 2022-10-06 15:29:02 -07:00
parent 9331fecc10
commit 2d283adfee

View File

@ -94,9 +94,9 @@ static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
{ {
(void)opaque;
FILE* file = NULL; FILE* file = NULL;
const char* mode_fopen = NULL; const char* mode_fopen = NULL;
(void)opaque;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb"; mode_fopen = "rb";
else else
@ -113,9 +113,9 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in
static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
{ {
(void)opaque;
FILE* file = NULL; FILE* file = NULL;
const char* mode_fopen = NULL; const char* mode_fopen = NULL;
(void)opaque;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb"; mode_fopen = "rb";
else else
@ -133,24 +133,24 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename,
static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
{ {
(void)opaque;
uLong ret; uLong ret;
(void)opaque;
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
return ret; return ret;
} }
static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
{ {
(void)opaque;
uLong ret; uLong ret;
(void)opaque;
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
return ret; return ret;
} }
static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
{ {
(void)opaque;
long ret; long ret;
(void)opaque;
ret = ftell((FILE *)stream); ret = ftell((FILE *)stream);
return ret; return ret;
} }
@ -158,17 +158,17 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
{ {
(void)opaque;
ZPOS64_T ret; ZPOS64_T ret;
(void)opaque;
ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream); ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream);
return ret; return ret;
} }
static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
{ {
(void)opaque;
int fseek_origin=0; int fseek_origin=0;
long ret; long ret;
(void)opaque;
switch (origin) switch (origin)
{ {
case ZLIB_FILEFUNC_SEEK_CUR : case ZLIB_FILEFUNC_SEEK_CUR :
@ -190,9 +190,9 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs
static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
{ {
(void)opaque;
int fseek_origin=0; int fseek_origin=0;
long ret; long ret;
(void)opaque;
switch (origin) switch (origin)
{ {
case ZLIB_FILEFUNC_SEEK_CUR : case ZLIB_FILEFUNC_SEEK_CUR :
@ -217,16 +217,16 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
{ {
(void)opaque;
int ret; int ret;
(void)opaque;
ret = fclose((FILE *)stream); ret = fclose((FILE *)stream);
return ret; return ret;
} }
static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
{ {
(void)opaque;
int ret; int ret;
(void)opaque;
ret = ferror((FILE *)stream); ret = ferror((FILE *)stream);
return ret; return ret;
} }