Skip to content
Permalink
Browse files
Added Zip64 support to the .zip archiver.
Now we can handle .zip files > 4 gigabytes, etc.
  • Loading branch information
icculus committed Jun 1, 2012
1 parent 3e750a9 commit a865b14bece9b6b48514e20a59fce503d773512c
Showing with 365 additions and 71 deletions.
  1. +3 −3 src/archiver_lzma.c
  2. +3 −3 src/archiver_unpacked.c
  3. +343 −49 src/archiver_zip.c
  4. +13 −13 src/physfs.c
  5. +3 −3 src/physfs_internal.h
@@ -177,7 +177,7 @@ static int lzma_file_cmp_stdlib(const void *key, const void *object)
* Compare two files with each other based on the name
* Used for sorting
*/
static int lzma_file_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
static int lzma_file_cmp(void *_a, size_t one, size_t two)
{
LZMAfile *files = (LZMAfile *) _a;
return strcmp(files[one].item->Name, files[two].item->Name);
@@ -187,7 +187,7 @@ static int lzma_file_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
/*
* Swap two entries in the file array
*/
static void lzma_file_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
static void lzma_file_swap(void *_a, size_t one, size_t two)
{
LZMAfile tmp;
LZMAfile *first = &(((LZMAfile *) _a)[one]);
@@ -245,7 +245,7 @@ static int lzma_files_init(LZMAarchive *archive)
}
} /* for */

__PHYSFS_sort(archive->files, numFiles, lzma_file_cmp, lzma_file_swap);
__PHYSFS_sort(archive->files, (size_t) numFiles, lzma_file_cmp, lzma_file_swap);

return 1;
} /* lzma_load_files */
@@ -145,7 +145,7 @@ static const PHYSFS_Io UNPK_Io =
};


static int entryCmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
static int entryCmp(void *_a, size_t one, size_t two)
{
if (one != two)
{
@@ -157,7 +157,7 @@ static int entryCmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
} /* entryCmp */


static void entrySwap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
static void entrySwap(void *_a, size_t one, size_t two)
{
if (one != two)
{
@@ -458,7 +458,7 @@ PHYSFS_Dir *UNPK_openArchive(PHYSFS_Io *io, UNPKentry *e,
BAIL_MACRO(PHYSFS_ERR_OUT_OF_MEMORY, NULL);
} /* if */

__PHYSFS_sort(e, num, entryCmp, entrySwap);
__PHYSFS_sort(e, (size_t) num, entryCmp, entrySwap);
info->io = io;
info->entryCount = num;
info->entries = e;

0 comments on commit a865b14

Please sign in to comment.