From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AE9AD81FE4 for ; Sun, 4 Dec 2016 21:27:57 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 04 Dec 2016 21:27:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,303,1477983600"; d="scan'208";a="13634175" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga002.jf.intel.com with ESMTP; 04 Dec 2016 21:27:56 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Jiewen Yao , Pete Batard Date: Mon, 5 Dec 2016 13:27:20 +0800 Message-Id: <1480915641-59136-5-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1480915641-59136-1-git-send-email-dandan.bi@intel.com> References: <1480915641-59136-1-git-send-email-dandan.bi@intel.com> Subject: [patch 4/5] MdeModulePkg/EbcDxe: Avoid Non-Boolean type used as Boolean X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 05:27:57 -0000 Cc: Jiewen Yao Cc: Pete Batard Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- .../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