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 4/5] MdeModulePkg/EbcDxe: Avoid Non-Boolean type used as Boolean
Date: Mon,  5 Dec 2016 13:27:20 +0800	[thread overview]
Message-ID: <1480915641-59136-5-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/EdbDisasm.c       | 130 ++++++++++-----------
 .../EbcDxe/EbcDebugger/EdbDisasmSupport.c          |   4 +-
 .../EbcDxe/EbcDebugger/EdbSupportString.c          |  44 +++----
 .../Universal/EbcDxe/EbcDebugger/EdbSupportUI.c    |  12 +-
 MdeModulePkg/Universal/EbcDxe/EbcExecute.c         |   4 +-
 5 files changed, 97 insertions(+), 97 deletions(-)

diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.c
index dab53a0..dddf782 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.c
@@ -192,22 +192,22 @@ EdbDisasmJMP (
 //    if (Modifiers & OPCODE_M_IMMDATA64) {
 //      EdbPrintInstructionName (L"64");
 //    } else {
 //      EdbPrintInstructionName (L"32");
 //    }
-    if (Modifiers & CONDITION_M_CONDITIONAL) {
-      if (Modifiers & JMP_M_CS) {
+    if ((Modifiers & CONDITION_M_CONDITIONAL) != 0) {
+      if ((Modifiers & JMP_M_CS) != 0) {
         EdbPrintInstructionName (L"cs");
       } else {
         EdbPrintInstructionName (L"cc");
       }
     }
 
     InstructionAddress += 2;
-    if (Modifiers & OPCODE_M_IMMDATA64) {
+    if ((Modifiers & OPCODE_M_IMMDATA64) != 0) {
       CopyMem (&Data64, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT64));
-      if (Modifiers & OPCODE_M_IMMDATA) {
+      if ((Modifiers & OPCODE_M_IMMDATA) != 0) {
         EdbPrintData64 (Data64);
       } else {
         return 0;
       }
     } else {
@@ -258,12 +258,12 @@ EdbDisasmJMP8 (
   //
   if (DisasmString != NULL) {
     *DisasmString = EdbPreInstructionString ();
 
     EdbPrintInstructionName (L"JMP8");
-    if (Modifiers & CONDITION_M_CONDITIONAL) {
-      if (Modifiers & JMP_M_CS) {
+    if ((Modifiers & CONDITION_M_CONDITIONAL) != 0) {
+      if ((Modifiers & JMP_M_CS) != 0) {
         EdbPrintInstructionName (L"cs");
       } else {
         EdbPrintInstructionName (L"cc");
       }
     }
@@ -320,31 +320,31 @@ EdbDisasmCALL (
 //    if (Modifiers & OPCODE_M_IMMDATA64) {
 //      EdbPrintInstructionName (L"64");
 //    } else {
 //      EdbPrintInstructionName (L"32");
 //    }
-    if (Operands & OPERAND_M_NATIVE_CALL) {
+    if ((Operands & OPERAND_M_NATIVE_CALL) != 0) {
       EdbPrintInstructionName (L"EX");
     }
 //    if ((Operands & OPERAND_M_RELATIVE_ADDR) == 0) {
 //      EdbPrintInstructionName (L"a");
 //    }
 
     InstructionAddress += 2;
-    if (Modifiers & OPCODE_M_IMMDATA64) {
+    if ((Modifiers & OPCODE_M_IMMDATA64) != 0) {
       CopyMem (&Data64, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT64));
       Ip = Data64;
-      if (Modifiers & OPCODE_M_IMMDATA) {
+      if ((Modifiers & OPCODE_M_IMMDATA) != 0) {
         Result = EdbFindAndPrintSymbol ((UINTN)Ip);
         if (Result == 0) {
           EdbPrintData64 (Data64);
         }
       } else {
         return 0;
       }
     } else {
-      if (Modifiers & OPCODE_M_IMMDATA) {
+      if ((Modifiers & OPCODE_M_IMMDATA) != 0) {
         CopyMem (&Data32, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT32));
       } else {
         Data32 = 0;
       }
 
@@ -353,24 +353,24 @@ EdbDisasmCALL (
       } else {
         Ip = GetRegisterValue (SystemContext, (Operands & OPERAND_M_OP1));
       }
 
       if ((Operands & OPERAND_M_INDIRECT1) == 0) {
-        if (Operands & OPERAND_M_RELATIVE_ADDR) {
+        if ((Operands & OPERAND_M_RELATIVE_ADDR) != 0) {
           Result = EdbFindAndPrintSymbol ((UINTN)(SavedInstructionAddress + Ip + Size));
         } else {
           Result = EdbFindAndPrintSymbol ((UINTN)Ip);
         }
         if (Result == 0) {
           EdbPrintRegister1 (Operands);
-          if (Modifiers & OPCODE_M_IMMDATA) {
+          if ((Modifiers & OPCODE_M_IMMDATA) != 0) {
             EdbPrintImmData32 (Data32);
           }
         }
       } else {
         EdbPrintRegister1 (Operands);
-        if (Modifiers & OPCODE_M_IMMDATA) {
+        if ((Modifiers & OPCODE_M_IMMDATA) != 0) {
           EdbPrintRawIndexData32 (Data32);
         }
       }
     }
 
@@ -451,11 +451,11 @@ EdbDisasmCMP (
     );
 
   Opcode     = GET_OPCODE (InstructionAddress);
   Modifiers  = GET_MODIFIERS (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
-  if (Modifiers & OPCODE_M_IMMDATA) {
+  if ((Modifiers & OPCODE_M_IMMDATA) != 0) {
     Size = 4;
   } else {
     Size = 2;
   }
 
@@ -493,13 +493,13 @@ EdbDisasmCMP (
     InstructionAddress += 2;
 
     EdbPrintComma ();
     EdbPrintRegister2 (Operands);
 
-    if (Modifiers & OPCODE_M_IMMDATA) {
+    if ((Modifiers & OPCODE_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
-      if (Operands & OPERAND_M_INDIRECT2) {
+      if ((Operands & OPERAND_M_INDIRECT2) != 0) {
         EdbPrintRawIndexData16 (Data16);
       } else {
         EdbPrintImmDatan (Data16);
       }
     }
@@ -550,11 +550,11 @@ EdbDisasmUnsignedDataManip (
     );
 
   Opcode     = GET_OPCODE (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
   Modifiers  = GET_MODIFIERS (InstructionAddress);
-  if (Modifiers & DATAMANIP_M_IMMDATA) {
+  if ((Modifiers & DATAMANIP_M_IMMDATA) != 0) {
     Size = 4;
   } else {
     Size = 2;
   }
 
@@ -611,13 +611,13 @@ EdbDisasmUnsignedDataManip (
     EdbPrintRegister1 (Operands);
     EdbPrintComma ();
     EdbPrintRegister2 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & DATAMANIP_M_IMMDATA) {
+    if ((Modifiers & DATAMANIP_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
-      if (Operands & OPERAND_M_INDIRECT2) {
+      if ((Operands & OPERAND_M_INDIRECT2) != 0) {
         EdbPrintRawIndexData16 (Data16);
       } else {
         EdbPrintImmDatan (Data16);
       }
     }
@@ -663,11 +663,11 @@ EdbDisasmSignedDataManip (
     );
 
   Opcode     = GET_OPCODE (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
   Modifiers  = GET_MODIFIERS (InstructionAddress);
-  if (Modifiers & DATAMANIP_M_IMMDATA) {
+  if ((Modifiers & DATAMANIP_M_IMMDATA) != 0) {
     Size = 4;
   } else {
     Size = 2;
   }
 
@@ -709,13 +709,13 @@ EdbDisasmSignedDataManip (
     EdbPrintRegister1 (Operands);
     EdbPrintComma ();
     EdbPrintRegister2 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & DATAMANIP_M_IMMDATA) {
+    if ((Modifiers & DATAMANIP_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
-      if (Operands & OPERAND_M_INDIRECT2) {
+      if ((Operands & OPERAND_M_INDIRECT2) != 0) {
         EdbPrintRawIndexData16 (Data16);
       } else {
         EdbPrintImmDatan (Data16);
       }
     }
@@ -768,30 +768,30 @@ EdbDisasmMOVxx (
 
   Opcode     = GET_OPCODE (InstructionAddress);
   Modifiers  = GET_MODIFIERS (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
   Size = 2;
-  if (Modifiers & (OPCODE_M_IMMED_OP1 | OPCODE_M_IMMED_OP2)) {
+  if ((Modifiers & (OPCODE_M_IMMED_OP1 | OPCODE_M_IMMED_OP2)) != 0) {
     if ((Opcode <= OPCODE_MOVQW) || (Opcode == OPCODE_MOVNW)) {
-      if (Modifiers & OPCODE_M_IMMED_OP1) {
+      if ((Modifiers & OPCODE_M_IMMED_OP1) != 0) {
         Size += 2;
       }
-      if (Modifiers & OPCODE_M_IMMED_OP2) {
+      if ((Modifiers & OPCODE_M_IMMED_OP2) != 0) {
         Size += 2;
       }
-    } else if ((Opcode <= OPCODE_MOVQD) || (Opcode == OPCODE_MOVND)) {
-      if (Modifiers & OPCODE_M_IMMED_OP1) {
+    } else if (((Opcode <= OPCODE_MOVQD) || (Opcode == OPCODE_MOVND)) != 0) {
+      if ((Modifiers & OPCODE_M_IMMED_OP1) != 0) {
         Size += 4;
       }
-      if (Modifiers & OPCODE_M_IMMED_OP2) {
+      if ((Modifiers & OPCODE_M_IMMED_OP2) != 0) {
         Size += 4;
       }
     } else if (Opcode == OPCODE_MOVQQ) {
-      if (Modifiers & OPCODE_M_IMMED_OP1) {
+      if ((Modifiers & OPCODE_M_IMMED_OP1) != 0) {
         Size += 8;
       }
-      if (Modifiers & OPCODE_M_IMMED_OP2) {
+      if ((Modifiers & OPCODE_M_IMMED_OP2) != 0) {
         Size += 8;
       }
     }
   }
 
@@ -839,11 +839,11 @@ EdbDisasmMOVxx (
     }
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & OPCODE_M_IMMED_OP1) {
+    if ((Modifiers & OPCODE_M_IMMED_OP1) != 0) {
       if ((Opcode <= OPCODE_MOVQW) || (Opcode == OPCODE_MOVNW)) {
         CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
         InstructionAddress += 2;
         EdbPrintRawIndexData16 (Data16);
       } else if ((Opcode <= OPCODE_MOVQD) || (Opcode == OPCODE_MOVND)) {
@@ -858,11 +858,11 @@ EdbDisasmMOVxx (
     }
 
     EdbPrintComma ();
     EdbPrintRegister2 (Operands);
 
-    if (Modifiers & OPCODE_M_IMMED_OP2) {
+    if ((Modifiers & OPCODE_M_IMMED_OP2) != 0) {
       if ((Opcode <= OPCODE_MOVQW) || (Opcode == OPCODE_MOVNW)) {
         CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
         EdbPrintRawIndexData16 (Data16);
       } else if ((Opcode <= OPCODE_MOVQD) || (Opcode == OPCODE_MOVND)) {
         CopyMem (&Data32, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT32));
@@ -905,14 +905,14 @@ EdbDisasmMOVsnw (
   ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_MOVSNW);
 
   Modifiers  = GET_MODIFIERS (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
   Size = 2;
-  if (Modifiers & OPCODE_M_IMMED_OP1) {
+  if ((Modifiers & OPCODE_M_IMMED_OP1) != 0) {
     Size += 2;
   }
-  if (Modifiers & OPCODE_M_IMMED_OP2) {
+  if ((Modifiers & OPCODE_M_IMMED_OP2) != 0) {
     Size += 2;
   }
 
   //
   // Construct Disasm String
@@ -923,22 +923,22 @@ EdbDisasmMOVsnw (
     EdbPrintInstructionName (L"MOVsnw");
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & OPCODE_M_IMMED_OP1) {
+    if ((Modifiers & OPCODE_M_IMMED_OP1) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
       InstructionAddress += 2;
       EdbPrintRawIndexData16 (Data16);
     }
 
     EdbPrintComma ();
     EdbPrintRegister2 (Operands);
 
-    if (Modifiers & OPCODE_M_IMMED_OP2) {
+    if ((Modifiers & OPCODE_M_IMMED_OP2) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
-      if (Operands & OPERAND_M_INDIRECT2) {
+      if ((Operands & OPERAND_M_INDIRECT2) != 0) {
         EdbPrintRawIndexData16 (Data16);
       } else {
         EdbPrintImmDatan (Data16);
       }
     }
@@ -975,14 +975,14 @@ EdbDisasmMOVsnd (
   ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_MOVSND);
 
   Modifiers  = GET_MODIFIERS (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
   Size = 2;
-  if (Modifiers & OPCODE_M_IMMED_OP1) {
+  if ((Modifiers & OPCODE_M_IMMED_OP1) != 0) {
     Size += 4;
   }
-  if (Modifiers & OPCODE_M_IMMED_OP2) {
+  if ((Modifiers & OPCODE_M_IMMED_OP2) != 0) {
     Size += 4;
   }
 
   //
   // Construct Disasm String
@@ -993,22 +993,22 @@ EdbDisasmMOVsnd (
     EdbPrintInstructionName (L"MOVsnd");
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & OPCODE_M_IMMED_OP1) {
+    if ((Modifiers & OPCODE_M_IMMED_OP1) != 0) {
       CopyMem (&Data32, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT32));
       InstructionAddress += 4;
       EdbPrintRawIndexData32 (Data32);
     }
 
     EdbPrintComma ();
     EdbPrintRegister2 (Operands);
 
-    if (Modifiers & OPCODE_M_IMMED_OP2) {
+    if ((Modifiers & OPCODE_M_IMMED_OP2) != 0) {
       CopyMem (&Data32, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT32));
-      if (Operands & OPERAND_M_INDIRECT2) {
+      if ((Operands & OPERAND_M_INDIRECT2) != 0) {
         EdbPrintRawIndexData32 (Data32);
       } else {
         EdbPrintImmDatan (Data32);
       }
     }
@@ -1129,11 +1129,11 @@ EdbDisasmPUSH (
 
   ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_PUSH);
 
   Operands   = GET_OPERANDS (InstructionAddress);
   Modifiers  = GET_MODIFIERS (InstructionAddress);
-  if (Modifiers & PUSHPOP_M_IMMDATA) {
+  if ((Modifiers & PUSHPOP_M_IMMDATA) != 0) {
     Size = 4;
   } else {
     Size = 2;
   }
 
@@ -1151,13 +1151,13 @@ EdbDisasmPUSH (
 //    }
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & PUSHPOP_M_IMMDATA) {
+    if ((Modifiers & PUSHPOP_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
-      if (Operands & OPERAND_M_INDIRECT1) {
+      if ((Operands & OPERAND_M_INDIRECT1) != 0) {
         EdbPrintRawIndexData16 (Data16);
       } else {
         EdbPrintImmDatan (Data16);
       }
     }
@@ -1193,11 +1193,11 @@ EdbDisasmPOP (
 
   ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_POP);
 
   Operands   = GET_OPERANDS (InstructionAddress);
   Modifiers  = GET_MODIFIERS (InstructionAddress);
-  if (Modifiers & PUSHPOP_M_IMMDATA) {
+  if ((Modifiers & PUSHPOP_M_IMMDATA) != 0) {
     Size = 4;
   } else {
     Size = 2;
   }
 
@@ -1215,13 +1215,13 @@ EdbDisasmPOP (
 //    }
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & PUSHPOP_M_IMMDATA) {
+    if ((Modifiers & PUSHPOP_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
-      if (Operands & OPERAND_M_INDIRECT1) {
+      if ((Operands & OPERAND_M_INDIRECT1) != 0) {
         EdbPrintRawIndexData16 (Data16);
       } else {
         EdbPrintImmDatan (Data16);
       }
     }
@@ -1272,14 +1272,14 @@ EdbDisasmCMPI (
   if ((Operands & 0xE0) != 0) {
     return 0;
   }
 
   Size = 2;
-  if (Operands & OPERAND_M_CMPI_INDEX) {
+  if ((Operands & OPERAND_M_CMPI_INDEX) != 0) {
     Size += 2;
   }
-  if (Modifiers & OPCODE_M_CMPI32_DATA) {
+  if ((Modifiers & OPCODE_M_CMPI32_DATA) != 0) {
     Size += 4;
   } else {
     Size += 2;
   }
 
@@ -1293,11 +1293,11 @@ EdbDisasmCMPI (
 //    if (Modifiers & OPCODE_M_CMPI64) {
 //      EdbPrintInstructionName (L"64");
 //    } else {
 //      EdbPrintInstructionName (L"32");
 //    }
-    if (Modifiers & OPCODE_M_CMPI32_DATA) {
+    if ((Modifiers & OPCODE_M_CMPI32_DATA) != 0) {
       EdbPrintInstructionName (L"d");
     } else {
       EdbPrintInstructionName (L"w");
     }
     switch (Opcode) {
@@ -1319,19 +1319,19 @@ EdbDisasmCMPI (
     }
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Operands & OPERAND_M_CMPI_INDEX) {
+    if ((Operands & OPERAND_M_CMPI_INDEX) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
       InstructionAddress += 2;
       EdbPrintRawIndexData16 (Data16);
     }
 
     EdbPrintComma ();
 
-    if (Modifiers & OPCODE_M_CMPI32_DATA) {
+    if ((Modifiers & OPCODE_M_CMPI32_DATA) != 0) {
       CopyMem (&Data32, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT32));
       EdbPrintDatan (Data32);
     } else {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
       EdbPrintDatan (Data16);
@@ -1368,11 +1368,11 @@ EdbDisasmPUSHn (
 
   ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_PUSHN);
 
   Operands   = GET_OPERANDS (InstructionAddress);
   Modifiers  = GET_MODIFIERS (InstructionAddress);
-  if (Modifiers & PUSHPOP_M_IMMDATA) {
+  if ((Modifiers & PUSHPOP_M_IMMDATA) != 0) {
     Size = 4;
   } else {
     Size = 2;
   }
 
@@ -1385,13 +1385,13 @@ EdbDisasmPUSHn (
     EdbPrintInstructionName (L"PUSHn");
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & PUSHPOP_M_IMMDATA) {
+    if ((Modifiers & PUSHPOP_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
-      if (Operands & OPERAND_M_INDIRECT1) {
+      if ((Operands & OPERAND_M_INDIRECT1) != 0) {
         EdbPrintRawIndexData16 (Data16);
       } else {
         EdbPrintImmDatan (Data16);
       }
     }
@@ -1427,11 +1427,11 @@ EdbDisasmPOPn (
 
   ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_POPN);
 
   Operands   = GET_OPERANDS (InstructionAddress);
   Modifiers  = GET_MODIFIERS (InstructionAddress);
-  if (Modifiers & PUSHPOP_M_IMMDATA) {
+  if ((Modifiers & PUSHPOP_M_IMMDATA) != 0) {
     Size = 4;
   } else {
     Size = 2;
   }
 
@@ -1444,13 +1444,13 @@ EdbDisasmPOPn (
     EdbPrintInstructionName (L"POPn");
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Modifiers & PUSHPOP_M_IMMDATA) {
+    if ((Modifiers & PUSHPOP_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
-      if (Operands & OPERAND_M_INDIRECT1) {
+      if ((Operands & OPERAND_M_INDIRECT1) != 0) {
         EdbPrintRawIndexData16 (Data16);
       } else {
         EdbPrintImmDatan (Data16);
       }
     }
@@ -1489,11 +1489,11 @@ EdbDisasmMOVI (
   ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_MOVI);
 
   Modifiers  = GET_MODIFIERS (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
 
-  if (Operands & MOVI_M_IMMDATA) {
+  if ((Operands & MOVI_M_IMMDATA) != 0) {
     Size    = 4;
   } else {
     Size    = 2;
   }
   if ((Modifiers & MOVI_M_DATAWIDTH) == MOVI_DATAWIDTH16) {
@@ -1538,11 +1538,11 @@ EdbDisasmMOVI (
     }
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Operands & MOVI_M_IMMDATA) {
+    if ((Operands & MOVI_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
       InstructionAddress += 2;
       EdbPrintRawIndexData16 (Data16);
     }
 
@@ -1597,11 +1597,11 @@ EdbDisasmMOVIn (
   ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_MOVIN);
 
   Modifiers  = GET_MODIFIERS (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
 
-  if (Operands & MOVI_M_IMMDATA) {
+  if ((Operands & MOVI_M_IMMDATA) != 0) {
     Size    = 4;
   } else {
     Size    = 2;
   }
   if ((Modifiers & MOVI_M_DATAWIDTH) == MOVI_DATAWIDTH16) {
@@ -1632,11 +1632,11 @@ EdbDisasmMOVIn (
     }
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Operands & MOVI_M_IMMDATA) {
+    if ((Operands & MOVI_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
       InstructionAddress += 2;
       EdbPrintRawIndexData16 (Data16);
     }
 
@@ -1694,11 +1694,11 @@ EdbDisasmMOVREL (
   SavedInstructionAddress = InstructionAddress;
 
   Modifiers  = GET_MODIFIERS (InstructionAddress);
   Operands   = GET_OPERANDS (InstructionAddress);
 
-  if (Operands & MOVI_M_IMMDATA) {
+  if ((Operands & MOVI_M_IMMDATA) != 0) {
     Size    = 4;
   } else {
     Size    = 2;
   }
   if ((Modifiers & MOVI_M_DATAWIDTH) == MOVI_DATAWIDTH16) {
@@ -1731,11 +1731,11 @@ EdbDisasmMOVREL (
     }
 
     EdbPrintRegister1 (Operands);
 
     InstructionAddress += 2;
-    if (Operands & MOVI_M_IMMDATA) {
+    if ((Operands & MOVI_M_IMMDATA) != 0) {
       CopyMem (&Data16, (VOID *)(UINTN)(InstructionAddress), sizeof(UINT16));
       InstructionAddress += 2;
       EdbPrintRawIndexData16 (Data16);
     }
 
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c
index 0108870..2e001a4 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c
@@ -268,11 +268,11 @@ EdbPrintInstructionName (
 UINTN
 EdbPrintRegister1 (
   IN UINT8                  Operands
   )
 {
-  if (Operands & OPERAND_M_INDIRECT1) {
+  if ((Operands & OPERAND_M_INDIRECT1) != 0) {
     EDBSPrintWithOffset (
       mInstructionString.Content,
       EDB_INSTRUCTION_CONTENT_MAX_SIZE,
       mInstructionContentOffset,
       L"@"
@@ -303,11 +303,11 @@ EdbPrintRegister1 (
 UINTN
 EdbPrintRegister2 (
   IN UINT8                  Operands
   )
 {
-  if (Operands & OPERAND_M_INDIRECT2) {
+  if ((Operands & OPERAND_M_INDIRECT2) != 0) {
     EDBSPrintWithOffset (
       mInstructionString.Content,
       EDB_INSTRUCTION_CONTENT_MAX_SIZE,
       mInstructionContentOffset,
       L"@"
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c
index 1a396a4..bb0626f 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c
@@ -35,31 +35,31 @@ Xtoi (
 
   MaxVal = (UINTN) -1 >> 4;
   //
   // skip preceeding white space
   //
-  while (*Str && *Str == ' ') {
+  while (*Str != '\0' && *Str == ' ') {
     Str += 1;
   }
   //
   // skip preceeding zeros
   //
-  while (*Str && *Str == '0') {
+  while (*Str != '\0' && *Str == '0') {
     Str += 1;
   }
   //
   // skip preceeding white space
   //
-  if (*Str && (*Str == 'x' || *Str == 'X')) {
+  if (*Str != '\0' && (*Str == 'x' || *Str == 'X')) {
     Str += 1;
   }
   //
   // convert hex digits
   //
   RetVal = 0;
   TempChar = *(Str++);
-  while (TempChar) {
+  while (TempChar != '\0') {
     if (TempChar >= 'a' && TempChar <= 'f') {
       TempChar -= 'a' - 'A';
     }
 
     if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
@@ -100,31 +100,31 @@ LXtoi (
 
   MaxVal = RShiftU64 ((UINT64) -1, 4);
   //
   // skip preceeding white space
   //
-  while (*Str && *Str == ' ') {
+  while (*Str != '\0' && *Str == ' ') {
     Str += 1;
   }
   //
   // skip preceeding zeros
   //
-  while (*Str && *Str == '0') {
+  while (*Str != '\0' && *Str == '0') {
     Str += 1;
   }
   //
   // skip preceeding white space
   //
-  if (*Str && (*Str == 'x' || *Str == 'X')) {
+  if (*Str != '\0' && (*Str == 'x' || *Str == 'X')) {
     Str += 1;
   }
   //
   // convert hex digits
   //
   RetVal = 0;
   TempChar = *(Str++);
-  while (TempChar) {
+  while (TempChar != '\0') {
     if (TempChar >= 'a' && TempChar <= 'f') {
       TempChar -= 'a' - 'A';
     }
 
     if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
@@ -167,19 +167,19 @@ Atoi (
   MaxVal = (UINTN) -1 / 10;
   ResteVal = (UINTN) -1 % 10;
   //
   // skip preceeding white space
   //
-  while (*Str && *Str == ' ') {
+  while (*Str != '\0' && *Str == ' ') {
     Str += 1;
   }
   //
   // convert digits
   //
   RetVal = 0;
   TempChar = *(Str++);
-  while (TempChar) {
+  while (TempChar != '\0') {
     if (TempChar >= '0' && TempChar <= '9') {
       if (RetVal > MaxVal || (RetVal == MaxVal && TempChar - '0' > (INTN) ResteVal)) {
         return (UINTN) -1;
       }
 
@@ -215,31 +215,31 @@ AsciiXtoi (
 
   MaxVal = (UINTN) -1 >> 4;
   //
   // skip preceeding white space
   //
-  while (*Str && *Str == ' ') {
+  while (*Str != '\0' && *Str == ' ') {
     Str += 1;
   }
   //
   // skip preceeding zeros
   //
-  while (*Str && *Str == '0') {
+  while (*Str != '\0' && *Str == '0') {
     Str += 1;
   }
   //
   // skip preceeding white space
   //
-  if (*Str && (*Str == 'x' || *Str == 'X')) {
+  if (*Str != '\0' && (*Str == 'x' || *Str == 'X')) {
     Str += 1;
   }
   //
   // convert hex digits
   //
   RetVal = 0;
   TempChar = *(Str++);
-  while (TempChar) {
+  while (TempChar != '\0') {
     if (TempChar >= 'a' && TempChar <= 'f') {
       TempChar -= 'a' - 'A';
     }
 
     if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
@@ -281,19 +281,19 @@ AsciiAtoi (
   MaxVal = (UINTN) -1 / 10;
   ResteVal = (UINTN) -1 % 10;
   //
   // skip preceeding white space
   //
-  while (*Str && *Str == ' ') {
+  while (*Str != '\0' && *Str == ' ') {
     Str += 1;
   }
   //
   // convert digits
   //
   RetVal = 0;
   TempChar = *(Str++);
-  while (TempChar) {
+  while (TempChar != '\0') {
     if (TempChar >= '0' && TempChar <= '9') {
       if (RetVal > MaxVal || (RetVal == MaxVal && TempChar - '0' > (INTN) ResteVal)) {
         return (UINTN) -1;
       }
 
@@ -343,11 +343,11 @@ EFIAPI
 StrCmpUnicodeAndAscii (
   IN CHAR16   *String,
   IN CHAR8    *String2
   )
 {
-  while (*String) {
+  while (*String != '\0') {
     if (*String != (CHAR16)*String2) {
       break;
     }
 
     String += 1;
@@ -461,11 +461,11 @@ StrDuplicate (
   CHAR16      *Dest;
   UINTN       Size;
 
   Size = (StrLen(Src) + 1) * sizeof(CHAR16);
   Dest = AllocateZeroPool (Size);
-  if (Dest) {
+  if (Dest != NULL) {
     CopyMem (Dest, Src, Size);
   }
   return Dest;
 }
 
@@ -676,11 +676,11 @@ PatchForStrTokenAfter (
   while (*Str != 0) {
     Str ++;
   }
   *Str = Patch;
 
-  while (*(Str ++)) {
+  while (*(Str ++) != '\0') {
     if (*Str == 0) {
       *Str = Patch;
     } else {
       break;
     }
@@ -701,11 +701,11 @@ PatchForStrTokenBefore (
   if (Buffer == NULL) {
     return ;
   }
 
   Str = Buffer;
-  while (*(Str --)) {
+  while (*(Str --) != '\0') {
     if ((*Str == 0) || (*Str == Patch)) {
       *Str = Patch;
     } else {
       break;
     }
@@ -918,11 +918,11 @@ PatchForAsciiStrTokenAfter (
   while (*Str != 0) {
     Str ++;
   }
   *Str = Patch;
 
-  while (*(Str ++)) {
+  while (*(Str ++) != '\0') {
     if (*Str == 0) {
       *Str = Patch;
     } else {
       break;
     }
@@ -943,11 +943,11 @@ PatchForAsciiStrTokenBefore (
   if (Buffer == NULL) {
     return ;
   }
 
   Str = Buffer;
-  while (*(Str --)) {
+  while (*(Str --) != '\0') {
     if ((*Str == 0) || (*Str == Patch)) {
       *Str = Patch;
     } else {
       break;
     }
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c
index 42d8086..21d0dc9 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c
@@ -48,11 +48,11 @@ WaitForSingleEvent (
   EFI_STATUS  Status;
   UINTN       Index;
   EFI_EVENT   TimerEvent;
   EFI_EVENT   WaitList[2];
 
-  if (Timeout) {
+  if (Timeout != 0) {
     //
     // Create a timer event
     //
     Status = gBS->CreateEvent (EVT_TIMER, 0, NULL, NULL, &TimerEvent);
     if (!EFI_ERROR (Status)) {
@@ -202,11 +202,11 @@ Input (
 
   ASSERT (ConOut != NULL);
   ASSERT (ConIn != NULL);
   ASSERT (InStr != NULL);
 
-  if (Prompt) {
+  if (Prompt != NULL) {
     ConOut->OutputString (ConOut, Prompt);
   }
   //
   // Read a line from the console
   //
@@ -253,11 +253,11 @@ Input (
       TailColumn  = (Len - StrPos + Column) % LineLength;
       Done        = TRUE;
       break;
 
     case CHAR_BACKSPACE:
-      if (StrPos) {
+      if (StrPos != 0) {
         //
         // If not move back beyond string beginning, move all characters behind
         // the current position one character forward
         //
         StrPos -= 1;
@@ -305,11 +305,11 @@ Input (
       switch (Key.ScanCode) {
       case SCAN_DELETE:
         //
         // Move characters behind current position one character forward
         //
-        if (Len) {
+        if (Len != 0) {
           Update  = StrPos;
           Delete  = 1;
           CopyMem (InStr + StrPos, InStr + StrPos + 1, sizeof (CHAR16) * (Len - StrPos));
 
           NeedAdjust = TRUE;
@@ -318,11 +318,11 @@ Input (
 
       case SCAN_LEFT:
         //
         // Adjust current cursor position
         //
-        if (StrPos) {
+        if (StrPos != 0) {
           StrPos -= 1;
           ConMoveCursorBackward (LineLength, &Column, &Row);
         }
         break;
 
@@ -445,11 +445,11 @@ Input (
         NeedAdjust = FALSE;
       }
       EDBPrint (InStr + Update);
       Len = StrLen (InStr);
 
-      if (Delete) {
+      if (Delete != 0) {
         SetMem (InStr + Len, Delete * sizeof (CHAR16), 0x00);
       }
 
       if (StrPos > Len) {
         StrPos = Len;
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
index a4c51e9..e5d290a 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
@@ -2985,11 +2985,11 @@ ExecuteCALL (
   // Get opcode and operands
   //
   Opcode    = GETOPCODE (VmPtr);
   Operands  = GETOPERANDS (VmPtr);
 
-  if (Operands & OPERAND_M_NATIVE_CALL) {
+  if ((Operands & OPERAND_M_NATIVE_CALL) != 0) {
     EbcDebuggerHookCALLEXStart (VmPtr);
   } else {
     EbcDebuggerHookCALLStart (VmPtr);
   }
 
@@ -3092,11 +3092,11 @@ ExecuteCALL (
         EbcLLCALLEX (VmPtr, (UINTN) Immed64, (UINTN) VmPtr->Gpr[0], FramePtr, Size);
       }
     }
   }
 
-  if (Operands & OPERAND_M_NATIVE_CALL) {
+  if ((Operands & OPERAND_M_NATIVE_CALL) != 0) {
     EbcDebuggerHookCALLEXEnd (VmPtr);
   } else {
     EbcDebuggerHookCALLEnd (VmPtr);
   }
 
-- 
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 ` [patch 3/5] MdeModulePkg/EbcDxe: Make the variable name follow rules Dandan Bi
2016-12-05  5:27 ` Dandan Bi [this message]
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-5-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