Forráskód Böngészése

Static analysis fixes backported to the stable-2.0 branch.

Ryan C. Gordon 12 éve
szülő
commit
1cfce370eb
2 módosított fájl, 5 hozzáadás és 5 törlés
  1. 2 2
      archivers/zip.c
  2. 3 3
      platform/macosx.c

+ 2 - 2
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.

+ 3 - 3
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;