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:
mdkinney 2009-06-01 22:42:58 +00:00
parent d94f1f35a1
commit bc61c01ae5
1 changed files with 7 additions and 7 deletions

View File

@ -708,7 +708,7 @@ Returns:
// //
AsciiSPrint ( AsciiSPrint (
Buffer, Buffer,
EFI_STATUS_CODE_DATA_MAX_SIZE, sizeof (Buffer),
"\nPEI_ASSERT!: %a (%d): %a\n", "\nPEI_ASSERT!: %a (%d): %a\n",
Filename, Filename,
LineNumber, LineNumber,
@ -720,23 +720,23 @@ Returns:
// //
// Process PEI_DEBUG () macro to Serial // 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) { } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
// //
// Process Errors // 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. // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
// //
if (CallerId) { 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) { 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 ( AsciiSPrint (
Buffer, Buffer,
EFI_STATUS_CODE_DATA_MAX_SIZE, sizeof (Buffer),
"%a:%a:%a:%d\n", "%a:%a:%a:%d\n",
SeverityToken, SeverityToken,
SubClassToken, SubClassToken,