Renamed a function to make Clang static analysis happy.
"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.)
This commit is contained in:
parent
5aa0dae5e2
commit
44fb6d5e2d
|
@ -32,11 +32,11 @@
|
||||||
/* Wrap PHYSFS_Allocator in a CFAllocator... */
|
/* Wrap PHYSFS_Allocator in a CFAllocator... */
|
||||||
static CFAllocatorRef cfallocator = NULL;
|
static CFAllocatorRef cfallocator = NULL;
|
||||||
|
|
||||||
static CFStringRef cfallocDesc(const void *info)
|
static CFStringRef cfallocCopyDesc(const void *info)
|
||||||
{
|
{
|
||||||
return CFStringCreateWithCString(cfallocator, "PhysicsFS",
|
return CFStringCreateWithCString(cfallocator, "PhysicsFS",
|
||||||
kCFStringEncodingASCII);
|
kCFStringEncodingASCII);
|
||||||
} /* cfallocDesc */
|
} /* cfallocCopyDesc */
|
||||||
|
|
||||||
|
|
||||||
static void *cfallocMalloc(CFIndex allocSize, CFOptionFlags hint, void *info)
|
static void *cfallocMalloc(CFIndex allocSize, CFOptionFlags hint, void *info)
|
||||||
|
@ -65,7 +65,7 @@ int __PHYSFS_platformInit(void)
|
||||||
/* set up a CFAllocator, so Carbon can use the physfs allocator, too. */
|
/* set up a CFAllocator, so Carbon can use the physfs allocator, too. */
|
||||||
CFAllocatorContext ctx;
|
CFAllocatorContext ctx;
|
||||||
memset(&ctx, '\0', sizeof (ctx));
|
memset(&ctx, '\0', sizeof (ctx));
|
||||||
ctx.copyDescription = cfallocDesc;
|
ctx.copyDescription = cfallocCopyDesc;
|
||||||
ctx.allocate = cfallocMalloc;
|
ctx.allocate = cfallocMalloc;
|
||||||
ctx.reallocate = cfallocRealloc;
|
ctx.reallocate = cfallocRealloc;
|
||||||
ctx.deallocate = cfallocFree;
|
ctx.deallocate = cfallocFree;
|
||||||
|
|
Loading…
Reference in New Issue