From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 E8EA9210C5145 for ; Sun, 29 Jul 2018 19:27:33 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2018 19:27:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,421,1526367600"; d="scan'208";a="68512556" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by FMSMGA003.fm.intel.com with ESMTP; 29 Jul 2018 19:27:32 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Alexei Fedorov , Ruiyu Ni , Jaben Carsey Date: Mon, 30 Jul 2018 10:27:02 +0800 Message-Id: <20180730022703.101708-4-dandan.bi@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 In-Reply-To: <20180730022703.101708-1-dandan.bi@intel.com> References: <20180730022703.101708-1-dandan.bi@intel.com> Subject: [patch 3/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS build failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 02:27:34 -0000 Fix following warnings: 1. xxx\GtdtParser.c(179): warning C4244: '=': conversion from 'UINT32' to 'UINT16', possible loss of data xxx\GtdtParser.c(180): warning C4244: '-=': conversion from 'UINT32' to 'UINT16', possible loss of data xxx\GtdtParser.c(196): warning C4244: '-=': conversion from 'UINT32' to 'UINT16', possible loss of data 2. xxx\XsdtParser.c(99): warning C4457: declaration of 'Ptr' hides function parameter cc: Alexei Fedorov cc: Ruiyu Ni cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- .../UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c | 6 +++--- .../UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c index 3a3cee948a..d5671081da 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c @@ -174,12 +174,12 @@ DumpGTBlock ( "GT Block", Ptr, Length, PARSER_PARAMS (GtBlockParser) ); - GTBlockTimerLength = (*GtBlockLength - Offset) / (*GtBlockTimerCount); - Length -= Offset; + GTBlockTimerLength = (*GtBlockLength - (UINT16)Offset) / (UINT16)(*GtBlockTimerCount); + Length -= (UINT16)Offset; if (*GtBlockTimerCount != 0) { Ptr += (*GtBlockTimerOffset); Index = 0; while ((Index < (*GtBlockTimerCount)) && (Length >= GTBlockTimerLength)) { @@ -191,11 +191,11 @@ DumpGTBlock ( GTBlockTimerLength, PARSER_PARAMS (GtBlockTimerParser) ); // Increment by GT Block Timer structure size Ptr += Offset; - Length -= Offset; + Length -= (UINT16)Offset; Index++; } if (Length != 0) { IncrementErrorCount (); diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c index 99521cd67a..341a61b8fb 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c @@ -63,10 +63,11 @@ ParseAcpiXsdt ( UINT32 Offset; UINT32 TableOffset; UINT64* TablePointer; UINTN EntryIndex; CHAR16 Buffer[32]; + UINT8* Pointer; // Parse the ACPI header to get the length ParseAcpi ( FALSE, 0, @@ -94,30 +95,29 @@ ParseAcpiXsdt ( CONST UINT32* Signature; CONST UINT32* Length; CONST UINT8* Revision; if ((UINT64*)(UINTN)(*TablePointer) != NULL) { - UINT8* Ptr; ParseAcpiHeader ( (UINT8*)(UINTN)(*TablePointer), &Signature, &Length, &Revision ); - Ptr = (UINT8*)Signature; + Pointer = (UINT8*)Signature; UnicodeSPrint ( Buffer, sizeof (Buffer), L"Entry[%d] - %c%c%c%c", EntryIndex++, - Ptr[0], - Ptr[1], - Ptr[2], - Ptr[3] + Pointer[0], + Pointer[1], + Pointer[2], + Pointer[3] ); } else { UnicodeSPrint ( Buffer, sizeof (Buffer), -- 2.14.3.windows.1