MdeModulePkg/EbcDxe: Make the variable name follow rules

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
This commit is contained in:
Dandan Bi 2016-12-01 16:22:49 +08:00 committed by Star Zeng
parent 8fd543c77a
commit 3e118ea87d
2 changed files with 113 additions and 113 deletions

View File

@ -28,31 +28,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
UINTN UINTN
EFIAPI EFIAPI
Xtoi ( Xtoi (
CHAR16 *str CHAR16 *Str
); );
UINT64 UINT64
EFIAPI EFIAPI
LXtoi ( LXtoi (
CHAR16 *str CHAR16 *Str
); );
UINTN UINTN
EFIAPI EFIAPI
Atoi ( Atoi (
CHAR16 *str CHAR16 *Str
); );
UINTN UINTN
EFIAPI EFIAPI
AsciiXtoi ( AsciiXtoi (
CHAR8 *str CHAR8 *Str
); );
UINTN UINTN
EFIAPI EFIAPI
AsciiAtoi ( AsciiAtoi (
CHAR8 *str CHAR8 *Str
); );
INTN INTN

View File

@ -18,294 +18,294 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Convert hex string to uint. Convert hex string to uint.
@param str - The string @param Str - The string
**/ **/
UINTN UINTN
EFIAPI EFIAPI
Xtoi ( Xtoi (
CHAR16 *str CHAR16 *Str
) )
{ {
UINTN u; UINTN RetVal;
CHAR16 c; CHAR16 TempChar;
UINTN m; UINTN MaxVal;
ASSERT (str != NULL); ASSERT (Str != NULL);
m = (UINTN) -1 >> 4; MaxVal = (UINTN) -1 >> 4;
// //
// skip preceeding white space // skip preceeding white space
// //
while (*str && *str == ' ') { while (*Str && *Str == ' ') {
str += 1; Str += 1;
} }
// //
// skip preceeding zeros // skip preceeding zeros
// //
while (*str && *str == '0') { while (*Str && *Str == '0') {
str += 1; Str += 1;
} }
// //
// skip preceeding white space // skip preceeding white space
// //
if (*str && (*str == 'x' || *str == 'X')) { if (*Str && (*Str == 'x' || *Str == 'X')) {
str += 1; Str += 1;
} }
// //
// convert hex digits // convert hex digits
// //
u = 0; RetVal = 0;
c = *(str++); TempChar = *(Str++);
while (c) { while (TempChar) {
if (c >= 'a' && c <= 'f') { if (TempChar >= 'a' && TempChar <= 'f') {
c -= 'a' - 'A'; TempChar -= 'a' - 'A';
} }
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) { if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
if (u > m) { if (RetVal > MaxVal) {
return (UINTN) -1; return (UINTN) -1;
} }
u = (u << 4) | (c - (c >= 'A' ? 'A' - 10 : '0')); RetVal = (RetVal << 4) | (TempChar - (TempChar >= 'A' ? 'A' - 10 : '0'));
} else { } else {
break; break;
} }
c = *(str++); TempChar = *(Str++);
} }
return u; return RetVal;
} }
/** /**
Convert hex string to uint. Convert hex string to uint.
@param str - The string @param Str - The string
**/ **/
UINT64 UINT64
EFIAPI EFIAPI
LXtoi ( LXtoi (
CHAR16 *str CHAR16 *Str
) )
{ {
UINT64 u; UINT64 RetVal;
CHAR16 c; CHAR16 TempChar;
UINT64 m; UINT64 MaxVal;
ASSERT (str != NULL); ASSERT (Str != NULL);
m = RShiftU64 ((UINT64) -1, 4); MaxVal = RShiftU64 ((UINT64) -1, 4);
// //
// skip preceeding white space // skip preceeding white space
// //
while (*str && *str == ' ') { while (*Str && *Str == ' ') {
str += 1; Str += 1;
} }
// //
// skip preceeding zeros // skip preceeding zeros
// //
while (*str && *str == '0') { while (*Str && *Str == '0') {
str += 1; Str += 1;
} }
// //
// skip preceeding white space // skip preceeding white space
// //
if (*str && (*str == 'x' || *str == 'X')) { if (*Str && (*Str == 'x' || *Str == 'X')) {
str += 1; Str += 1;
} }
// //
// convert hex digits // convert hex digits
// //
u = 0; RetVal = 0;
c = *(str++); TempChar = *(Str++);
while (c) { while (TempChar) {
if (c >= 'a' && c <= 'f') { if (TempChar >= 'a' && TempChar <= 'f') {
c -= 'a' - 'A'; TempChar -= 'a' - 'A';
} }
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) { if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
if (u > m) { if (RetVal > MaxVal) {
return (UINT64) -1; return (UINT64) -1;
} }
u = LShiftU64 (u, 4); RetVal = LShiftU64 (RetVal, 4);
u = u + (c - (c >= 'A' ? 'A' - 10 : '0')); RetVal = RetVal + (TempChar - (TempChar >= 'A' ? 'A' - 10 : '0'));
} else { } else {
break; break;
} }
c = *(str++); TempChar = *(Str++);
} }
return u; return RetVal;
} }
/** /**
Convert hex string to uint. Convert hex string to uint.
@param str - The string @param Str - The string
**/ **/
UINTN UINTN
EFIAPI EFIAPI
Atoi ( Atoi (
CHAR16 *str CHAR16 *Str
) )
{ {
UINTN u; UINTN RetVal;
CHAR16 c; CHAR16 TempChar;
UINTN m; UINTN MaxVal;
UINTN n; UINTN ResteVal;
ASSERT (str != NULL); ASSERT (Str != NULL);
m = (UINTN) -1 / 10; MaxVal = (UINTN) -1 / 10;
n = (UINTN) -1 % 10; ResteVal = (UINTN) -1 % 10;
// //
// skip preceeding white space // skip preceeding white space
// //
while (*str && *str == ' ') { while (*Str && *Str == ' ') {
str += 1; Str += 1;
} }
// //
// convert digits // convert digits
// //
u = 0; RetVal = 0;
c = *(str++); TempChar = *(Str++);
while (c) { while (TempChar) {
if (c >= '0' && c <= '9') { if (TempChar >= '0' && TempChar <= '9') {
if (u > m || (u == m && c - '0' > (INTN) n)) { if (RetVal > MaxVal || (RetVal == MaxVal && TempChar - '0' > (INTN) ResteVal)) {
return (UINTN) -1; return (UINTN) -1;
} }
u = (u * 10) + c - '0'; RetVal = (RetVal * 10) + TempChar - '0';
} else { } else {
break; break;
} }
c = *(str++); TempChar = *(Str++);
} }
return u; return RetVal;
} }
/** /**
Convert hex string to uint. Convert hex string to uint.
@param str - The string @param Str - The string
**/ **/
UINTN UINTN
EFIAPI EFIAPI
AsciiXtoi ( AsciiXtoi (
CHAR8 *str CHAR8 *Str
) )
{ {
UINTN u; UINTN RetVal;
CHAR8 c; CHAR8 TempChar;
UINTN m; UINTN MaxVal;
ASSERT (str != NULL); ASSERT (Str != NULL);
m = (UINTN) -1 >> 4; MaxVal = (UINTN) -1 >> 4;
// //
// skip preceeding white space // skip preceeding white space
// //
while (*str && *str == ' ') { while (*Str && *Str == ' ') {
str += 1; Str += 1;
} }
// //
// skip preceeding zeros // skip preceeding zeros
// //
while (*str && *str == '0') { while (*Str && *Str == '0') {
str += 1; Str += 1;
} }
// //
// skip preceeding white space // skip preceeding white space
// //
if (*str && (*str == 'x' || *str == 'X')) { if (*Str && (*Str == 'x' || *Str == 'X')) {
str += 1; Str += 1;
} }
// //
// convert hex digits // convert hex digits
// //
u = 0; RetVal = 0;
c = *(str++); TempChar = *(Str++);
while (c) { while (TempChar) {
if (c >= 'a' && c <= 'f') { if (TempChar >= 'a' && TempChar <= 'f') {
c -= 'a' - 'A'; TempChar -= 'a' - 'A';
} }
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) { if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
if (u > m) { if (RetVal > MaxVal) {
return (UINTN) -1; return (UINTN) -1;
} }
u = (u << 4) | (c - (c >= 'A' ? 'A' - 10 : '0')); RetVal = (RetVal << 4) | (TempChar - (TempChar >= 'A' ? 'A' - 10 : '0'));
} else { } else {
break; break;
} }
c = *(str++); TempChar = *(Str++);
} }
return u; return RetVal;
} }
/** /**
Convert hex string to uint. Convert hex string to uint.
@param str - The string @param Str - The string
**/ **/
UINTN UINTN
EFIAPI EFIAPI
AsciiAtoi ( AsciiAtoi (
CHAR8 *str CHAR8 *Str
) )
{ {
UINTN u; UINTN RetVal;
CHAR8 c; CHAR8 TempChar;
UINTN m; UINTN MaxVal;
UINTN n; UINTN ResteVal;
ASSERT (str != NULL); ASSERT (Str != NULL);
m = (UINTN) -1 / 10; MaxVal = (UINTN) -1 / 10;
n = (UINTN) -1 % 10; ResteVal = (UINTN) -1 % 10;
// //
// skip preceeding white space // skip preceeding white space
// //
while (*str && *str == ' ') { while (*Str && *Str == ' ') {
str += 1; Str += 1;
} }
// //
// convert digits // convert digits
// //
u = 0; RetVal = 0;
c = *(str++); TempChar = *(Str++);
while (c) { while (TempChar) {
if (c >= '0' && c <= '9') { if (TempChar >= '0' && TempChar <= '9') {
if (u > m || (u == m && c - '0' > (INTN) n)) { if (RetVal > MaxVal || (RetVal == MaxVal && TempChar - '0' > (INTN) ResteVal)) {
return (UINTN) -1; return (UINTN) -1;
} }
u = (u * 10) + c - '0'; RetVal = (RetVal * 10) + TempChar - '0';
} else { } else {
break; break;
} }
c = *(str++); TempChar = *(Str++);
} }
return u; return RetVal;
} }
STATIC STATIC