Static analysis fixes backported to the stable-2.0 branch. stable-2.0
authorRyan C. Gordon <icculus@icculus.org>
Fri, 07 Feb 2014 16:31:32 -0500
branchstable-2.0
changeset 1346 5911d50a278f
parent 1336 d13223a9521f
child 1348 aaa1204a4426
Static analysis fixes backported to the stable-2.0 branch.
archivers/zip.c
platform/macosx.c
--- a/archivers/zip.c	Thu Aug 22 00:06:23 2013 -0400
+++ b/archivers/zip.c	Fri Feb 07 16:31:32 2014 -0500
@@ -384,8 +384,8 @@
     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.
--- a/platform/macosx.c	Thu Aug 22 00:06:23 2013 -0400
+++ b/platform/macosx.c	Fri Feb 07 16:31:32 2014 -0500
@@ -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 @@
     /* 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;