Static analysis fixes backported to the stable-2.0 branch.

This commit is contained in:
Ryan C. Gordon 2014-02-07 16:31:32 -05:00
parent 87f4ed6786
commit 1cfce370eb
2 changed files with 5 additions and 5 deletions

View File

@ -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.

View File

@ -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;