BaseMemoryLib (BaseMemoryLibRepStr):

Fix a logic error in SetMem64 (); The correct stride should be 8 instead of 4.
	BasePrintLib:
	Fix Printf(“%\n”) passer error.
	Fix BufferSize = 0, 1 issue
	Fix some missing ASSERT ()s
	Move MAXIMUM_VALUE_CHARACTERS from PrintLibInternal.h to PrintLib.h
	ReportStatusCodeLib:
	Add CONST modifier to some interfaces
	Modify 
	DebugLib:
	Replace some Unicode in comments.
	PeiServicesTablePointerLib
	Add ASSERT()s
	PciLib:
	Remove unnecessary ASSERT()s in PciRead/WriteBuffer()


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@496 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8
2006-06-13 06:31:11 +00:00
parent ad82307c75
commit 8960cdebac
21 changed files with 147 additions and 168 deletions

View File

@@ -66,7 +66,6 @@ static CONST STATUS_LOOKUP_TABLE_ENTRY StatusString[] = {
@param Buffer Character buffer to print the results of the parsing
of Format into.
@param BufferSize Maximum number of characters to put into buffer.
Zero means no limit.
@param Flags Intial flags value.
Can only have FORMAT_UNICODE and OUTPUT_UNICODE set
@param Format Null-terminated format string.
@@ -110,6 +109,9 @@ BasePrintLibVSPrint (
UINTN Radix;
RETURN_STATUS Status;
if (BufferSize == 0) {
return 0;
}
ASSERT (Buffer != NULL);
ASSERT (Format != NULL);
@@ -130,7 +132,6 @@ BasePrintLibVSPrint (
//
// Reserve space for the Null terminator.
// If BufferSize is 0, this will set BufferSize to the max unsigned value
//
BufferSize--;
@@ -338,7 +339,7 @@ BasePrintLibVSPrint (
} else {
BasePrintLibSPrint (
ValueBuffer,
0,
MAXIMUM_VALUE_CHARACTERS,
0,
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
TmpGuid->Data1,
@@ -364,7 +365,7 @@ BasePrintLibVSPrint (
} else {
BasePrintLibSPrint (
ValueBuffer,
0,
MAXIMUM_VALUE_CHARACTERS,
0,
"%02d/%02d/%04d %02d:%02d",
TmpTime->Month,
@@ -386,10 +387,14 @@ BasePrintLibVSPrint (
}
}
if (ArgumentString == ValueBuffer) {
BasePrintLibSPrint ((CHAR8 *) ValueBuffer, 0, 0, "%08X", Status);
BasePrintLibSPrint ((CHAR8 *) ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08X", Status);
}
break;
case '\n':
ArgumentString = "\r\n";
break;
case '%':
default:
//
@@ -400,9 +405,6 @@ BasePrintLibVSPrint (
break;
}
break;
case '\n':
ArgumentString = "\r\n";
break;
default:
ArgumentString = (CHAR8 *)&FormatCharacter;
Flags |= ARGUMENT_UNICODE;
@@ -717,7 +719,7 @@ UnicodeSPrintAsciiFormat (
VA_LIST Marker;
VA_START (Marker, FormatString);
return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize >> 1, FormatString, Marker);
return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker);
}
/**

View File

@@ -138,13 +138,20 @@ BasePrintLibConvertValueToString (
UINTN Digits;
UINTN Index;
ASSERT (Buffer != NULL);
ASSERT (Width < MAXIMUM_VALUE_CHARACTERS);
//
// Make sure Flags can only contain supported bits.
//
ASSERT ((Flags & ~(LEFT_JUSTIFY | COMMA_TYPE | PREFIX_ZERO)) == 0);
OriginalBuffer = Buffer;
if (Width == 0 || (Flags & COMMA_TYPE) != 0) {
Flags &= (~PREFIX_ZERO);
}
if (Width == 0 || Width > (MAXIMUM_VALUE_CHARACTERS - 1)) {
if (Width == 0) {
Width = MAXIMUM_VALUE_CHARACTERS - 1;
}

View File

@@ -31,16 +31,6 @@
#define PRECISION 0x800
#define ARGUMENT_REVERSED 0x1000
///
/// Define the maximum number of characters that are required to encode
/// a decimal, hexidecimal, GUID, or TIME value with a Nll terminator.
/// Maximum Length Decimal String = 28 "-9,223,372,036,854,775,808"
/// Maximum Length Hexidecimal String = 17 "FFFFFFFFFFFFFFFF"
/// Maximum Length GUID = 37 "00000000-0000-0000-0000-000000000000"
/// Maximum Length TIME = 18 "12/12/2006 12:12"
///
#define MAXIMUM_VALUE_CHARACTERS 38
//
// Record date and time information
//