add CONST to parameter fmt in PoolPrint and _PoolCatPrint

This commit is contained in:
jief 2019-12-20 23:17:26 +01:00
parent 89c8fd2a69
commit ea2408cada
2 changed files with 18 additions and 18 deletions

View File

@ -32,7 +32,7 @@ typedef struct {
BOOLEAN Ascii; BOOLEAN Ascii;
UINTN Index; UINTN Index;
union { union {
CHAR16 *pw; CONST CHAR16 *pw;
CHAR8 *pc; CHAR8 *pc;
} u; } u;
} POINTER; } POINTER;
@ -127,7 +127,7 @@ _IPrint (
VOID VOID
EFIAPI EFIAPI
_PoolCatPrint ( _PoolCatPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
IN VA_LIST args, IN VA_LIST args,
IN OUT POOL_PRINT *spc, IN OUT POOL_PRINT *spc,
IN EFI_STATUS IN EFI_STATUS
@ -261,7 +261,7 @@ Returns:
VOID VOID
EFIAPI EFIAPI
_PoolCatPrint ( _PoolCatPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
IN VA_LIST args, IN VA_LIST args,
IN OUT POOL_PRINT *spc, IN OUT POOL_PRINT *spc,
IN EFI_STATUS IN EFI_STATUS
@ -303,7 +303,7 @@ Returns:
CHAR16 * CHAR16 *
EFIAPI EFIAPI
PoolPrint ( PoolPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -770,7 +770,7 @@ Returns:
return 0; return 0;
} }
Item.Scratch = AllocateZeroPool (sizeof (CHAR16) * PRINT_ITEM_BUFFER_LEN); Item.Scratch = (__typeof__(Item.Scratch))AllocateZeroPool (sizeof (CHAR16) * PRINT_ITEM_BUFFER_LEN);
if (NULL == Item.Scratch) { if (NULL == Item.Scratch) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -820,9 +820,9 @@ Returns:
// //
// %% -> % // %% -> %
// //
Item.Scratch[0] = '%';
Item.Scratch[1] = 0;
Item.Item.u.pw = Item.Scratch; Item.Item.u.pw = Item.Scratch;
Item.Item.u.pw[0] = '%';
Item.Item.u.pw[1] = 0;
break; break;
case '0': case '0':
@ -882,9 +882,9 @@ Returns:
break; break;
case 'c': case 'c':
Item.Scratch[0] = (CHAR16) VA_ARG (ps->args, UINTN);
Item.Scratch[1] = 0;
Item.Item.u.pw = Item.Scratch; Item.Item.u.pw = Item.Scratch;
Item.Item.u.pw[0] = (CHAR16) VA_ARG (ps->args, UINTN);
Item.Item.u.pw[1] = 0;
break; break;
case 'l': case 'l':
@ -896,13 +896,13 @@ Returns:
Item.Pad = '0'; Item.Pad = '0';
case 'x': case 'x':
Item.Item.u.pw = Item.Scratch;
//SPrint(Buffer, 64, L"EFI Error №%r", (UINTN)Status); //SPrint(Buffer, 64, L"EFI Error №%r", (UINTN)Status);
// ValueToHex ( // ValueToHex (
UnicodeSPrint( UnicodeSPrint(
Item.Item.u.pw, 64, L"%x", Item.Scratch, 64, L"%x",
Item.Long ? VA_ARG (ps->args, UINT64) : VA_ARG (ps->args, UINTN) Item.Long ? VA_ARG (ps->args, UINT64) : VA_ARG (ps->args, UINTN)
); );
Item.Item.u.pw = Item.Scratch;
break; break;
/* /*
@ -915,13 +915,13 @@ Returns:
break; break;
*/ */
case 'd': case 'd':
Item.Item.u.pw = Item.Scratch;
// ValueToString ( // ValueToString (
UnicodeSPrint( UnicodeSPrint(
Item.Item.u.pw, 64, L"%d", Item.Scratch, 64, L"%d",
// Item.Comma, // Item.Comma,
Item.Long ? VA_ARG (ps->args, UINT64) : VA_ARG (ps->args, INTN) Item.Long ? VA_ARG (ps->args, UINT64) : VA_ARG (ps->args, INTN)
); );
Item.Item.u.pw = Item.Scratch;
break; break;
/* /*
case 't': case 't':
@ -930,9 +930,9 @@ Returns:
break; break;
*/ */
case 'r': case 'r':
Item.Item.u.pw = Item.Scratch;
// StatusToString // StatusToString
UnicodeSPrint(Item.Item.u.pw, 64, L"%r", VA_ARG (ps->args, EFI_STATUS)); UnicodeSPrint(Item.Scratch, 64, L"%r", VA_ARG (ps->args, EFI_STATUS));
Item.Item.u.pw = Item.Scratch;
break; break;
case 'n': case 'n':
@ -976,9 +976,9 @@ Returns:
break; break;
default: default:
Item.Scratch[0] = '?';
Item.Scratch[1] = 0;
Item.Item.u.pw = Item.Scratch; Item.Item.u.pw = Item.Scratch;
Item.Item.u.pw[0] = '?';
Item.Item.u.pw[1] = 0;
break; break;
} }
// //

View File

@ -118,7 +118,7 @@ VSPrint (
CHAR16 * CHAR16 *
EFIAPI EFIAPI
PoolPrint ( PoolPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
); );
/* /*