StdLib: Simple code cleanup

StdLib/LibC/Main/Main.c
  Change Print to Debug statements.
  Ensure errno is initialized to 0 before calling main().

StdLib/LibC/StdLib/Malloc.c
  Aesthetic Cleanup: remove unnecessary cast, fix two whitespace alignment problems.

StdLib/LibC/Uefi/InteractiveIO/NonCanonRead.c
  Change Include order.

StdLib/Include/paths.h
  Add definition _PATH_LIB for the path to the library directory: /Efi/StdLib/lib.

StdLib/LibC/Stdio/vfwscanf.c
  Align declarations and initializations.
  Initialize the multipurpose pointer, p, to NULL.


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15664 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Daryl McDaniel
2014-07-17 20:54:49 +00:00
committed by darylm503
parent caf89d64ff
commit dfa51bb619
5 changed files with 54 additions and 47 deletions

View File

@ -98,7 +98,7 @@ malloc(size_t Size)
DEBUG((DEBUG_POOL, "malloc(%d): NodeSz: %d", Size, NodeSize));
Status = gBS->AllocatePool( EfiLoaderData, NodeSize, (void **)&Head);
Status = gBS->AllocatePool( EfiLoaderData, NodeSize, &Head);
if( Status != EFI_SUCCESS) {
RetVal = NULL;
errno = ENOMEM;
@ -183,7 +183,7 @@ free(void *Ptr)
errno = EFAULT;
DEBUG((DEBUG_ERROR, "ERROR free(0x%p): Signature is 0x%8X, expected 0x%8X\n",
Ptr, Head->Signature, CPOOL_HEAD_SIGNATURE));
}
}
}
DEBUG((DEBUG_POOL, "free Done\n"));
}
@ -272,8 +272,8 @@ realloc(void *Ptr, size_t ReqSize)
}
}
else {
free( Ptr); // Reclaim the old region.
}
free( Ptr); // Reclaim the old region.
}
DEBUG((DEBUG_POOL, "0x%p = realloc(%p, %d): Head: %p NewSz: %d\n",
RetVal, Ptr, ReqSize, Head, NewSize));