#include "PeiLib.h"\r
#include "Print.h"\r
\r
-STATIC\r
-CHAR8 *\r
-GetFlagsAndWidth (\r
- IN CHAR8 *Format, \r
- OUT UINTN *Flags, \r
- OUT UINTN *Width,\r
- IN OUT VA_LIST *Marker\r
- );\r
\r
STATIC\r
UINTN\r
UINTN BufferLeft;\r
UINT64 Value;\r
EFI_GUID *TmpGUID;\r
-\r
+ BOOLEAN Done;\r
+ \r
//\r
// Process the format string. Stop if Buffer is over run.\r
//\r
\r
//\r
// Now it's time to parse what follows after %\r
- //\r
- Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);\r
+ // \r
+ Flags = 0;\r
+ Width = 0;\r
+ for (Done = FALSE; !Done; ) {\r
+ Format++;\r
+ \r
+ switch (*Format) {\r
+ \r
+ case '-': Flags |= LEFT_JUSTIFY; break;\r
+ case '+': Flags |= PREFIX_SIGN; break;\r
+ case ' ': Flags |= PREFIX_BLANK; break;\r
+ case ',': Flags |= COMMA_TYPE; break;\r
+ case 'L':\r
+ case 'l': Flags |= LONG_TYPE; break;\r
+ \r
+ case '*':\r
+ Width = VA_ARG (Marker, UINTN);\r
+ break;\r
+ \r
+ case '0':\r
+ Flags |= PREFIX_ZERO;\r
+ case '1':\r
+ case '2':\r
+ case '3':\r
+ case '4':\r
+ case '5':\r
+ case '6':\r
+ case '7':\r
+ case '8':\r
+ case '9':\r
+ Count = 0;\r
+ do {\r
+ Count = (Count * 10) + *Format - '0';\r
+ Format++;\r
+ } while ((*Format >= '0') && (*Format <= '9'));\r
+ Format--;\r
+ Width = Count;\r
+ break;\r
+ \r
+ default:\r
+ Done = TRUE;\r
+ }\r
+ }\r
+\r
switch (*Format) {\r
case 'p':\r
//\r
\r
\r
\r
-STATIC\r
-CHAR8 *\r
-GetFlagsAndWidth (\r
- IN CHAR8 *Format, \r
- OUT UINTN *Flags, \r
- OUT UINTN *Width,\r
- IN OUT VA_LIST *Marker\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- AvSPrint worker function that parses flag and width information from the \r
- Format string and returns the next index into the Format string that needs\r
- to be parsed. See file headed for details of Flag and Width.\r
-\r
-Arguments:\r
-\r
- Format - Current location in the AvSPrint format string.\r
-\r
- Flags - Returns flags\r
-\r
- Width - Returns width of element\r
-\r
- Marker - Vararg list that may be paritally consumed and returned.\r
-\r
-Returns: \r
-\r
- Pointer indexed into the Format string for all the information parsed\r
- by this routine.\r
-\r
---*/\r
-{\r
- UINTN Count;\r
- BOOLEAN Done;\r
-\r
- *Flags = 0;\r
- *Width = 0;\r
- for (Done = FALSE; !Done; ) {\r
- Format++;\r
-\r
- switch (*Format) {\r
-\r
- case '-': *Flags |= LEFT_JUSTIFY; break;\r
- case '+': *Flags |= PREFIX_SIGN; break;\r
- case ' ': *Flags |= PREFIX_BLANK; break;\r
- case ',': *Flags |= COMMA_TYPE; break;\r
- case 'L':\r
- case 'l': *Flags |= LONG_TYPE; break;\r
-\r
- case '*':\r
- *Width = VA_ARG (*Marker, UINTN);\r
- break;\r
-\r
- case '0':\r
- *Flags |= PREFIX_ZERO;\r
- case '1':\r
- case '2':\r
- case '3':\r
- case '4':\r
- case '5':\r
- case '6':\r
- case '7':\r
- case '8':\r
- case '9':\r
- Count = 0;\r
- do {\r
- Count = (Count * 10) + *Format - '0';\r
- Format++;\r
- } while ((*Format >= '0') && (*Format <= '9'));\r
- Format--;\r
- *Width = Count;\r
- break;\r
-\r
- default:\r
- Done = TRUE;\r
- }\r
- }\r
- return Format;\r
-}\r
-\r
static CHAR8 mHexStr[] = { '0','1','2','3','4','5','6','7',\r
'8','9','A','B','C','D','E','F' };\r
\r