Refactor part 1
This commit is contained in:
@@ -27,9 +27,9 @@
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN PUINT16 Format,
|
||||
IN VA_LIST Arguments)
|
||||
BlpStringPrint(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN PUINT16 Format,
|
||||
IN VA_LIST Arguments)
|
||||
{
|
||||
PEFI_GUID Guid;
|
||||
PUCHAR String;
|
||||
@@ -46,7 +46,7 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
{
|
||||
case L'b':
|
||||
/* Boolean */
|
||||
BmpFormatString(PrintCharRoutine, L"%s", VA_ARG(Arguments, INT32) ? "TRUE" : "FALSE");
|
||||
BlpStringFormat(PrintCharRoutine, L"%s", VA_ARG(Arguments, INT32) ? "TRUE" : "FALSE");
|
||||
break;
|
||||
case L'c':
|
||||
/* Character */
|
||||
@@ -54,12 +54,12 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
break;
|
||||
case L'd':
|
||||
/* Signed 32-bit integer */
|
||||
BmpPrintSigned32String(PrintCharRoutine, VA_ARG(Arguments, INT32), 10);
|
||||
BlpStringPrintSigned32(PrintCharRoutine, VA_ARG(Arguments, INT32), 10);
|
||||
break;
|
||||
case L'g':
|
||||
/* EFI GUID */
|
||||
Guid = VA_ARG(Arguments, PEFI_GUID);
|
||||
BmpFormatString(PrintCharRoutine, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", Guid->Data1,
|
||||
BlpStringFormat(PrintCharRoutine, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", Guid->Data1,
|
||||
Guid->Data2, Guid->Data3, Guid->Data4[0], Guid->Data4[1], Guid->Data4[2],
|
||||
Guid->Data4[3], Guid->Data4[4], Guid->Data4[5], Guid->Data4[6], Guid->Data4[7]);
|
||||
break;
|
||||
@@ -69,15 +69,15 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
{
|
||||
case L'd':
|
||||
/* Signed 64-bit integer */
|
||||
BmpPrintSigned64String(PrintCharRoutine, VA_ARG(Arguments, INT_PTR), 10);
|
||||
BlpStringPrintSigned64(PrintCharRoutine, VA_ARG(Arguments, INT_PTR), 10);
|
||||
break;
|
||||
case L'u':
|
||||
/* Unsigned 64-bit integer */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 10, 0);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 10, 0);
|
||||
break;
|
||||
case L'x':
|
||||
/* Unsigned 64-bit hexadecimal integer */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, 0);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, 0);
|
||||
break;
|
||||
default:
|
||||
/* Unknown by default */
|
||||
@@ -87,7 +87,7 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
break;
|
||||
case L'p':
|
||||
/* Pointer address */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, 0);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, 0);
|
||||
break;
|
||||
case L's':
|
||||
/* String of characters */
|
||||
@@ -106,21 +106,21 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
break;
|
||||
case L'u':
|
||||
/* Unsigned 32-bit integer */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, VA_ARG(Arguments, UINT32), 10, 0);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, VA_ARG(Arguments, UINT32), 10, 0);
|
||||
break;
|
||||
case L'x':
|
||||
/* Unsigned 32-bit hexadecimal integer */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, VA_ARG(Arguments, UINT32), 16, 0);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, VA_ARG(Arguments, UINT32), 16, 0);
|
||||
break;
|
||||
case L'0':
|
||||
/* Zero padded numbers */
|
||||
++Format;
|
||||
PaddingCount = BmpReadStringPadding(&Format);
|
||||
PaddingCount = BlpStringReadPadding(&Format);
|
||||
switch(*Format)
|
||||
{
|
||||
case L'd':
|
||||
/* Zero-padded, signed 32-bit integer */
|
||||
BmpPrintSigned32String(PrintCharRoutine, VA_ARG(Arguments, INT32), 10);
|
||||
BlpStringPrintSigned32(PrintCharRoutine, VA_ARG(Arguments, INT32), 10);
|
||||
break;
|
||||
case L'l':
|
||||
/* 64-bit numbers */
|
||||
@@ -128,15 +128,15 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
{
|
||||
case L'd':
|
||||
/* Zero-padded, signed 64-bit integer */
|
||||
BmpPrintSigned64String(PrintCharRoutine, VA_ARG(Arguments, INT_PTR), 10);
|
||||
BlpStringPrintSigned64(PrintCharRoutine, VA_ARG(Arguments, INT_PTR), 10);
|
||||
break;
|
||||
case L'u':
|
||||
/* Zero-padded, unsigned 64-bit integer */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 10, PaddingCount);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 10, PaddingCount);
|
||||
break;
|
||||
case L'x':
|
||||
/* Zero-padded, unsigned 64-bit hexadecimal integer */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, PaddingCount);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, PaddingCount);
|
||||
break;
|
||||
default:
|
||||
/* Unknown by default */
|
||||
@@ -146,11 +146,11 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
break;
|
||||
case L'u':
|
||||
/* Zero-padded, unsigned 32-bit integer */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, VA_ARG(Arguments, UINT32), 10, PaddingCount);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, VA_ARG(Arguments, UINT32), 10, PaddingCount);
|
||||
break;
|
||||
case L'x':
|
||||
/* Zero-padded, unsigned 32-bit hexadecimal integer */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, VA_ARG(Arguments, UINT32), 16, PaddingCount);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, VA_ARG(Arguments, UINT32), 16, PaddingCount);
|
||||
break;
|
||||
default:
|
||||
/* Unknown by default */
|
||||
@@ -202,7 +202,7 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpFormatString(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringFormat(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN PUINT16 Format,
|
||||
IN ...)
|
||||
{
|
||||
@@ -212,7 +212,7 @@ BmpFormatString(IN BMPRINTCHAR PrintCharRoutine,
|
||||
VA_START(Arguments, Format);
|
||||
|
||||
/* Format and print the string to the desired output */
|
||||
BmPrintString(PrintCharRoutine, Format, Arguments);
|
||||
BlpStringPrint(PrintCharRoutine, Format, Arguments);
|
||||
|
||||
/* Clean up the va_list */
|
||||
VA_END(Arguments);
|
||||
@@ -236,7 +236,7 @@ BmpFormatString(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintSigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintSigned32(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN INT Number,
|
||||
IN UINT Base)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ BmpPrintSigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
}
|
||||
|
||||
/* Print the integer value */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, Number, Base, 0);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, Number, Base, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -269,7 +269,7 @@ BmpPrintSigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintSigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintSigned64(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN INT_PTR Number,
|
||||
IN UINT_PTR Base)
|
||||
{
|
||||
@@ -281,7 +281,7 @@ BmpPrintSigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
}
|
||||
|
||||
/* Print the integer value */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, Number, Base, 0);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, Number, Base, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,7 +305,7 @@ BmpPrintSigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintUnsigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintUnsigned32(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN UINT Number,
|
||||
IN UINT Base,
|
||||
IN UINT Padding)
|
||||
@@ -321,7 +321,7 @@ BmpPrintUnsigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*--Pointer = 0;
|
||||
do
|
||||
{
|
||||
*--Pointer = BmpHexTable[Number % Base];
|
||||
*--Pointer = BlpHexTable[Number % Base];
|
||||
} while(Pointer >= Buffer && (Number /= Base));
|
||||
|
||||
/* Calculate number length */
|
||||
@@ -366,7 +366,7 @@ BmpPrintUnsigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintUnsigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintUnsigned64(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN UINT_PTR Number,
|
||||
IN UINT_PTR Base,
|
||||
IN UINT_PTR Padding)
|
||||
@@ -382,7 +382,7 @@ BmpPrintUnsigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*--Pointer = 0;
|
||||
do
|
||||
{
|
||||
*--Pointer = BmpHexTable[Number % Base];
|
||||
*--Pointer = BlpHexTable[Number % Base];
|
||||
} while(Pointer >= Buffer && (Number /= Base));
|
||||
|
||||
/* Calculate number length */
|
||||
@@ -418,7 +418,7 @@ BmpPrintUnsigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
UINT64
|
||||
BmpReadStringPadding(IN PUINT16 *Format)
|
||||
BlpStringReadPadding(IN PUINT16 *Format)
|
||||
{
|
||||
ULONG Count = 0;
|
||||
PUINT16 Fmt = *Format;
|
||||
|
||||
Reference in New Issue
Block a user