From 1cfce370eb6190370bc1a1e2f79070c4e55f8bfb Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 7 Feb 2014 16:31:32 -0500 Subject: [PATCH] Static analysis fixes backported to the stable-2.0 branch. --- archivers/zip.c | 4 ++-- platform/macosx.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/archivers/zip.c b/archivers/zip.c index 0e65453..54cd7c3 100644 --- a/archivers/zip.c +++ b/archivers/zip.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. diff --git a/platform/macosx.c b/platform/macosx.c index a483994..248f905 100644 --- a/platform/macosx.c +++ b/platform/macosx.c @@ -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;