public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Dandan Bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Jiewen Yao <jiewen.yao@intel.com>, Pete Batard <pete@akeo.ie>
Subject: [patch 3/5] MdeModulePkg/EbcDxe: Make the variable name follow rules
Date: Mon,  5 Dec 2016 13:27:19 +0800	[thread overview]
Message-ID: <1480915641-59136-4-git-send-email-dandan.bi@intel.com> (raw)
In-Reply-To: <1480915641-59136-1-git-send-email-dandan.bi@intel.com>

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>
---
 .../Universal/EbcDxe/EbcDebugger/EdbSupport.h      |  10 +-
 .../EbcDxe/EbcDebugger/EdbSupportString.c          | 216 ++++++++++-----------
 2 files changed, 113 insertions(+), 113 deletions(-)

diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h
index ed1abe6..8908718 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h
@@ -26,35 +26,35 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define EFI_DEBUG_MAX_PRINT_BUFFER   (80 * 4)
 
 UINTN
 EFIAPI
 Xtoi (
-  CHAR16  *str
+  CHAR16  *Str
   );
 
 UINT64
 EFIAPI
 LXtoi (
-  CHAR16  *str
+  CHAR16  *Str
   );
 
 UINTN
 EFIAPI
 Atoi (
-  CHAR16  *str
+  CHAR16  *Str
   );
 
 UINTN
 EFIAPI
 AsciiXtoi (
-  CHAR8  *str
+  CHAR8  *Str
   );
 
 UINTN
 EFIAPI
 AsciiAtoi (
-  CHAR8  *str
+  CHAR8  *Str
   );
 
 INTN
 EFIAPI
 StrCmpUnicodeAndAscii (
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c
index f564124..1a396a4 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c
@@ -16,298 +16,298 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 /**
 
   Convert hex string to uint.
 
-  @param  str  -  The string
+  @param  Str  -  The string
 
 **/
 UINTN
 EFIAPI
 Xtoi (
-  CHAR16  *str
+  CHAR16  *Str
   )
 {
-  UINTN   u;
-  CHAR16  c;
-  UINTN   m;
+  UINTN   RetVal;
+  CHAR16  TempChar;
+  UINTN   MaxVal;
 
-  ASSERT (str != NULL);
+  ASSERT (Str != NULL);
 
-  m = (UINTN) -1 >> 4;
+  MaxVal = (UINTN) -1 >> 4;
   //
   // skip preceeding white space
   //
-  while (*str && *str == ' ') {
-    str += 1;
+  while (*Str && *Str == ' ') {
+    Str += 1;
   }
   //
   // skip preceeding zeros
   //
-  while (*str && *str == '0') {
-    str += 1;
+  while (*Str && *Str == '0') {
+    Str += 1;
   }
   //
   // skip preceeding white space
   //
-  if (*str && (*str == 'x' || *str == 'X')) {
-    str += 1;
+  if (*Str && (*Str == 'x' || *Str == 'X')) {
+    Str += 1;
   }
   //
   // convert hex digits
   //
-  u = 0;
-  c = *(str++);
-  while (c) {
-    if (c >= 'a' && c <= 'f') {
-      c -= 'a' - 'A';
+  RetVal = 0;
+  TempChar = *(Str++);
+  while (TempChar) {
+    if (TempChar >= 'a' && TempChar <= 'f') {
+      TempChar -= 'a' - 'A';
     }
 
-    if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) {
-      if (u > m) {
+    if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
+      if (RetVal > MaxVal) {
         return (UINTN) -1;
       }
 
-      u = (u << 4) | (c - (c >= 'A' ? 'A' - 10 : '0'));
+      RetVal = (RetVal << 4) | (TempChar - (TempChar >= 'A' ? 'A' - 10 : '0'));
     } else {
       break;
     }
 
-    c = *(str++);
+    TempChar = *(Str++);
   }
 
-  return u;
+  return RetVal;
 }
 
 /**
 
   Convert hex string to uint.
 
-  @param  str  -  The string
+  @param  Str  -  The string
 
 **/
 
 UINT64
 EFIAPI
 LXtoi (
-  CHAR16  *str
+  CHAR16  *Str
   )
 {
-  UINT64  u;
-  CHAR16  c;
-  UINT64  m;
+  UINT64  RetVal;
+  CHAR16  TempChar;
+  UINT64  MaxVal;
 
-  ASSERT (str != NULL);
+  ASSERT (Str != NULL);
 
-  m = RShiftU64 ((UINT64) -1, 4);
+  MaxVal = RShiftU64 ((UINT64) -1, 4);
   //
   // skip preceeding white space
   //
-  while (*str && *str == ' ') {
-    str += 1;
+  while (*Str && *Str == ' ') {
+    Str += 1;
   }
   //
   // skip preceeding zeros
   //
-  while (*str && *str == '0') {
-    str += 1;
+  while (*Str && *Str == '0') {
+    Str += 1;
   }
   //
   // skip preceeding white space
   //
-  if (*str && (*str == 'x' || *str == 'X')) {
-    str += 1;
+  if (*Str && (*Str == 'x' || *Str == 'X')) {
+    Str += 1;
   }
   //
   // convert hex digits
   //
-  u = 0;
-  c = *(str++);
-  while (c) {
-    if (c >= 'a' && c <= 'f') {
-      c -= 'a' - 'A';
+  RetVal = 0;
+  TempChar = *(Str++);
+  while (TempChar) {
+    if (TempChar >= 'a' && TempChar <= 'f') {
+      TempChar -= 'a' - 'A';
     }
 
-    if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) {
-      if (u > m) {
+    if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
+      if (RetVal > MaxVal) {
         return (UINT64) -1;
       }
 
-      u = LShiftU64 (u, 4);
-      u = u + (c - (c >= 'A' ? 'A' - 10 : '0'));
+      RetVal = LShiftU64 (RetVal, 4);
+      RetVal = RetVal + (TempChar - (TempChar >= 'A' ? 'A' - 10 : '0'));
     } else {
       break;
     }
 
-    c = *(str++);
+    TempChar = *(Str++);
   }
 
-  return u;
+  return RetVal;
 }
 
 /**
 
   Convert hex string to uint.
 
-  @param str  -  The string
+  @param Str  -  The string
 
 **/
 UINTN
 EFIAPI
 Atoi (
-  CHAR16  *str
+  CHAR16  *Str
   )
 {
-  UINTN   u;
-  CHAR16  c;
-  UINTN   m;
-  UINTN   n;
+  UINTN   RetVal;
+  CHAR16  TempChar;
+  UINTN   MaxVal;
+  UINTN   ResteVal;
 
-  ASSERT (str != NULL);
+  ASSERT (Str != NULL);
 
-  m = (UINTN) -1 / 10;
-  n = (UINTN) -1 % 10;
+  MaxVal = (UINTN) -1 / 10;
+  ResteVal = (UINTN) -1 % 10;
   //
   // skip preceeding white space
   //
-  while (*str && *str == ' ') {
-    str += 1;
+  while (*Str && *Str == ' ') {
+    Str += 1;
   }
   //
   // convert digits
   //
-  u = 0;
-  c = *(str++);
-  while (c) {
-    if (c >= '0' && c <= '9') {
-      if (u > m || (u == m && c - '0' > (INTN) n)) {
+  RetVal = 0;
+  TempChar = *(Str++);
+  while (TempChar) {
+    if (TempChar >= '0' && TempChar <= '9') {
+      if (RetVal > MaxVal || (RetVal == MaxVal && TempChar - '0' > (INTN) ResteVal)) {
         return (UINTN) -1;
       }
 
-      u = (u * 10) + c - '0';
+      RetVal = (RetVal * 10) + TempChar - '0';
     } else {
       break;
     }
 
-    c = *(str++);
+    TempChar = *(Str++);
   }
 
-  return u;
+  return RetVal;
 }
 
 /**
 
   Convert hex string to uint.
 
-  @param  str  -  The string
+  @param  Str  -  The string
 
 **/
 UINTN
 EFIAPI
 AsciiXtoi (
-  CHAR8  *str
+  CHAR8  *Str
   )
 {
-  UINTN   u;
-  CHAR8   c;
-  UINTN   m;
+  UINTN   RetVal;
+  CHAR8   TempChar;
+  UINTN   MaxVal;
 
-  ASSERT (str != NULL);
+  ASSERT (Str != NULL);
 
-  m = (UINTN) -1 >> 4;
+  MaxVal = (UINTN) -1 >> 4;
   //
   // skip preceeding white space
   //
-  while (*str && *str == ' ') {
-    str += 1;
+  while (*Str && *Str == ' ') {
+    Str += 1;
   }
   //
   // skip preceeding zeros
   //
-  while (*str && *str == '0') {
-    str += 1;
+  while (*Str && *Str == '0') {
+    Str += 1;
   }
   //
   // skip preceeding white space
   //
-  if (*str && (*str == 'x' || *str == 'X')) {
-    str += 1;
+  if (*Str && (*Str == 'x' || *Str == 'X')) {
+    Str += 1;
   }
   //
   // convert hex digits
   //
-  u = 0;
-  c = *(str++);
-  while (c) {
-    if (c >= 'a' && c <= 'f') {
-      c -= 'a' - 'A';
+  RetVal = 0;
+  TempChar = *(Str++);
+  while (TempChar) {
+    if (TempChar >= 'a' && TempChar <= 'f') {
+      TempChar -= 'a' - 'A';
     }
 
-    if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) {
-      if (u > m) {
+    if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
+      if (RetVal > MaxVal) {
         return (UINTN) -1;
       }
 
-      u = (u << 4) | (c - (c >= 'A' ? 'A' - 10 : '0'));
+      RetVal = (RetVal << 4) | (TempChar - (TempChar >= 'A' ? 'A' - 10 : '0'));
     } else {
       break;
     }
 
-    c = *(str++);
+    TempChar = *(Str++);
   }
 
-  return u;
+  return RetVal;
 }
 
 /**
 
   Convert hex string to uint.
 
-  @param str  -  The string
+  @param Str  -  The string
 
 **/
 UINTN
 EFIAPI
 AsciiAtoi (
-  CHAR8  *str
+  CHAR8  *Str
   )
 {
-  UINTN   u;
-  CHAR8   c;
-  UINTN   m;
-  UINTN   n;
+  UINTN   RetVal;
+  CHAR8   TempChar;
+  UINTN   MaxVal;
+  UINTN   ResteVal;
 
-  ASSERT (str != NULL);
+  ASSERT (Str != NULL);
 
-  m = (UINTN) -1 / 10;
-  n = (UINTN) -1 % 10;
+  MaxVal = (UINTN) -1 / 10;
+  ResteVal = (UINTN) -1 % 10;
   //
   // skip preceeding white space
   //
-  while (*str && *str == ' ') {
-    str += 1;
+  while (*Str && *Str == ' ') {
+    Str += 1;
   }
   //
   // convert digits
   //
-  u = 0;
-  c = *(str++);
-  while (c) {
-    if (c >= '0' && c <= '9') {
-      if (u > m || (u == m && c - '0' > (INTN) n)) {
+  RetVal = 0;
+  TempChar = *(Str++);
+  while (TempChar) {
+    if (TempChar >= '0' && TempChar <= '9') {
+      if (RetVal > MaxVal || (RetVal == MaxVal && TempChar - '0' > (INTN) ResteVal)) {
         return (UINTN) -1;
       }
 
-      u = (u * 10) + c - '0';
+      RetVal = (RetVal * 10) + TempChar - '0';
     } else {
       break;
     }
 
-    c = *(str++);
+    TempChar = *(Str++);
   }
 
-  return u;
+  return RetVal;
 }
 
 STATIC
 CHAR16
 UnicodeToUpper (
-- 
1.9.5.msysgit.1



  parent reply	other threads:[~2016-12-05  5:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05  5:27 [patch 0/5] MdeModulePkg/EbcDxe: Fix coding style issues Dandan Bi
2016-12-05  5:27 ` [patch 1/5] MdeModulePkg/EbcDxe: Make the comments align with EDKII coding style Dandan Bi
2016-12-05  5:27 ` [patch 2/5] MdeModulePkg/EbcDxe: Initialize variable after declaration Dandan Bi
2016-12-05  5:27 ` Dandan Bi [this message]
2016-12-05  5:27 ` [patch 4/5] MdeModulePkg/EbcDxe: Avoid Non-Boolean type used as Boolean Dandan Bi
2016-12-05  5:27 ` [patch 5/5] MdeModulePkg/EbcDxe: Add comments for functions Dandan Bi
2016-12-05 12:45 ` [patch 0/5] MdeModulePkg/EbcDxe: Fix coding style issues Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480915641-59136-4-git-send-email-dandan.bi@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox