Skip to content

Commit

Permalink
StdLib/LibC/StdLib/Malloc.c: Revert cast removal to fix GCC build bre…
Browse files Browse the repository at this point in the history
…akage.

 
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 <[email protected]>
Reviewed by: Stefan Kaeser <[email protected]>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15677 6f19259b-4bc3-4df7-8a09-765794883524
  • Loading branch information
Daryl McDaniel authored and darylm503 committed Jul 24, 2014
1 parent a33a2f6 commit 69c87ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions StdLib/LibC/StdLib/Malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 69c87ef

Please sign in to comment.