Skip to content

Commit

Permalink
Renamed a function to make Clang static analysis happy.
Browse files Browse the repository at this point in the history
"Object leaked: allocated object is returned from a function whose
 name ('cfallocDesc') does not contain 'Copy' or 'Create'.  This violates
 the naming convention rules given in the Memory Management Guide for
 Core Foundation"

(it doesn't actually leak, but okay, it's a reasonable naming convention.)
  • Loading branch information
icculus committed Feb 7, 2014
1 parent 5aa0dae commit 44fb6d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/platform_macosx.c
Expand Up @@ -32,11 +32,11 @@
/* Wrap PHYSFS_Allocator in a CFAllocator... */
static CFAllocatorRef cfallocator = NULL;

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


static void *cfallocMalloc(CFIndex allocSize, CFOptionFlags hint, void *info)
Expand Down Expand Up @@ -65,7 +65,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;
Expand Down

0 comments on commit 44fb6d5

Please sign in to comment.