From 6bc8916a58f8a393f44ae25df3da2a00f055f332 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Wed, 7 Dec 2011 20:13:18 +0000 Subject: [PATCH] QuaZip: change the order of void-casts. MSVC requires void-casting of unused variables to be done after variable definitions. Change the order, no functional changes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31171 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/quazip/crypt.h | 2 +- rbutil/rbutilqt/quazip/ioapi.c | 16 ++++++++-------- rbutil/rbutilqt/quazip/zip.c | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rbutil/rbutilqt/quazip/crypt.h b/rbutil/rbutilqt/quazip/crypt.h index 82748c5715..359cf6726e 100644 --- a/rbutil/rbutilqt/quazip/crypt.h +++ b/rbutil/rbutilqt/quazip/crypt.h @@ -34,10 +34,10 @@ */ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) { - (void) pcrc_32_tab; /* avoid "unused parameter" warning */ unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ + (void) pcrc_32_tab; /* avoid "unused parameter" warning */ temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); diff --git a/rbutil/rbutilqt/quazip/ioapi.c b/rbutil/rbutilqt/quazip/ioapi.c index cf29a317fd..c43144006c 100644 --- a/rbutil/rbutilqt/quazip/ioapi.c +++ b/rbutil/rbutilqt/quazip/ioapi.c @@ -70,10 +70,10 @@ voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) const char* filename; int mode; { - (void) opaque; /* avoid "unused parameter" warning */ FILE* file = NULL; const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + (void) opaque; /* avoid "unused parameter" warning */ + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) mode_fopen = "rb"; else if (mode & ZLIB_FILEFUNC_MODE_EXISTING) @@ -94,8 +94,8 @@ uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) void* buf; uLong size; { - (void) opaque; /* avoid "unused parameter" warning */ uLong ret; + (void) opaque; /* avoid "unused parameter" warning */ ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); return ret; } @@ -107,8 +107,8 @@ uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) const void* buf; uLong size; { - (void) opaque; /* avoid "unused parameter" warning */ uLong ret; + (void) opaque; /* avoid "unused parameter" warning */ ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; } @@ -117,8 +117,8 @@ long ZCALLBACK ftell_file_func (opaque, stream) voidpf opaque; voidpf stream; { - (void) opaque; /* avoid "unused parameter" warning */ long ret; + (void) opaque; /* avoid "unused parameter" warning */ ret = ftell((FILE *)stream); return ret; } @@ -129,9 +129,9 @@ long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) uLong offset; int origin; { - (void) opaque; /* avoid "unused parameter" warning */ int fseek_origin=0; long ret; + (void) opaque; /* avoid "unused parameter" warning */ switch (origin) { case ZLIB_FILEFUNC_SEEK_CUR : @@ -154,8 +154,8 @@ int ZCALLBACK fclose_file_func (opaque, stream) voidpf opaque; voidpf stream; { - (void) opaque; /* avoid "unused parameter" warning */ int ret; + (void) opaque; /* avoid "unused parameter" warning */ ret = fclose((FILE *)stream); return ret; } @@ -164,8 +164,8 @@ int ZCALLBACK ferror_file_func (opaque, stream) voidpf opaque; voidpf stream; { - (void) opaque; /* avoid "unused parameter" warning */ int ret; + (void) opaque; /* avoid "unused parameter" warning */ ret = ferror((FILE *)stream); return ret; } diff --git a/rbutil/rbutilqt/quazip/zip.c b/rbutil/rbutilqt/quazip/zip.c index 13463fe336..0bd9aeeb29 100644 --- a/rbutil/rbutilqt/quazip/zip.c +++ b/rbutil/rbutilqt/quazip/zip.c @@ -320,9 +320,9 @@ local uLong ziplocal_TmzDateToDosDate(ptm,dosDate) const tm_zip* ptm; uLong dosDate; { - (void) dosDate; /* avoid "unused parameter" warning */ uLong year = (uLong)ptm->tm_year; - if (year>1980) + (void) dosDate; /* avoid "unused parameter" warning */ + if (year>1980) year-=1980; else if (year>80) year-=80;