Skip to content

Commit

Permalink
Added Zip64 support to the .zip archiver.
Browse files Browse the repository at this point in the history
Now we can handle .zip files > 4 gigabytes, etc.
  • Loading branch information
icculus committed Jun 1, 2012
1 parent 3e750a9 commit a865b14
Show file tree
Hide file tree
Showing 5 changed files with 365 additions and 71 deletions.
6 changes: 3 additions & 3 deletions src/archiver_lzma.c
Expand Up @@ -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);
Expand All @@ -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]);
Expand Down Expand Up @@ -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 */
Expand Down
6 changes: 3 additions & 3 deletions src/archiver_unpacked.c
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a865b14

Please sign in to comment.