diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2014-06-10 20:27:13 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2014-06-10 20:27:13 +0000 |
commit | 713b83f7b406858269863d92865b715470d6335c (patch) | |
tree | 79eb2733939d29388f0776f68da4b053427a61c9 /src/minizip | |
parent | 82e61ae9d68114bdcd6fafdb8bf823ae9ce69bef (diff) |
Added the following compiler flags:
* -Wcast-qual
* -Wmissing-parameter-type
* -Wold-style-definition
Diffstat (limited to 'src/minizip')
-rw-r--r-- | src/minizip/ioapi.c | 3 | ||||
-rw-r--r-- | src/minizip/ioapi.c.diff | 17 | ||||
-rw-r--r-- | src/minizip/zip.c | 5 | ||||
-rw-r--r-- | src/minizip/zip.c.diff | 46 |
4 files changed, 53 insertions, 18 deletions
diff --git a/src/minizip/ioapi.c b/src/minizip/ioapi.c index bbf3dd1..9e526ee 100644 --- a/src/minizip/ioapi.c +++ b/src/minizip/ioapi.c @@ -230,8 +230,7 @@ static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) return ret; } -void fill_fopen_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; +void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen_file = fopen_file_func; pzlib_filefunc_def->zread_file = fread_file_func; diff --git a/src/minizip/ioapi.c.diff b/src/minizip/ioapi.c.diff index 05d3e4a..5040b08 100644 --- a/src/minizip/ioapi.c.diff +++ b/src/minizip/ioapi.c.diff @@ -1,5 +1,5 @@ ---- ioapi.c.orig 2012-01-21 20:58:45.000000000 +0100 -+++ ioapi.c 2014-05-24 13:27:22.516230485 +0200 +--- ioapi.c.orig 2014-06-10 18:55:32.778807408 +0200 ++++ ioapi.c 2014-06-10 20:01:51.657679218 +0200 @@ -73,6 +73,7 @@ p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; @@ -30,7 +30,16 @@ static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) { -@@ -229,6 +238,7 @@ +@@ -221,14 +230,14 @@ + return ret; + } + +-void fill_fopen_filefunc (pzlib_filefunc_def) +- zlib_filefunc_def* pzlib_filefunc_def; ++void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def) + { + pzlib_filefunc_def->zopen_file = fopen_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; pzlib_filefunc_def->zwrite_file = fwrite_file_func; pzlib_filefunc_def->ztell_file = ftell_file_func; pzlib_filefunc_def->zseek_file = fseek_file_func; @@ -38,7 +47,7 @@ pzlib_filefunc_def->zclose_file = fclose_file_func; pzlib_filefunc_def->zerror_file = ferror_file_func; pzlib_filefunc_def->opaque = NULL; -@@ -241,6 +251,7 @@ +@@ -241,6 +250,7 @@ pzlib_filefunc_def->zwrite_file = fwrite_file_func; pzlib_filefunc_def->ztell64_file = ftell64_file_func; pzlib_filefunc_def->zseek64_file = fseek64_file_func; diff --git a/src/minizip/zip.c b/src/minizip/zip.c index b0d83e2..52d7e72 100644 --- a/src/minizip/zip.c +++ b/src/minizip/zip.c @@ -33,6 +33,7 @@ # include <stddef.h> # include <string.h> # include <stdlib.h> +# include <stdint.h> #endif #ifdef NO_ERRNO_H extern int errno; @@ -238,7 +239,7 @@ local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) } ldi = ll->last_block; - from_copy = (unsigned char*)buf; + from_copy = (const unsigned char*)buf; while (len>0) { @@ -1450,7 +1451,7 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in else #endif { - zi->ci.stream.next_in = (Bytef*)buf; + zi->ci.stream.next_in = (void*) (uintptr_t) buf; zi->ci.stream.avail_in = len; while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) diff --git a/src/minizip/zip.c.diff b/src/minizip/zip.c.diff index 204d985..1eca214 100644 --- a/src/minizip/zip.c.diff +++ b/src/minizip/zip.c.diff @@ -1,6 +1,14 @@ ---- zip.c.orig 2013-02-24 08:32:30.000000000 +0100 -+++ zip.c 2014-05-24 13:52:45.570151611 +0200 -@@ -186,7 +186,7 @@ +--- zip.c.orig 2014-06-10 18:55:32.778807408 +0200 ++++ zip.c 2014-06-10 22:24:28.372483395 +0200 +@@ -33,6 +33,7 @@ + # include <stddef.h> + # include <string.h> + # include <stdlib.h> ++# include <stdint.h> + #endif + #ifdef NO_ERRNO_H + extern int errno; +@@ -186,7 +187,7 @@ #include "crypt.h" #endif @@ -9,7 +17,16 @@ { linkedlist_datablock_internal* ldi; ldi = (linkedlist_datablock_internal*) -@@ -637,7 +637,7 @@ +@@ -238,7 +239,7 @@ + } + + ldi = ll->last_block; +- from_copy = (unsigned char*)buf; ++ from_copy = (const unsigned char*)buf; + + while (len>0) + { +@@ -637,7 +638,7 @@ return relativeOffset; } @@ -18,7 +35,7 @@ { int err=ZIP_OK; ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ -@@ -955,7 +955,7 @@ +@@ -955,7 +956,7 @@ return zipOpen3(pathname,append,NULL,NULL); } @@ -27,7 +44,16 @@ { /* write the local header */ int err; -@@ -1752,7 +1752,7 @@ +@@ -1450,7 +1451,7 @@ + else + #endif + { +- zi->ci.stream.next_in = (Bytef*)buf; ++ zi->ci.stream.next_in = (void*) (uintptr_t) buf; + zi->ci.stream.avail_in = len; + + while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) +@@ -1752,7 +1753,7 @@ return zipCloseFileInZipRaw (file,0,0); } @@ -36,7 +62,7 @@ { int err = ZIP_OK; ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset; -@@ -1774,7 +1774,7 @@ +@@ -1774,7 +1775,7 @@ return err; } @@ -45,7 +71,7 @@ { int err = ZIP_OK; -@@ -1813,7 +1813,8 @@ +@@ -1813,7 +1814,8 @@ } return err; } @@ -55,7 +81,7 @@ { int err = ZIP_OK; -@@ -1861,7 +1862,7 @@ +@@ -1861,7 +1863,7 @@ return err; } @@ -64,7 +90,7 @@ { int err = ZIP_OK; uInt size_global_comment = 0; -@@ -1879,6 +1880,18 @@ +@@ -1879,6 +1881,18 @@ return err; } |