From 69c87efff4556df3aac9a12d869b0a9f131edd84 Mon Sep 17 00:00:00 2001 From: Daryl McDaniel Date: Thu, 24 Jul 2014 23:16:47 +0000 Subject: StdLib/LibC/StdLib/Malloc.c: Revert cast removal to fix GCC build breakage. The cast to (void**) is needed for the last parameter of the AllocatePool call in malloc(). This is because type CPOOL_HEAD** is not automatically promoted to void**, as required by AllocatePool(). This was originally addressed in SVN revision 15474 but removed again in 15664. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Daryl McDaniel Reviewed by: Stefan Kaeser git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15677 6f19259b-4bc3-4df7-8a09-765794883524 --- StdLib/LibC/StdLib/Malloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StdLib/LibC/StdLib/Malloc.c b/StdLib/LibC/StdLib/Malloc.c index 7d9718b266..c131b9ebf5 100644 --- a/StdLib/LibC/StdLib/Malloc.c +++ b/StdLib/LibC/StdLib/Malloc.c @@ -84,8 +84,8 @@ void * malloc(size_t Size) { CPOOL_HEAD *Head; - void *RetVal; - EFI_STATUS Status; + void *RetVal; + EFI_STATUS Status; UINTN NodeSize; if( Size == 0) { @@ -98,7 +98,7 @@ malloc(size_t Size) DEBUG((DEBUG_POOL, "malloc(%d): NodeSz: %d", Size, NodeSize)); - Status = gBS->AllocatePool( EfiLoaderData, NodeSize, &Head); + Status = gBS->AllocatePool( EfiLoaderData, NodeSize, (void**)&Head); if( Status != EFI_SUCCESS) { RetVal = NULL; errno = ENOMEM; -- cgit v1.2.3