Skip to content
Permalink
Browse files
Static analysis fixes backported to the stable-2.0 branch.
  • Loading branch information
icculus committed Feb 7, 2014
1 parent 87f4ed6 commit 1cfce370eb6190370bc1a1e2f79070c4e55f8bfb
Showing with 5 additions and 5 deletions.
  1. +2 −2 archivers/zip.c
  2. +3 −3 platform/macosx.c
@@ -384,8 +384,8 @@ static PHYSFS_sint64 zip_find_end_of_central_dir(void *in, PHYSFS_sint64 *len)
int found = 0;

filelen = __PHYSFS_platformFileLength(in);
BAIL_IF_MACRO(filelen == -1, NULL, 0); /* !!! FIXME: unlocalized string */
BAIL_IF_MACRO(filelen > 0xFFFFFFFF, "ZIP bigger than 2 gigs?!", 0);
BAIL_IF_MACRO(filelen == -1, NULL, -1); /* !!! FIXME: unlocalized string */
BAIL_IF_MACRO(filelen > 0xFFFFFFFF, "ZIP bigger than 2 gigs?!", -1);

/*
* Jump to the end of the file and start reading backwards.
@@ -29,11 +29,11 @@
/* Wrap PHYSFS_Allocator in a CFAllocator... */
static CFAllocatorRef cfallocator = NULL;

CFStringRef cfallocDesc(const void *info)
CFStringRef cfallocCopyDesc(const void *info)
{
return(CFStringCreateWithCString(cfallocator, "PhysicsFS",
kCFStringEncodingASCII));
} /* cfallocDesc */
} /* cfallocCopyDesc */


static void *cfallocMalloc(CFIndex allocSize, CFOptionFlags hint, void *info)
@@ -62,7 +62,7 @@ int __PHYSFS_platformInit(void)
/* set up a CFAllocator, so Carbon can use the physfs allocator, too. */
CFAllocatorContext ctx;
memset(&ctx, '\0', sizeof (ctx));
ctx.copyDescription = cfallocDesc;
ctx.copyDescription = cfallocCopyDesc;
ctx.allocate = cfallocMalloc;
ctx.reallocate = cfallocRealloc;
ctx.deallocate = cfallocFree;

0 comments on commit 1cfce37

Please sign in to comment.