GCC 4.8 (and others) const warnings

Calling the various Print functions picked up some warnings in my
project (using GCC 4.8 and 4.9 at the moment):
warning: passing argument 1 of Print discards const qualifier from
pointer target type [enabled by default]

Signed-off-by: Nigel Croxon <noxorc@mac.com>
Signed-off-by: Justinian <justinian@users.sf.net>
This commit is contained in:
Nigel Croxon 2017-01-08 06:52:33 -05:00
parent bd38ba4b6b
commit fa1b977962
4 changed files with 72 additions and 72 deletions

View File

@ -94,15 +94,15 @@ extern UINTN EFIDebug;
INTN INTN
DbgAssert ( DbgAssert (
CHAR8 *file, CONST CHAR8 *file,
INTN lineno, INTN lineno,
CHAR8 *string CONST CHAR8 *string
); );
INTN INTN
DbgPrint ( DbgPrint (
INTN mask, INTN mask,
CHAR8 *format, CONST CHAR8 *format,
... ...
); );

View File

@ -461,41 +461,41 @@ IInput (
UINTN UINTN
Print ( Print (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
); );
UINTN UINTN
VPrint ( VPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
va_list args va_list args
); );
UINTN UINTN
SPrint ( SPrint (
OUT CHAR16 *Str, OUT CHAR16 *Str,
IN UINTN StrSize, IN UINTN StrSize,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
); );
UINTN UINTN
VSPrint ( VSPrint (
OUT CHAR16 *Str, OUT CHAR16 *Str,
IN UINTN StrSize, IN UINTN StrSize,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
va_list args va_list args
); );
CHAR16 * CHAR16 *
VPoolPrint ( VPoolPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
va_list args va_list args
); );
CHAR16 * CHAR16 *
PoolPrint ( PoolPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
); );
@ -508,22 +508,22 @@ typedef struct {
CHAR16 * CHAR16 *
CatPrint ( CatPrint (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
); );
UINTN UINTN
PrintAt ( PrintAt (
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
); );
UINTN UINTN
IPrint ( IPrint (
IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
); );
@ -532,13 +532,13 @@ IPrintAt (
IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out,
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
); );
UINTN UINTN
APrint ( APrint (
IN CHAR8 *fmt, IN CONST CHAR8 *fmt,
... ...
); );

View File

@ -30,9 +30,9 @@ Revision History
INTN INTN
DbgAssert ( DbgAssert (
IN CHAR8 *FileName, IN CONST CHAR8 *FileName,
IN INTN LineNo, IN INTN LineNo,
IN CHAR8 *Description IN CONST CHAR8 *Description
) )
{ {
DbgPrint (D_ERROR, (CHAR8 *)"%EASSERT FAILED: %a(%d): %a%N\n", FileName, LineNo, Description); DbgPrint (D_ERROR, (CHAR8 *)"%EASSERT FAILED: %a(%d): %a%N\n", FileName, LineNo, Description);

View File

@ -55,8 +55,8 @@ typedef struct {
BOOLEAN Ascii; BOOLEAN Ascii;
UINTN Index; UINTN Index;
union { union {
CHAR16 *pw; CONST CHAR16 *pw;
CHAR8 *pc; CONST CHAR8 *pc;
} un; } un;
} POINTER; } POINTER;
@ -119,8 +119,8 @@ _IPrint (
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
IN CHAR8 *fmta, IN CONST CHAR8 *fmta,
IN va_list args IN va_list args
); );
@ -181,8 +181,8 @@ _PoolPrint (
INTN INTN
DbgPrint ( DbgPrint (
IN INTN mask, IN INTN mask,
IN CHAR8 *fmt, IN CONST CHAR8 *fmt,
... ...
) )
/*++ /*++
@ -400,7 +400,7 @@ _PoolPrint (
VOID VOID
_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 INTN (EFIAPI *Output)(VOID *context, CHAR16 *str) IN INTN (EFIAPI *Output)(VOID *context, CHAR16 *str)
@ -422,10 +422,10 @@ _PoolCatPrint (
UINTN UINTN
VSPrint ( VSPrint (
OUT CHAR16 *Str, OUT CHAR16 *Str,
IN UINTN StrSize, IN UINTN StrSize,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
va_list args va_list args
) )
/*++ /*++
@ -464,9 +464,9 @@ Returns:
UINTN UINTN
SPrint ( SPrint (
OUT CHAR16 *Str, OUT CHAR16 *Str,
IN UINTN StrSize, IN UINTN StrSize,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -502,7 +502,7 @@ Returns:
CHAR16 * CHAR16 *
VPoolPrint ( VPoolPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
va_list args va_list args
) )
/*++ /*++
@ -533,7 +533,7 @@ Returns:
CHAR16 * CHAR16 *
PoolPrint ( PoolPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -566,7 +566,7 @@ Returns:
CHAR16 * CHAR16 *
CatPrint ( CatPrint (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -603,7 +603,7 @@ Returns:
UINTN UINTN
Print ( Print (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -633,8 +633,8 @@ Returns:
UINTN UINTN
VPrint ( VPrint (
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
va_list args va_list args
) )
/*++ /*++
@ -658,9 +658,9 @@ Returns:
UINTN UINTN
PrintAt ( PrintAt (
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -695,7 +695,7 @@ Returns:
UINTN UINTN
IPrint ( IPrint (
IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -731,7 +731,7 @@ IPrintAt (
IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out,
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -770,8 +770,8 @@ _IPrint (
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
IN CHAR8 *fmta, IN CONST CHAR8 *fmta,
IN va_list args IN va_list args
) )
// Display string worker for: Print, PrintAt, IPrint, IPrintAt // Display string worker for: Print, PrintAt, IPrint, IPrintAt
@ -811,7 +811,7 @@ _IPrint (
UINTN UINTN
APrint ( APrint (
IN CHAR8 *fmt, IN CONST CHAR8 *fmt,
... ...
) )
/*++ /*++
@ -1061,9 +1061,9 @@ Returns:
// //
// %% -> % // %% -> %
// //
Item.Scratch[0] = '%';
Item.Scratch[1] = 0;
Item.Item.pw = Item.Scratch; Item.Item.pw = Item.Scratch;
Item.Item.pw[0] = '%';
Item.Item.pw[1] = 0;
break; break;
case '0': case '0':
@ -1119,9 +1119,9 @@ Returns:
break; break;
case 'c': case 'c':
Item.Scratch[0] = (CHAR16) va_arg(ps->args, UINTN);
Item.Scratch[1] = 0;
Item.Item.pw = Item.Scratch; Item.Item.pw = Item.Scratch;
Item.Item.pw[0] = (CHAR16) va_arg(ps->args, UINTN);
Item.Item.pw[1] = 0;
break; break;
case 'l': case 'l':
@ -1132,55 +1132,55 @@ Returns:
Item.Width = Item.Long ? 16 : 8; Item.Width = Item.Long ? 16 : 8;
Item.Pad = '0'; Item.Pad = '0';
case 'x': case 'x':
Item.Item.pw = Item.Scratch;
ValueToHex ( ValueToHex (
Item.Item.pw, Item.Scratch,
Item.Long ? va_arg(ps->args, UINT64) : va_arg(ps->args, UINT32) Item.Long ? va_arg(ps->args, UINT64) : va_arg(ps->args, UINT32)
); );
Item.Item.pw = Item.Scratch;
break; break;
case 'g': case 'g':
GuidToString (Item.Scratch, va_arg(ps->args, EFI_GUID *));
Item.Item.pw = Item.Scratch; Item.Item.pw = Item.Scratch;
GuidToString (Item.Item.pw, va_arg(ps->args, EFI_GUID *));
break; break;
case 'u': case 'u':
Item.Item.pw = Item.Scratch;
ValueToString ( ValueToString (
Item.Item.pw, Item.Scratch,
Item.Comma, Item.Comma,
Item.Long ? va_arg(ps->args, UINT64) : va_arg(ps->args, UINT32) Item.Long ? va_arg(ps->args, UINT64) : va_arg(ps->args, UINT32)
); );
Item.Item.pw = Item.Scratch;
break; break;
case 'd': case 'd':
Item.Item.pw = Item.Scratch;
ValueToString ( ValueToString (
Item.Item.pw, Item.Scratch,
Item.Comma, Item.Comma,
Item.Long ? va_arg(ps->args, INT64) : va_arg(ps->args, INT32) Item.Long ? va_arg(ps->args, INT64) : va_arg(ps->args, INT32)
); );
Item.Item.pw = Item.Scratch;
break; break;
case 'f': case 'f':
Item.Item.pw = Item.Scratch;
FloatToString ( FloatToString (
Item.Item.pw, Item.Scratch,
Item.Comma, Item.Comma,
va_arg(ps->args, double) va_arg(ps->args, double)
); );
Item.Item.pw = Item.Scratch;
break; break;
case 't': case 't':
TimeToString (Item.Scratch, va_arg(ps->args, EFI_TIME *));
Item.Item.pw = Item.Scratch; Item.Item.pw = Item.Scratch;
TimeToString (Item.Item.pw, va_arg(ps->args, EFI_TIME *));
break; break;
case 'r': case 'r':
StatusToString (Item.Scratch, va_arg(ps->args, EFI_STATUS));
Item.Item.pw = Item.Scratch; Item.Item.pw = Item.Scratch;
StatusToString (Item.Item.pw, va_arg(ps->args, EFI_STATUS));
break; break;
case 'n': case 'n':
@ -1208,9 +1208,9 @@ Returns:
break; break;
default: default:
Item.Scratch[0] = '?';
Item.Scratch[1] = 0;
Item.Item.pw = Item.Scratch; Item.Item.pw = Item.Scratch;
Item.Item.pw[0] = '?';
Item.Item.pw[1] = 0;
break; break;
} }