From: <sag...@us...> - 2012-12-12 13:36:21
|
Revision: 1457 http://sourceforge.net/p/modplug/code/1457 Author: saga-games Date: 2012-12-12 13:36:13 +0000 (Wed, 12 Dec 2012) Log Message: ----------- [Ref] More small changes to unzip (got rid of the dirty static_assert #define). Modified Paths: -------------- trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/ungzip/ungzip.cpp trunk/OpenMPT/unzip/unzip.cpp Added Paths: ----------- trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_Changes.txt trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_info.txt Removed Paths: ------------- trunk/OpenMPT/include/zlib/contrib/minizip/ChangeLogUnzip trunk/OpenMPT/include/zlib/contrib/minizip/Makefile Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/common/typedefs.h 2012-12-12 13:36:13 UTC (rev 1457) @@ -21,13 +21,15 @@ #define CountOf(x) (sizeof(x)/sizeof(x[0])) #endif -//Compile time assert. +//Compile time assert. +#ifndef C_ASSERT +#define C_ASSERT(expr) typedef char __C_ASSERT__[(expr)?1:-1] +#endif #define STATIC_ASSERT(expr) C_ASSERT(expr) #ifndef static_assert #define static_assert(expr, msg) C_ASSERT(expr) #endif - typedef __int8 int8; typedef __int16 int16; typedef __int32 int32; Deleted: trunk/OpenMPT/include/zlib/contrib/minizip/ChangeLogUnzip =================================================================== --- trunk/OpenMPT/include/zlib/contrib/minizip/ChangeLogUnzip 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/include/zlib/contrib/minizip/ChangeLogUnzip 2012-12-12 13:36:13 UTC (rev 1457) @@ -1,67 +0,0 @@ -Change in 1.01e (12 feb 05) -- Fix in zipOpen2 for globalcomment (Rolf Kalbermatter) -- Fix possible memory leak in unzip.c (Zoran Stevanovic) - -Change in 1.01b (20 may 04) -- Integrate patch from Debian package (submited by Mark Brown) -- Add tools mztools from Xavier Roche - -Change in 1.01 (8 may 04) -- fix buffer overrun risk in unzip.c (Xavier Roche) -- fix a minor buffer insecurity in minizip.c (Mike Whittaker) - -Change in 1.00: (10 sept 03) -- rename to 1.00 -- cosmetic code change - -Change in 0.22: (19 May 03) -- crypting support (unless you define NOCRYPT) -- append file in existing zipfile - -Change in 0.21: (10 Mar 03) -- bug fixes - -Change in 0.17: (27 Jan 02) -- bug fixes - -Change in 0.16: (19 Jan 02) -- Support of ioapi for virtualize zip file access - -Change in 0.15: (19 Mar 98) -- fix memory leak in minizip.c - -Change in 0.14: (10 Mar 98) -- fix bugs in minizip.c sample for zipping big file -- fix problem in month in date handling -- fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for - comment handling - -Change in 0.13: (6 Mar 98) -- fix bugs in zip.c -- add real minizip sample - -Change in 0.12: (4 Mar 98) -- add zip.c and zip.h for creates .zip file -- fix change_file_date in miniunz.c for Unix (Jean-loup Gailly) -- fix miniunz.c for file without specific record for directory - -Change in 0.11: (3 Mar 98) -- fix bug in unzGetCurrentFileInfo for get extra field and comment -- enhance miniunz sample, remove the bad unztst.c sample - -Change in 0.10: (2 Mar 98) -- fix bug in unzReadCurrentFile -- rename unzip* to unz* function and structure -- remove Windows-like hungary notation variable name -- modify some structure in unzip.h -- add somes comment in source -- remove unzipGetcCurrentFile function -- replace ZUNZEXPORT by ZEXPORT -- add unzGetLocalExtrafield for get the local extrafield info -- add a new sample, miniunz.c - -Change in 0.4: (25 Feb 98) -- suppress the type unzipFileInZip. - Only on file in the zipfile can be open at the same time -- fix somes typo in code -- added tm_unz structure in unzip_file_info (date/time in readable format) Deleted: trunk/OpenMPT/include/zlib/contrib/minizip/Makefile =================================================================== --- trunk/OpenMPT/include/zlib/contrib/minizip/Makefile 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/include/zlib/contrib/minizip/Makefile 2012-12-12 13:36:13 UTC (rev 1457) @@ -1,25 +0,0 @@ -CC=cc -CFLAGS=-O -I../.. - -UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a -ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a - -.c.o: - $(CC) -c $(CFLAGS) $*.c - -all: miniunz minizip - -miniunz: $(UNZ_OBJS) - $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) - -minizip: $(ZIP_OBJS) - $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) - -test: miniunz minizip - ./minizip test readme.txt - ./miniunz -l test.zip - mv readme.txt readme.old - ./miniunz test.zip - -clean: - /bin/rm -f *.o *~ minizip miniunz Added: trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_Changes.txt =================================================================== --- trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_Changes.txt (rev 0) +++ trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_Changes.txt 2012-12-12 13:36:13 UTC (rev 1457) @@ -0,0 +1,6 @@ + +MiniZip 1.1 was derrived from MiniZip at version 1.01f + +Change in 1.0 (Okt 2009) + - **TODO - Add history** + Added: trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_info.txt =================================================================== --- trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_info.txt (rev 0) +++ trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_info.txt 2012-12-12 13:36:13 UTC (rev 1457) @@ -0,0 +1,74 @@ +MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson + +Introduction +--------------------- +MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html ) + +When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0. +All possible work was done for compatibility. + + +Background +--------------------- +When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64 +support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ ) + +That was used as a starting point. And after that ZIP64 support was added to zip.c +some refactoring and code cleanup was also done. + + +Changed from MiniZip 1.0 to MiniZip 1.1 +--------------------------------------- +* Added ZIP64 support for unzip ( by Even Rouault ) +* Added ZIP64 support for zip ( by Mathias Svensson ) +* Reverted some changed that Even Rouault did. +* Bunch of patches received from Gulles Vollant that he received for MiniZip from various users. +* Added unzip patch for BZIP Compression method (patch create by Daniel Borca) +* Added BZIP Compress method for zip +* Did some refactoring and code cleanup + + +Credits + + Gilles Vollant - Original MiniZip author + Even Rouault - ZIP64 unzip Support + Daniel Borca - BZip Compression method support in unzip + Mathias Svensson - ZIP64 zip support + Mathias Svensson - BZip Compression method support in zip + + Resources + + ZipLayout http://result42.com/projects/ZipFileLayout + Command line tool for Windows that shows the layout and information of the headers in a zip archive. + Used when debugging and validating the creation of zip files using MiniZip64 + + + ZIP App Note http://www.pkware.com/documents/casestudies/APPNOTE.TXT + Zip File specification + + +Notes. + * To be able to use BZip compression method in zip64.c or unzip64.c the BZIP2 lib is needed and HAVE_BZIP2 need to be defined. + +License +---------------------------------------------------------- + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +---------------------------------------------------------- + Modified: trunk/OpenMPT/ungzip/ungzip.cpp =================================================================== --- trunk/OpenMPT/ungzip/ungzip.cpp 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/ungzip/ungzip.cpp 2012-12-12 13:36:13 UTC (rev 1457) @@ -7,7 +7,6 @@ * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ -#define static_assert // DIRTY! #include "../soundlib/FileReader.h" #include "ungzip.h" Modified: trunk/OpenMPT/unzip/unzip.cpp =================================================================== --- trunk/OpenMPT/unzip/unzip.cpp 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/unzip/unzip.cpp 2012-12-12 13:36:13 UTC (rev 1457) @@ -7,7 +7,6 @@ * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ -#define static_assert // DIRTY! #include "../soundlib/FileReader.h" #include "unzip.h" #include "../common/misc_util.h" @@ -21,22 +20,22 @@ // Low-level file abstractions for in-memory file handling struct ZipFileAbstraction { - static voidpf ZCALLBACK fopen_mem(voidpf opaqe, const char *filename, int mode) + static voidpf ZCALLBACK fopen_mem(voidpf opaque, const char *, int mode) { - FileReader &file = *static_cast<FileReader *>(opaqe); + FileReader &file = *static_cast<FileReader *>(opaque); if((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_WRITE) { return nullptr; } else { file.Rewind(); - return opaqe; + return opaque; } } - static uLong ZCALLBACK fread_mem(voidpf opaqe, voidpf, void *buf, uLong size) + static uLong ZCALLBACK fread_mem(voidpf opaque, voidpf, void *buf, uLong size) { - FileReader &file = *static_cast<FileReader *>(opaqe); + FileReader &file = *static_cast<FileReader *>(opaque); if(size > file.BytesLeft()) { size = file.BytesLeft(); @@ -51,15 +50,15 @@ return 0; } - static long ZCALLBACK ftell_mem(voidpf opaqe, voidpf) + static long ZCALLBACK ftell_mem(voidpf opaque, voidpf) { - FileReader &file = *static_cast<FileReader *>(opaqe); + FileReader &file = *static_cast<FileReader *>(opaque); return file.GetPosition(); } - static long ZCALLBACK fseek_mem(voidpf opaqe, voidpf, uLong offset, int origin) + static long ZCALLBACK fseek_mem(voidpf opaque, voidpf, uLong offset, int origin) { - FileReader &file = *static_cast<FileReader *>(opaqe); + FileReader &file = *static_cast<FileReader *>(opaque); switch(origin) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |