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@8435 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b088ba369e
commit
1ca88083d4
|
@ -78,12 +78,12 @@ DebugPrint (
|
|||
//
|
||||
// If the TotalSize is larger than the maximum record size, then ASSERT()
|
||||
//
|
||||
ASSERT (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE);
|
||||
ASSERT (TotalSize <= sizeof (Buffer));
|
||||
|
||||
//
|
||||
// If the TotalSize is larger than the maximum record size, then return
|
||||
//
|
||||
if (TotalSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {
|
||||
if (TotalSize > sizeof (Buffer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ DebugAssert (
|
|||
FileNameLength = AsciiStrLen (FileName);
|
||||
DescriptionLength = AsciiStrLen (Description);
|
||||
TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA) + FileNameLength + 1 + DescriptionLength + 1;
|
||||
if (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE) {
|
||||
if (TotalSize <= sizeof (Buffer)) {
|
||||
//
|
||||
// Fill in EFI_DEBUG_ASSERT_DATA
|
||||
//
|
||||
|
|
|
@ -62,7 +62,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"\n\rPEI_ASSERT!: %a (%d): %a\n\r",
|
||||
Filename,
|
||||
LineNumber,
|
||||
|
@ -75,7 +75,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiBSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
Format,
|
||||
Marker
|
||||
);
|
||||
|
@ -85,7 +85,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"ERROR: C%x:V%x I%x",
|
||||
CodeType,
|
||||
Value,
|
||||
|
@ -95,7 +95,7 @@ SerialStatusCodeReportWorker (
|
|||
if (CallerId != NULL) {
|
||||
CharCount += AsciiSPrint (
|
||||
&Buffer[CharCount - 1],
|
||||
(EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),
|
||||
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
|
||||
" %g",
|
||||
CallerId
|
||||
);
|
||||
|
@ -104,7 +104,7 @@ SerialStatusCodeReportWorker (
|
|||
if (Data != NULL) {
|
||||
CharCount += AsciiSPrint (
|
||||
&Buffer[CharCount - 1],
|
||||
(EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),
|
||||
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
|
||||
" %x",
|
||||
Data
|
||||
);
|
||||
|
@ -112,7 +112,7 @@ SerialStatusCodeReportWorker (
|
|||
|
||||
CharCount += AsciiSPrint (
|
||||
&Buffer[CharCount - 1],
|
||||
(EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),
|
||||
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
|
||||
"\n\r"
|
||||
);
|
||||
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
|
||||
|
@ -121,7 +121,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"PROGRESS CODE: V%x I%x\n\r",
|
||||
Value,
|
||||
Instance
|
||||
|
@ -132,7 +132,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"Undefined: C%x:V%x I%x\n\r",
|
||||
CodeType,
|
||||
Value,
|
||||
|
|
|
@ -96,7 +96,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"\n\rDXE_ASSERT!: %a (%d): %a\n\r",
|
||||
Filename,
|
||||
LineNumber,
|
||||
|
@ -109,7 +109,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiBSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
Format,
|
||||
Marker
|
||||
);
|
||||
|
@ -119,7 +119,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"ERROR: C%x:V%x I%x",
|
||||
CodeType,
|
||||
Value,
|
||||
|
@ -129,7 +129,7 @@ SerialStatusCodeReportWorker (
|
|||
if (CallerId != NULL) {
|
||||
CharCount += AsciiSPrint (
|
||||
&Buffer[CharCount - 1],
|
||||
(EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),
|
||||
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
|
||||
" %g",
|
||||
CallerId
|
||||
);
|
||||
|
@ -138,7 +138,7 @@ SerialStatusCodeReportWorker (
|
|||
if (Data != NULL) {
|
||||
CharCount += AsciiSPrint (
|
||||
&Buffer[CharCount - 1],
|
||||
(EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),
|
||||
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
|
||||
" %x",
|
||||
Data
|
||||
);
|
||||
|
@ -146,7 +146,7 @@ SerialStatusCodeReportWorker (
|
|||
|
||||
CharCount += AsciiSPrint (
|
||||
&Buffer[CharCount - 1],
|
||||
(EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),
|
||||
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
|
||||
"\n\r"
|
||||
);
|
||||
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
|
||||
|
@ -155,7 +155,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"PROGRESS CODE: V%x I%x\n\r",
|
||||
Value,
|
||||
Instance
|
||||
|
@ -166,7 +166,7 @@ SerialStatusCodeReportWorker (
|
|||
//
|
||||
CharCount = AsciiSPrint (
|
||||
Buffer,
|
||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||
sizeof (Buffer),
|
||||
"Undefined: C%x:V%x I%x\n\r",
|
||||
CodeType,
|
||||
Value,
|
||||
|
|
Loading…
Reference in New Issue