Skip to content

Commit

Permalink
fix compatibility with some old C89 compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
gvollant committed Aug 19, 2022
1 parent 1eb7682 commit 4fbc6f6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions contrib/minizip/ioapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
(void)opaque;
FILE* file = NULL;
const char* mode_fopen = NULL;
(void)opaque;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb";
else
Expand All @@ -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)
{
(void)opaque;
FILE* file = NULL;
const char* mode_fopen = NULL;
(void)opaque;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb";
else
Expand All @@ -133,42 +133,42 @@ 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)
{
(void)opaque;
uLong ret;
(void)opaque;
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
return ret;
}

static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
{
(void)opaque;
uLong ret;
(void)opaque;
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
return ret;
}

static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
{
(void)opaque;
long ret;
(void)opaque;
ret = ftell((FILE *)stream);
return ret;
}


static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
{
(void)opaque;
ZPOS64_T ret;
(void)opaque;
ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream);
return ret;
}

static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
{
(void)opaque;
int fseek_origin=0;
long ret;
(void)opaque;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
Expand All @@ -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)
{
(void)opaque;
int fseek_origin=0;
long ret;
(void)opaque;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
Expand All @@ -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)
{
(void)opaque;
int ret;
(void)opaque;
ret = fclose((FILE *)stream);
return ret;
}

static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
{
(void)opaque;
int ret;
(void)opaque;
ret = ferror((FILE *)stream);
return ret;
}
Expand Down

0 comments on commit 4fbc6f6

Please sign in to comment.