Skip to content

Commit ee84248

Browse files
committedApr 24, 2012
quazip: fix warnings and drop OF macro
1 parent 026f0f7 commit ee84248

File tree

5 files changed

+181
-351
lines changed

5 files changed

+181
-351
lines changed
 

‎src/core/quazip/ioapi.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#ifndef _ZLIBIOAPI_H
1212
#define _ZLIBIOAPI_H
1313

14-
1514
#define ZLIB_FILEFUNC_SEEK_CUR (1)
1615
#define ZLIB_FILEFUNC_SEEK_END (2)
1716
#define ZLIB_FILEFUNC_SEEK_SET (0)
@@ -38,13 +37,13 @@ extern "C"
3837
{
3938
#endif
4039

41-
typedef voidpf( ZCALLBACK *open_file_func ) OF(( voidpf opaque, voidpf file, int mode ) );
42-
typedef uLong( ZCALLBACK *read_file_func ) OF(( voidpf opaque, voidpf stream, void* buf, uLong size ) );
43-
typedef uLong( ZCALLBACK *write_file_func ) OF(( voidpf opaque, voidpf stream, const void* buf, uLong size ) );
44-
typedef uLong( ZCALLBACK *tell_file_func ) OF(( voidpf opaque, voidpf stream ) );
45-
typedef int ( ZCALLBACK *seek_file_func ) OF(( voidpf opaque, voidpf stream, uLong offset, int origin ) );
46-
typedef int ( ZCALLBACK *close_file_func ) OF(( voidpf opaque, voidpf stream ) );
47-
typedef int ( ZCALLBACK *testerror_file_func ) OF(( voidpf opaque, voidpf stream ) );
40+
typedef voidpf( ZCALLBACK *open_file_func )( voidpf opaque, voidpf file, int mode );
41+
typedef uLong( ZCALLBACK *read_file_func )( voidpf opaque, voidpf stream, void* buf, uLong size );
42+
typedef uLong( ZCALLBACK *write_file_func )( voidpf opaque, voidpf stream, const void* buf, uLong size );
43+
typedef uLong( ZCALLBACK *tell_file_func )( voidpf opaque, voidpf stream );
44+
typedef int ( ZCALLBACK *seek_file_func )( voidpf opaque, voidpf stream, uLong offset, int origin );
45+
typedef int ( ZCALLBACK *close_file_func )( voidpf opaque, voidpf stream );
46+
typedef int ( ZCALLBACK *testerror_file_func )( voidpf opaque, voidpf stream );
4847

4948
typedef struct zlib_filefunc_def_s
5049
{
@@ -60,7 +59,7 @@ extern "C"
6059

6160

6261

63-
void fill_qiodevice_filefunc OF(( zlib_filefunc_def* pzlib_filefunc_def ) );
62+
void fill_qiodevice_filefunc( zlib_filefunc_def* pzlib_filefunc_def );
6463

6564
#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
6665
#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))

‎src/core/quazip/unzip.c

Lines changed: 51 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,10 @@ typedef struct
165165
*/
166166

167167

168-
local int unzlocal_getByte OF((
169-
const zlib_filefunc_def* pzlib_filefunc_def,
170-
voidpf filestream,
171-
int *pi ) );
172-
173-
local int unzlocal_getByte( pzlib_filefunc_def, filestream, pi )
174-
const zlib_filefunc_def* pzlib_filefunc_def;
175-
voidpf filestream;
176-
int *pi;
168+
local int unzlocal_getByte(
169+
const zlib_filefunc_def* pzlib_filefunc_def,
170+
voidpf filestream,
171+
int *pi )
177172
{
178173
unsigned char c;
179174
int err = ( int )ZREAD( *pzlib_filefunc_def, filestream, &c, 1 );
@@ -195,15 +190,10 @@ int *pi;
195190
/* ===========================================================================
196191
Reads a long in LSB order from the given gz_stream. Sets
197192
*/
198-
local int unzlocal_getShort OF((
199-
const zlib_filefunc_def* pzlib_filefunc_def,
200-
voidpf filestream,
201-
uLong *pX ) );
202-
203-
local int unzlocal_getShort( pzlib_filefunc_def, filestream, pX )
204-
const zlib_filefunc_def* pzlib_filefunc_def;
205-
voidpf filestream;
206-
uLong *pX;
193+
local int unzlocal_getShort(
194+
const zlib_filefunc_def* pzlib_filefunc_def,
195+
voidpf filestream,
196+
uLong *pX )
207197
{
208198
uLong x ;
209199
int i;
@@ -223,15 +213,10 @@ uLong *pX;
223213
return err;
224214
}
225215

226-
local int unzlocal_getLong OF((
227-
const zlib_filefunc_def* pzlib_filefunc_def,
228-
voidpf filestream,
229-
uLong *pX ) );
230-
231-
local int unzlocal_getLong( pzlib_filefunc_def, filestream, pX )
232-
const zlib_filefunc_def* pzlib_filefunc_def;
233-
voidpf filestream;
234-
uLong *pX;
216+
local int unzlocal_getLong(
217+
const zlib_filefunc_def* pzlib_filefunc_def,
218+
voidpf filestream,
219+
uLong *pX )
235220
{
236221
uLong x ;
237222
int i;
@@ -261,9 +246,7 @@ uLong *pX;
261246

262247

263248
/* My own strcmpi / strcasecmp */
264-
local int strcmpcasenosensitive_internal( fileName1, fileName2 )
265-
const char* fileName1;
266-
const char* fileName2;
249+
local int strcmpcasenosensitive_internal( const char* fileName1, const char* fileName2 )
267250
{
268251
for ( ;; )
269252
{
@@ -304,10 +287,7 @@ const char* fileName2;
304287
(like 1 on Unix, 2 on Windows)
305288
306289
*/
307-
extern int ZEXPORT unzStringFileNameCompare( fileName1, fileName2, iCaseSensitivity )
308-
const char* fileName1;
309-
const char* fileName2;
310-
int iCaseSensitivity;
290+
extern int ZEXPORT unzStringFileNameCompare( const char* fileName1, const char* fileName2, int iCaseSensitivity )
311291
{
312292
if ( iCaseSensitivity == 0 )
313293
iCaseSensitivity = CASESENSITIVITYDEFAULTVALUE;
@@ -326,13 +306,9 @@ int iCaseSensitivity;
326306
Locate the Central directory of a zipfile (at the end, just before
327307
the global comment)
328308
*/
329-
local uLong unzlocal_SearchCentralDir OF((
330-
const zlib_filefunc_def* pzlib_filefunc_def,
331-
voidpf filestream ) );
332-
333-
local uLong unzlocal_SearchCentralDir( pzlib_filefunc_def, filestream )
334-
const zlib_filefunc_def* pzlib_filefunc_def;
335-
voidpf filestream;
309+
local uLong unzlocal_SearchCentralDir(
310+
const zlib_filefunc_def* pzlib_filefunc_def,
311+
voidpf filestream )
336312
{
337313
unsigned char* buf;
338314
uLong uSizeFile;
@@ -396,9 +372,7 @@ voidpf filestream;
396372
Else, the return value is a unzFile Handle, usable with other function
397373
of this unzip package.
398374
*/
399-
extern unzFile ZEXPORT unzOpen2( file, pzlib_filefunc_def )
400-
voidpf file;
401-
zlib_filefunc_def* pzlib_filefunc_def;
375+
extern unzFile ZEXPORT unzOpen2( voidpf file, zlib_filefunc_def* pzlib_filefunc_def )
402376
{
403377
unz_s us;
404378
unz_s *s;
@@ -499,8 +473,7 @@ zlib_filefunc_def* pzlib_filefunc_def;
499473
}
500474

501475

502-
extern unzFile ZEXPORT unzOpen( file )
503-
voidpf file;
476+
extern unzFile ZEXPORT unzOpen( voidpf file )
504477
{
505478
return unzOpen2( file, NULL );
506479
}
@@ -510,8 +483,7 @@ extern unzFile ZEXPORT unzOpen( file )
510483
If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
511484
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
512485
return UNZ_OK if there is no problem. */
513-
extern int ZEXPORT unzClose( file )
514-
unzFile file;
486+
extern int ZEXPORT unzClose( unzFile file )
515487
{
516488
unz_s* s;
517489
if ( file == NULL )
@@ -531,9 +503,7 @@ extern int ZEXPORT unzClose( file )
531503
Write info about the ZipFile in the *pglobal_info structure.
532504
No preparation of the structure is needed
533505
return UNZ_OK if there is no problem. */
534-
extern int ZEXPORT unzGetGlobalInfo( file, pglobal_info )
535-
unzFile file;
536-
unz_global_info *pglobal_info;
506+
extern int ZEXPORT unzGetGlobalInfo( unzFile file, unz_global_info *pglobal_info )
537507
{
538508
unz_s* s;
539509
if ( file == NULL )
@@ -547,9 +517,7 @@ unz_global_info *pglobal_info;
547517
/*
548518
Translate date/time from Dos format to tm_unz (readable more easilty)
549519
*/
550-
local void unzlocal_DosDateToTmuDate( ulDosDate, ptm )
551-
uLong ulDosDate;
552-
tm_unz* ptm;
520+
local void unzlocal_DosDateToTmuDate( uLong ulDosDate, tm_unz* ptm )
553521
{
554522
uLong uDate;
555523
uDate = ( uLong )( ulDosDate >> 16 );
@@ -565,7 +533,7 @@ tm_unz* ptm;
565533
/*
566534
Get Info about the current file in the zipfile, with internal only info
567535
*/
568-
local int unzlocal_GetCurrentFileInfoInternal OF(( unzFile file,
536+
local int unzlocal_GetCurrentFileInfoInternal( unzFile file,
569537
unz_file_info *pfile_info,
570538
unz_file_info_internal
571539
*pfile_info_internal,
@@ -574,23 +542,7 @@ local int unzlocal_GetCurrentFileInfoInternal OF(( unzFile file,
574542
void *extraField,
575543
uLong extraFieldBufferSize,
576544
char *szComment,
577-
uLong commentBufferSize ) );
578-
579-
local int unzlocal_GetCurrentFileInfoInternal( file,
580-
pfile_info,
581-
pfile_info_internal,
582-
szFileName, fileNameBufferSize,
583-
extraField, extraFieldBufferSize,
584-
szComment, commentBufferSize )
585-
unzFile file;
586-
unz_file_info *pfile_info;
587-
unz_file_info_internal *pfile_info_internal;
588-
char *szFileName;
589-
uLong fileNameBufferSize;
590-
void *extraField;
591-
uLong extraFieldBufferSize;
592-
char *szComment;
593-
uLong commentBufferSize;
545+
uLong commentBufferSize )
594546
{
595547
unz_s* s;
596548
unz_file_info file_info;
@@ -749,19 +701,15 @@ uLong commentBufferSize;
749701
No preparation of the structure is needed
750702
return UNZ_OK if there is no problem.
751703
*/
752-
extern int ZEXPORT unzGetCurrentFileInfo( file,
753-
pfile_info,
754-
szFileName, fileNameBufferSize,
755-
extraField, extraFieldBufferSize,
756-
szComment, commentBufferSize )
757-
unzFile file;
758-
unz_file_info *pfile_info;
759-
char *szFileName;
760-
uLong fileNameBufferSize;
761-
void *extraField;
762-
uLong extraFieldBufferSize;
763-
char *szComment;
764-
uLong commentBufferSize;
704+
extern int ZEXPORT unzGetCurrentFileInfo(
705+
unzFile file,
706+
unz_file_info *pfile_info,
707+
char *szFileName,
708+
uLong fileNameBufferSize,
709+
void *extraField,
710+
uLong extraFieldBufferSize,
711+
char *szComment,
712+
uLong commentBufferSize )
765713
{
766714
return unzlocal_GetCurrentFileInfoInternal( file, pfile_info, NULL,
767715
szFileName, fileNameBufferSize,
@@ -773,8 +721,7 @@ uLong commentBufferSize;
773721
Set the current file of the zipfile to the first file.
774722
return UNZ_OK if there is no problem
775723
*/
776-
extern int ZEXPORT unzGoToFirstFile( file )
777-
unzFile file;
724+
extern int ZEXPORT unzGoToFirstFile( unzFile file )
778725
{
779726
int err = UNZ_OK;
780727
unz_s* s;
@@ -795,8 +742,7 @@ extern int ZEXPORT unzGoToFirstFile( file )
795742
return UNZ_OK if there is no problem
796743
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
797744
*/
798-
extern int ZEXPORT unzGoToNextFile( file )
799-
unzFile file;
745+
extern int ZEXPORT unzGoToNextFile( unzFile file )
800746
{
801747
unz_s* s;
802748
int err;
@@ -829,10 +775,7 @@ extern int ZEXPORT unzGoToNextFile( file )
829775
UNZ_OK if the file is found. It becomes the current file.
830776
UNZ_END_OF_LIST_OF_FILE if the file is not found
831777
*/
832-
extern int ZEXPORT unzLocateFile( file, szFileName, iCaseSensitivity )
833-
unzFile file;
834-
const char *szFileName;
835-
int iCaseSensitivity;
778+
extern int ZEXPORT unzLocateFile( unzFile file, const char *szFileName, int iCaseSensitivity )
836779
{
837780
unz_s* s;
838781
int err;
@@ -908,9 +851,7 @@ typedef struct unz_file_pos_s
908851
} unz_file_pos;
909852
*/
910853

911-
extern int ZEXPORT unzGetFilePos( file, file_pos )
912-
unzFile file;
913-
unz_file_pos* file_pos;
854+
extern int ZEXPORT unzGetFilePos( unzFile file, unz_file_pos* file_pos )
914855
{
915856
unz_s* s;
916857

@@ -926,9 +867,7 @@ unz_file_pos* file_pos;
926867
return UNZ_OK;
927868
}
928869

929-
extern int ZEXPORT unzGoToFilePos( file, file_pos )
930-
unzFile file;
931-
unz_file_pos* file_pos;
870+
extern int ZEXPORT unzGoToFilePos( unzFile file, unz_file_pos* file_pos )
932871
{
933872
unz_s* s;
934873
int err;
@@ -962,13 +901,7 @@ unz_file_pos* file_pos;
962901
store in *piSizeVar the size of extra info in local header
963902
(filename and size of extra field data)
964903
*/
965-
local int unzlocal_CheckCurrentFileCoherencyHeader( s, piSizeVar,
966-
poffset_local_extrafield,
967-
psize_local_extrafield )
968-
unz_s* s;
969-
uInt* piSizeVar;
970-
uLong *poffset_local_extrafield;
971-
uInt *psize_local_extrafield;
904+
local int unzlocal_CheckCurrentFileCoherencyHeader( unz_s* s, uInt* piSizeVar, uLong *poffset_local_extrafield, uInt *psize_local_extrafield )
972905
{
973906
uLong uMagic, uData, uFlags;
974907
uLong size_filename;
@@ -1054,12 +987,7 @@ uInt *psize_local_extrafield;
1054987
Open for reading data the current file in the zipfile.
1055988
If there is no error and the file is opened, the return value is UNZ_OK.
1056989
*/
1057-
extern int ZEXPORT unzOpenCurrentFile3( file, method, level, raw, password )
1058-
unzFile file;
1059-
int* method;
1060-
int* level;
1061-
int raw;
1062-
const char* password;
990+
extern int ZEXPORT unzOpenCurrentFile3( unzFile file, int* method, int* level, int raw, const char* password )
1063991
{
1064992
int err = UNZ_OK;
1065993
uInt iSizeVar;
@@ -1199,24 +1127,17 @@ const char* password;
11991127
return UNZ_OK;
12001128
}
12011129

1202-
extern int ZEXPORT unzOpenCurrentFile( file )
1203-
unzFile file;
1130+
extern int ZEXPORT unzOpenCurrentFile( unzFile file )
12041131
{
12051132
return unzOpenCurrentFile3( file, NULL, NULL, 0, NULL );
12061133
}
12071134

1208-
extern int ZEXPORT unzOpenCurrentFilePassword( file, password )
1209-
unzFile file;
1210-
const char* password;
1135+
extern int ZEXPORT unzOpenCurrentFilePassword( unzFile file, const char* password )
12111136
{
12121137
return unzOpenCurrentFile3( file, NULL, NULL, 0, password );
12131138
}
12141139

1215-
extern int ZEXPORT unzOpenCurrentFile2( file, method, level, raw )
1216-
unzFile file;
1217-
int* method;
1218-
int* level;
1219-
int raw;
1140+
extern int ZEXPORT unzOpenCurrentFile2( unzFile file, int* method, int* level, int raw )
12201141
{
12211142
return unzOpenCurrentFile3( file, method, level, raw, NULL );
12221143
}
@@ -1231,10 +1152,7 @@ int raw;
12311152
return <0 with error code if there is an error
12321153
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
12331154
*/
1234-
extern int ZEXPORT unzReadCurrentFile( file, buf, len )
1235-
unzFile file;
1236-
voidp buf;
1237-
unsigned len;
1155+
extern int ZEXPORT unzReadCurrentFile( unzFile file, voidp buf, unsigned len )
12381156
{
12391157
int err = UNZ_OK;
12401158
uInt iRead = 0;
@@ -1392,8 +1310,7 @@ unsigned len;
13921310
/*
13931311
Give the current position in uncompressed data
13941312
*/
1395-
extern z_off_t ZEXPORT unztell( file )
1396-
unzFile file;
1313+
extern z_off_t ZEXPORT unztell( unzFile file )
13971314
{
13981315
unz_s* s;
13991316
file_in_zip_read_info_s* pfile_in_zip_read_info;
@@ -1412,8 +1329,7 @@ extern z_off_t ZEXPORT unztell( file )
14121329
/*
14131330
return 1 if the end of file was reached, 0 elsewhere
14141331
*/
1415-
extern int ZEXPORT unzeof( file )
1416-
unzFile file;
1332+
extern int ZEXPORT unzeof( unzFile file )
14171333
{
14181334
unz_s* s;
14191335
file_in_zip_read_info_s* pfile_in_zip_read_info;
@@ -1445,10 +1361,7 @@ extern int ZEXPORT unzeof( file )
14451361
the return value is the number of bytes copied in buf, or (if <0)
14461362
the error code
14471363
*/
1448-
extern int ZEXPORT unzGetLocalExtrafield( file, buf, len )
1449-
unzFile file;
1450-
voidp buf;
1451-
unsigned len;
1364+
extern int ZEXPORT unzGetLocalExtrafield( unzFile file, voidp buf, unsigned len )
14521365
{
14531366
unz_s* s;
14541367
file_in_zip_read_info_s* pfile_in_zip_read_info;
@@ -1496,8 +1409,7 @@ unsigned len;
14961409
Close the file in zip opened with unzipOpenCurrentFile
14971410
Return UNZ_CRCERROR if all the file was read but the CRC is not good
14981411
*/
1499-
extern int ZEXPORT unzCloseCurrentFile( file )
1500-
unzFile file;
1412+
extern int ZEXPORT unzCloseCurrentFile( unzFile file )
15011413
{
15021414
int err = UNZ_OK;
15031415

@@ -1539,10 +1451,7 @@ extern int ZEXPORT unzCloseCurrentFile( file )
15391451
uSizeBuf is the size of the szComment buffer.
15401452
return the number of byte copied or an error code <0
15411453
*/
1542-
extern int ZEXPORT unzGetGlobalComment( file, szComment, uSizeBuf )
1543-
unzFile file;
1544-
char *szComment;
1545-
uLong uSizeBuf;
1454+
extern int ZEXPORT unzGetGlobalComment( unzFile file, char *szComment, uLong uSizeBuf )
15461455
{
15471456
unz_s* s;
15481457
uLong uReadThis ;
@@ -1570,8 +1479,7 @@ uLong uSizeBuf;
15701479
}
15711480

15721481
/* Additions by RX '2004 */
1573-
extern uLong ZEXPORT unzGetOffset( file )
1574-
unzFile file;
1482+
extern uLong ZEXPORT unzGetOffset( unzFile file )
15751483
{
15761484
unz_s* s;
15771485

@@ -1586,9 +1494,7 @@ extern uLong ZEXPORT unzGetOffset( file )
15861494
return s->pos_in_central_dir;
15871495
}
15881496

1589-
extern int ZEXPORT unzSetOffset( file, pos )
1590-
unzFile file;
1591-
uLong pos;
1497+
extern int ZEXPORT unzSetOffset( unzFile file, uLong pos )
15921498
{
15931499
unz_s* s;
15941500
int err;

‎src/core/quazip/unzip.h

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ extern "C"
122122
tm_unz tmu_date;
123123
} unz_file_info;
124124

125-
extern int ZEXPORT unzStringFileNameCompare OF(( const char* fileName1,
125+
extern int ZEXPORT unzStringFileNameCompare( const char* fileName1,
126126
const char* fileName2,
127-
int iCaseSensitivity ) );
127+
int iCaseSensitivity );
128128
/*
129129
Compare two filename (fileName1,fileName2).
130130
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
@@ -135,7 +135,7 @@ extern "C"
135135
*/
136136

137137

138-
extern unzFile ZEXPORT unzOpen OF(( voidpf file ) );
138+
extern unzFile ZEXPORT unzOpen( voidpf file );
139139
/*
140140
Open a Zip file. path contain whatever zopen_file from the IO API
141141
accepts. For Qt implementation it is a pointer to QIODevice, for
@@ -146,31 +146,31 @@ extern "C"
146146
of this unzip package.
147147
*/
148148

149-
extern unzFile ZEXPORT unzOpen2 OF(( voidpf file,
150-
zlib_filefunc_def* pzlib_filefunc_def ) );
149+
extern unzFile ZEXPORT unzOpen2( voidpf file,
150+
zlib_filefunc_def* pzlib_filefunc_def );
151151
/*
152152
Open a Zip file, like unzOpen, but provide a set of file low level API
153153
for read/write the zip file (see ioapi.h)
154154
*/
155155

156-
extern int ZEXPORT unzClose OF(( unzFile file ) );
156+
extern int ZEXPORT unzClose( unzFile file );
157157
/*
158158
Close a ZipFile opened with unzipOpen.
159159
If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
160160
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
161161
return UNZ_OK if there is no problem. */
162162

163-
extern int ZEXPORT unzGetGlobalInfo OF(( unzFile file,
164-
unz_global_info *pglobal_info ) );
163+
extern int ZEXPORT unzGetGlobalInfo( unzFile file,
164+
unz_global_info *pglobal_info );
165165
/*
166166
Write info about the ZipFile in the *pglobal_info structure.
167167
No preparation of the structure is needed
168168
return UNZ_OK if there is no problem. */
169169

170170

171-
extern int ZEXPORT unzGetGlobalComment OF(( unzFile file,
172-
char *szComment,
173-
uLong uSizeBuf ) );
171+
extern int ZEXPORT unzGetGlobalComment( unzFile file,
172+
char *szComment,
173+
uLong uSizeBuf );
174174
/*
175175
Get the global comment string of the ZipFile, in the szComment buffer.
176176
uSizeBuf is the size of the szComment buffer.
@@ -181,22 +181,22 @@ extern "C"
181181
/***************************************************************************/
182182
/* Unzip package allow you browse the directory of the zipfile */
183183

184-
extern int ZEXPORT unzGoToFirstFile OF(( unzFile file ) );
184+
extern int ZEXPORT unzGoToFirstFile( unzFile file );
185185
/*
186186
Set the current file of the zipfile to the first file.
187187
return UNZ_OK if there is no problem
188188
*/
189189

190-
extern int ZEXPORT unzGoToNextFile OF(( unzFile file ) );
190+
extern int ZEXPORT unzGoToNextFile( unzFile file );
191191
/*
192192
Set the current file of the zipfile to the next file.
193193
return UNZ_OK if there is no problem
194194
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
195195
*/
196196

197-
extern int ZEXPORT unzLocateFile OF(( unzFile file,
198-
const char *szFileName,
199-
int iCaseSensitivity ) );
197+
extern int ZEXPORT unzLocateFile( unzFile file,
198+
const char *szFileName,
199+
int iCaseSensitivity );
200200
/*
201201
Try locate the file szFileName in the zipfile.
202202
For the iCaseSensitivity signification, see unzStringFileNameCompare
@@ -226,14 +226,14 @@ extern "C"
226226

227227
/* ****************************************** */
228228

229-
extern int ZEXPORT unzGetCurrentFileInfo OF(( unzFile file,
229+
extern int ZEXPORT unzGetCurrentFileInfo( unzFile file,
230230
unz_file_info *pfile_info,
231231
char *szFileName,
232232
uLong fileNameBufferSize,
233233
void *extraField,
234234
uLong extraFieldBufferSize,
235235
char *szComment,
236-
uLong commentBufferSize ) );
236+
uLong commentBufferSize );
237237
/*
238238
Get Info about the current file
239239
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
@@ -252,24 +252,24 @@ extern "C"
252252
from it, and close it (you can close it before reading all the file)
253253
*/
254254

255-
extern int ZEXPORT unzOpenCurrentFile OF(( unzFile file ) );
255+
extern int ZEXPORT unzOpenCurrentFile( unzFile file );
256256
/*
257257
Open for reading data the current file in the zipfile.
258258
If there is no error, the return value is UNZ_OK.
259259
*/
260260

261-
extern int ZEXPORT unzOpenCurrentFilePassword OF(( unzFile file,
262-
const char* password ) );
261+
extern int ZEXPORT unzOpenCurrentFilePassword( unzFile file,
262+
const char* password );
263263
/*
264264
Open for reading data the current file in the zipfile.
265265
password is a crypting password
266266
If there is no error, the return value is UNZ_OK.
267267
*/
268268

269-
extern int ZEXPORT unzOpenCurrentFile2 OF(( unzFile file,
270-
int* method,
271-
int* level,
272-
int raw ) );
269+
extern int ZEXPORT unzOpenCurrentFile2( unzFile file,
270+
int* method,
271+
int* level,
272+
int raw );
273273
/*
274274
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
275275
if raw==1
@@ -279,11 +279,11 @@ extern "C"
279279
but you CANNOT set method parameter as NULL
280280
*/
281281

282-
extern int ZEXPORT unzOpenCurrentFile3 OF(( unzFile file,
283-
int* method,
284-
int* level,
285-
int raw,
286-
const char* password ) );
282+
extern int ZEXPORT unzOpenCurrentFile3( unzFile file,
283+
int* method,
284+
int* level,
285+
int raw,
286+
const char* password );
287287
/*
288288
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
289289
if raw==1
@@ -294,15 +294,15 @@ extern "C"
294294
*/
295295

296296

297-
extern int ZEXPORT unzCloseCurrentFile OF(( unzFile file ) );
297+
extern int ZEXPORT unzCloseCurrentFile( unzFile file );
298298
/*
299299
Close the file in zip opened with unzOpenCurrentFile
300300
Return UNZ_CRCERROR if all the file was read but the CRC is not good
301301
*/
302302

303-
extern int ZEXPORT unzReadCurrentFile OF(( unzFile file,
304-
voidp buf,
305-
unsigned len ) );
303+
extern int ZEXPORT unzReadCurrentFile( unzFile file,
304+
voidp buf,
305+
unsigned len );
306306
/*
307307
Read bytes from the current file (opened by unzOpenCurrentFile)
308308
buf contain buffer where data must be copied
@@ -314,19 +314,19 @@ extern "C"
314314
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
315315
*/
316316

317-
extern z_off_t ZEXPORT unztell OF(( unzFile file ) );
317+
extern z_off_t ZEXPORT unztell( unzFile file );
318318
/*
319319
Give the current position in uncompressed data
320320
*/
321321

322-
extern int ZEXPORT unzeof OF(( unzFile file ) );
322+
extern int ZEXPORT unzeof( unzFile file );
323323
/*
324324
return 1 if the end of file was reached, 0 elsewhere
325325
*/
326326

327-
extern int ZEXPORT unzGetLocalExtrafield OF(( unzFile file,
327+
extern int ZEXPORT unzGetLocalExtrafield( unzFile file,
328328
voidp buf,
329-
unsigned len ) );
329+
unsigned len );
330330
/*
331331
Read extra field from the current file (opened by unzOpenCurrentFile)
332332
This is the local-header version of the extra field (sometimes, there is

‎src/core/quazip/zip.c

Lines changed: 56 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ local linkedlist_datablock_internal* allocate_new_datablock()
177177
return ldi;
178178
}
179179

180-
local void free_datablock( ldi )
181-
linkedlist_datablock_internal* ldi;
180+
local void free_datablock( linkedlist_datablock_internal* ldi )
182181
{
183182
while ( ldi != NULL )
184183
{
@@ -188,8 +187,7 @@ linkedlist_datablock_internal* ldi;
188187
}
189188
}
190189

191-
local void init_linkedlist( ll )
192-
linkedlist_data* ll;
190+
local void init_linkedlist( linkedlist_data* ll )
193191
{
194192
ll->first_block = ll->last_block = NULL;
195193
}
@@ -203,10 +201,7 @@ linkedlist_data* ll;
203201
}
204202
#endif
205203

206-
local int add_data_in_datablock( ll, buf, len )
207-
linkedlist_data* ll;
208-
const void* buf;
209-
uLong len;
204+
local int add_data_in_datablock( linkedlist_data* ll, const void* buf, uLong len )
210205
{
211206
linkedlist_datablock_internal* ldi;
212207
const unsigned char* from_copy;
@@ -267,13 +262,8 @@ uLong len;
267262
nbByte == 1, 2 or 4 (byte, short or long)
268263
*/
269264

270-
local int ziplocal_putValue OF(( const zlib_filefunc_def* pzlib_filefunc_def,
271-
voidpf filestream, uLong x, int nbByte ) );
272-
local int ziplocal_putValue( pzlib_filefunc_def, filestream, x, nbByte )
273-
const zlib_filefunc_def* pzlib_filefunc_def;
274-
voidpf filestream;
275-
uLong x;
276-
int nbByte;
265+
local int ziplocal_putValue( const zlib_filefunc_def* pzlib_filefunc_def,
266+
voidpf filestream, uLong x, int nbByte )
277267
{
278268
unsigned char buf[4];
279269
int n;
@@ -296,11 +286,7 @@ int nbByte;
296286
return ZIP_OK;
297287
}
298288

299-
local void ziplocal_putValue_inmemory OF(( void* dest, uLong x, int nbByte ) );
300-
local void ziplocal_putValue_inmemory( dest, x, nbByte )
301-
void* dest;
302-
uLong x;
303-
int nbByte;
289+
local void ziplocal_putValue_inmemory( void* dest, uLong x, int nbByte )
304290
{
305291
unsigned char* buf = ( unsigned char* )dest;
306292
int n;
@@ -322,9 +308,7 @@ int nbByte;
322308
/****************************************************************************/
323309

324310

325-
local uLong ziplocal_TmzDateToDosDate( ptm, dosDate )
326-
const tm_zip* ptm;
327-
uLong dosDate UNUSED;
311+
local uLong ziplocal_TmzDateToDosDate( const tm_zip* ptm, uLong dosDate UNUSED )
328312
{
329313
uLong year = ( uLong )ptm->tm_year;
330314
if ( year > 1980 )
@@ -339,15 +323,7 @@ uLong dosDate UNUSED;
339323

340324
/****************************************************************************/
341325

342-
local int ziplocal_getByte OF((
343-
const zlib_filefunc_def* pzlib_filefunc_def,
344-
voidpf filestream,
345-
int *pi ) );
346-
347-
local int ziplocal_getByte( pzlib_filefunc_def, filestream, pi )
348-
const zlib_filefunc_def* pzlib_filefunc_def;
349-
voidpf filestream;
350-
int *pi;
326+
local int ziplocal_getByte( const zlib_filefunc_def* pzlib_filefunc_def, voidpf filestream, int *pi )
351327
{
352328
unsigned char c;
353329
int err = ( int )ZREAD( *pzlib_filefunc_def, filestream, &c, 1 );
@@ -369,15 +345,7 @@ int *pi;
369345
/* ===========================================================================
370346
Reads a long in LSB order from the given gz_stream. Sets
371347
*/
372-
local int ziplocal_getShort OF((
373-
const zlib_filefunc_def* pzlib_filefunc_def,
374-
voidpf filestream,
375-
uLong *pX ) );
376-
377-
local int ziplocal_getShort( pzlib_filefunc_def, filestream, pX )
378-
const zlib_filefunc_def* pzlib_filefunc_def;
379-
voidpf filestream;
380-
uLong *pX;
348+
local int ziplocal_getShort( const zlib_filefunc_def* pzlib_filefunc_def, voidpf filestream, uLong *pX )
381349
{
382350
uLong x ;
383351
int i;
@@ -397,15 +365,7 @@ uLong *pX;
397365
return err;
398366
}
399367

400-
local int ziplocal_getLong OF((
401-
const zlib_filefunc_def* pzlib_filefunc_def,
402-
voidpf filestream,
403-
uLong *pX ) );
404-
405-
local int ziplocal_getLong( pzlib_filefunc_def, filestream, pX )
406-
const zlib_filefunc_def* pzlib_filefunc_def;
407-
voidpf filestream;
408-
uLong *pX;
368+
local int ziplocal_getLong( const zlib_filefunc_def* pzlib_filefunc_def, voidpf filestream, uLong *pX )
409369
{
410370
uLong x ;
411371
int i;
@@ -440,13 +400,7 @@ uLong *pX;
440400
Locate the Central directory of a zipfile (at the end, just before
441401
the global comment)
442402
*/
443-
local uLong ziplocal_SearchCentralDir OF((
444-
const zlib_filefunc_def* pzlib_filefunc_def,
445-
voidpf filestream ) );
446-
447-
local uLong ziplocal_SearchCentralDir( pzlib_filefunc_def, filestream )
448-
const zlib_filefunc_def* pzlib_filefunc_def;
449-
voidpf filestream;
403+
local uLong ziplocal_SearchCentralDir( const zlib_filefunc_def* pzlib_filefunc_def, voidpf filestream )
450404
{
451405
unsigned char* buf;
452406
uLong uSizeFile;
@@ -503,11 +457,7 @@ voidpf filestream;
503457
#endif /* !NO_ADDFILEINEXISTINGZIP*/
504458

505459
/************************************************************/
506-
extern zipFile ZEXPORT zipOpen2( file, append, globalcomment, pzlib_filefunc_def )
507-
voidpf file;
508-
int append;
509-
zipcharpc* globalcomment;
510-
zlib_filefunc_def* pzlib_filefunc_def;
460+
extern zipFile ZEXPORT zipOpen2( voidpf file, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc_def )
511461
{
512462
zip_internal ziinit;
513463
zip_internal* zi;
@@ -689,35 +639,27 @@ zlib_filefunc_def* pzlib_filefunc_def;
689639
}
690640
}
691641

692-
extern zipFile ZEXPORT zipOpen( file, append )
693-
voidpf file;
694-
int append;
642+
extern zipFile ZEXPORT zipOpen( voidpf file, int append )
695643
{
696644
return zipOpen2( file, append, NULL, NULL );
697645
}
698646

699-
extern int ZEXPORT zipOpenNewFileInZip3( file, filename, zipfi,
700-
extrafield_local, size_extrafield_local,
701-
extrafield_global, size_extrafield_global,
702-
comment, method, level, raw,
703-
windowBits, memLevel, strategy,
704-
password, crcForCrypting )
705-
zipFile file;
706-
const char* filename;
707-
const zip_fileinfo* zipfi;
708-
const void* extrafield_local;
709-
uInt size_extrafield_local;
710-
const void* extrafield_global;
711-
uInt size_extrafield_global;
712-
const char* comment;
713-
int method;
714-
int level;
715-
int raw;
716-
int windowBits;
717-
int memLevel;
718-
int strategy;
719-
const char* password;
720-
uLong crcForCrypting;
647+
extern int ZEXPORT zipOpenNewFileInZip3( zipFile file,
648+
const char* filename,
649+
const zip_fileinfo* zipfi,
650+
const void* extrafield_local,
651+
uInt size_extrafield_local,
652+
const void* extrafield_global,
653+
uInt size_extrafield_global,
654+
const char* comment,
655+
int method,
656+
int level,
657+
int raw,
658+
int windowBits,
659+
int memLevel,
660+
int strategy,
661+
const char* password,
662+
uLong crcForCrypting )
721663
{
722664
zip_internal* zi;
723665
uInt size_filename;
@@ -922,21 +864,17 @@ uLong crcForCrypting;
922864
return err;
923865
}
924866

925-
extern int ZEXPORT zipOpenNewFileInZip2( file, filename, zipfi,
926-
extrafield_local, size_extrafield_local,
927-
extrafield_global, size_extrafield_global,
928-
comment, method, level, raw )
929-
zipFile file;
930-
const char* filename;
931-
const zip_fileinfo* zipfi;
932-
const void* extrafield_local;
933-
uInt size_extrafield_local;
934-
const void* extrafield_global;
935-
uInt size_extrafield_global;
936-
const char* comment;
937-
int method;
938-
int level;
939-
int raw;
867+
extern int ZEXPORT zipOpenNewFileInZip2( zipFile file,
868+
const char* filename,
869+
const zip_fileinfo* zipfi,
870+
const void* extrafield_local,
871+
uInt size_extrafield_local,
872+
const void* extrafield_global,
873+
uInt size_extrafield_global,
874+
const char* comment,
875+
int method,
876+
int level,
877+
int raw )
940878
{
941879
return zipOpenNewFileInZip3( file, filename, zipfi,
942880
extrafield_local, size_extrafield_local,
@@ -946,29 +884,25 @@ int raw;
946884
NULL, 0 );
947885
}
948886

949-
extern int ZEXPORT zipOpenNewFileInZip( file, filename, zipfi,
950-
extrafield_local, size_extrafield_local,
951-
extrafield_global, size_extrafield_global,
952-
comment, method, level )
953-
zipFile file;
954-
const char* filename;
955-
const zip_fileinfo* zipfi;
956-
const void* extrafield_local;
957-
uInt size_extrafield_local;
958-
const void* extrafield_global;
959-
uInt size_extrafield_global;
960-
const char* comment;
961-
int method;
962-
int level;
887+
extern int ZEXPORT zipOpenNewFileInZip(
888+
zipFile file,
889+
const char* filename,
890+
const zip_fileinfo* zipfi,
891+
const void* extrafield_local,
892+
uInt size_extrafield_local,
893+
const void* extrafield_global,
894+
uInt size_extrafield_global,
895+
const char* comment,
896+
int method,
897+
int level )
963898
{
964899
return zipOpenNewFileInZip2( file, filename, zipfi,
965900
extrafield_local, size_extrafield_local,
966901
extrafield_global, size_extrafield_global,
967902
comment, method, level, 0 );
968903
}
969904

970-
local int zipFlushWriteBuffer( zi )
971-
zip_internal* zi;
905+
local int zipFlushWriteBuffer( zip_internal* zi )
972906
{
973907
int err = ZIP_OK;
974908

@@ -989,10 +923,7 @@ zip_internal* zi;
989923
return err;
990924
}
991925

992-
extern int ZEXPORT zipWriteInFileInZip( file, buf, len )
993-
zipFile file;
994-
const void* buf;
995-
unsigned len;
926+
extern int ZEXPORT zipWriteInFileInZip( zipFile file, const void* buf, unsigned len )
996927
{
997928
zip_internal* zi;
998929
int err = ZIP_OK;
@@ -1054,10 +985,7 @@ unsigned len;
1054985
return err;
1055986
}
1056987

1057-
extern int ZEXPORT zipCloseFileInZipRaw( file, uncompressed_size, crc32 )
1058-
zipFile file;
1059-
uLong uncompressed_size;
1060-
uLong crc32;
988+
extern int ZEXPORT zipCloseFileInZipRaw( zipFile file, uLong uncompressed_size, uLong crc32 )
1061989
{
1062990
zip_internal* zi;
1063991
uLong compressed_size;
@@ -1168,15 +1096,12 @@ uLong crc32;
11681096
return err;
11691097
}
11701098

1171-
extern int ZEXPORT zipCloseFileInZip( file )
1172-
zipFile file;
1099+
extern int ZEXPORT zipCloseFileInZip( zipFile file )
11731100
{
11741101
return zipCloseFileInZipRaw( file, 0, 0 );
11751102
}
11761103

1177-
extern int ZEXPORT zipClose( file, global_comment )
1178-
zipFile file;
1179-
const char* global_comment;
1104+
extern int ZEXPORT zipClose( zipFile file, const char* global_comment )
11801105
{
11811106
zip_internal* zi;
11821107
int err = 0;

‎src/core/quazip/zip.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ extern "C"
116116
#define APPEND_STATUS_CREATEAFTER (1)
117117
#define APPEND_STATUS_ADDINZIP (2)
118118

119-
extern zipFile ZEXPORT zipOpen OF(( voidpf file, int append ) );
119+
extern zipFile ZEXPORT zipOpen( voidpf file, int append );
120120
/*
121121
Create a zipfile.
122122
file is whatever the IO API accepts. For Qt IO API it's a pointer to
@@ -136,21 +136,21 @@ extern "C"
136136
Of couse, you can use RAW reading and writing to copy the file you did not want delte
137137
*/
138138

139-
extern zipFile ZEXPORT zipOpen2 OF(( voidpf file,
140-
int append,
141-
zipcharpc* globalcomment,
142-
zlib_filefunc_def* pzlib_filefunc_def ) );
143-
144-
extern int ZEXPORT zipOpenNewFileInZip OF(( zipFile file,
145-
const char* filename,
146-
const zip_fileinfo* zipfi,
147-
const void* extrafield_local,
148-
uInt size_extrafield_local,
149-
const void* extrafield_global,
150-
uInt size_extrafield_global,
151-
const char* comment,
152-
int method,
153-
int level ) );
139+
extern zipFile ZEXPORT zipOpen2( voidpf file,
140+
int append,
141+
zipcharpc* globalcomment,
142+
zlib_filefunc_def* pzlib_filefunc_def );
143+
144+
extern int ZEXPORT zipOpenNewFileInZip( zipFile file,
145+
const char* filename,
146+
const zip_fileinfo* zipfi,
147+
const void* extrafield_local,
148+
uInt size_extrafield_local,
149+
const void* extrafield_global,
150+
uInt size_extrafield_global,
151+
const char* comment,
152+
int method,
153+
int level );
154154
/*
155155
Open a file in the ZIP for writing.
156156
filename : the filename in zip (if NULL, '-' without quote will be used
@@ -165,7 +165,7 @@ extern "C"
165165
*/
166166

167167

168-
extern int ZEXPORT zipOpenNewFileInZip2 OF(( zipFile file,
168+
extern int ZEXPORT zipOpenNewFileInZip2( zipFile file,
169169
const char* filename,
170170
const zip_fileinfo* zipfi,
171171
const void* extrafield_local,
@@ -175,13 +175,13 @@ extern "C"
175175
const char* comment,
176176
int method,
177177
int level,
178-
int raw ) );
178+
int raw );
179179

180180
/*
181181
Same than zipOpenNewFileInZip, except if raw=1, we write raw file
182182
*/
183183

184-
extern int ZEXPORT zipOpenNewFileInZip3 OF(( zipFile file,
184+
extern int ZEXPORT zipOpenNewFileInZip3( zipFile file,
185185
const char* filename,
186186
const zip_fileinfo* zipfi,
187187
const void* extrafield_local,
@@ -196,7 +196,7 @@ extern "C"
196196
int memLevel,
197197
int strategy,
198198
const char* password,
199-
uLong crcForCtypting ) );
199+
uLong crcForCtypting );
200200

201201
/*
202202
Same than zipOpenNewFileInZip2, except
@@ -206,29 +206,29 @@ extern "C"
206206
*/
207207

208208

209-
extern int ZEXPORT zipWriteInFileInZip OF(( zipFile file,
210-
const void* buf,
211-
unsigned len ) );
209+
extern int ZEXPORT zipWriteInFileInZip( zipFile file,
210+
const void* buf,
211+
unsigned len );
212212
/*
213213
Write data in the zipfile
214214
*/
215215

216-
extern int ZEXPORT zipCloseFileInZip OF(( zipFile file ) );
216+
extern int ZEXPORT zipCloseFileInZip( zipFile file );
217217
/*
218218
Close the current file in the zipfile
219219
*/
220220

221-
extern int ZEXPORT zipCloseFileInZipRaw OF(( zipFile file,
221+
extern int ZEXPORT zipCloseFileInZipRaw( zipFile file,
222222
uLong uncompressed_size,
223-
uLong crc32 ) );
223+
uLong crc32 );
224224
/*
225225
Close the current file in the zipfile, for fiel opened with
226226
parameter raw=1 in zipOpenNewFileInZip2
227227
uncompressed_size and crc32 are value for the uncompressed size
228228
*/
229229

230-
extern int ZEXPORT zipClose OF(( zipFile file,
231-
const char* global_comment ) );
230+
extern int ZEXPORT zipClose( zipFile file,
231+
const char* global_comment );
232232
/*
233233
Close the zipfile
234234
*/

0 commit comments

Comments
 (0)
Please sign in to comment.