mirror of https://github.com/acidanthera/audk.git
Increase source portability by replace the use of EFI_STATUS_CODE_DATA_MAX_SIZE with sizeof(Buffer)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8438 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d94f1f35a1
commit
bc61c01ae5
|
@ -708,7 +708,7 @@ Returns:
|
|||
//
|
||||
AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"\nPEI_ASSERT!: %a (%d): %a\n",
|
||||
Filename,
|
||||
LineNumber,
|
||||
|
@ -720,23 +720,23 @@ Returns:
|
|||
//
|
||||
// Process PEI_DEBUG () macro to Serial
|
||||
//
|
||||
AsciiBSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, Format, Marker);
|
||||
AsciiBSPrint (Buffer, sizeof (Buffer), Format, Marker);
|
||||
|
||||
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
|
||||
//
|
||||
// Process Errors
|
||||
//
|
||||
CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance);
|
||||
CharCount = AsciiSPrint (Buffer, sizeof (Buffer), "ERROR: C%x:V%x I%x", CodeType, Value, Instance);
|
||||
//
|
||||
// Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
|
||||
//
|
||||
if (CallerId) {
|
||||
CharCount += AsciiSPrint (&Buffer[CharCount - 1], (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof(Buffer[0]) * CharCount)), " %g", CallerId);
|
||||
CharCount += AsciiSPrint (&Buffer[CharCount - 1], (sizeof (Buffer) - (sizeof(Buffer[0]) * CharCount)), " %g", CallerId);
|
||||
}
|
||||
if (Data) {
|
||||
CharCount += AsciiSPrint (&Buffer[CharCount - 1], (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof(Buffer[0]) * CharCount)), " %x", Data);
|
||||
CharCount += AsciiSPrint (&Buffer[CharCount - 1], (sizeof (Buffer) - (sizeof(Buffer[0]) * CharCount)), " %x", Data);
|
||||
}
|
||||
CharCount += AsciiSPrint (&Buffer[CharCount - 1], (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof(Buffer[0]) * CharCount)), "\n");
|
||||
CharCount += AsciiSPrint (&Buffer[CharCount - 1], (sizeof (Buffer) - (sizeof(Buffer[0]) * CharCount)), "\n");
|
||||
|
||||
}
|
||||
|
||||
|
@ -788,7 +788,7 @@ Returns:
|
|||
//
|
||||
AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"%a:%a:%a:%d\n",
|
||||
SeverityToken,
|
||||
SubClassToken,
|
||||
|
|
Loading…
Reference in New Issue