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 <Alexei.Fedorov@arm.com>
cc: Ruiyu Ni <ruiyu.ni@intel.com>
cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
.../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
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Dandan, What is the reason for providing this patch addressing the same issues which were fixed by already reviewed patch sent on 13 July? See thread for https://lists.01.org/pipermail/edk2-devel/2018-July/027139.html Alexei ________________________________ From: Dandan Bi <dandan.bi@intel.com> Sent: 30 July 2018 03:27:02 To: edk2-devel@lists.01.org Cc: Alexei Fedorov; Ruiyu Ni; Jaben Carsey Subject: [patch 3/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS build failure 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 <Alexei.Fedorov@arm.com> cc: Ruiyu Ni <ruiyu.ni@intel.com> cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> --- .../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 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Hi Alexei, I didn't notice your patch before. So I create this patch along with others to fix all the build issues. And your patch which fix the build error seems not commit to edk2 code base. When do you plan to commit it? Hi all, Please review other patches in this series and ignore this one. Sorry for any inconvenience. Thanks, Dandan From: Alexei Fedorov [mailto:Alexei.Fedorov@arm.com] Sent: Monday, July 30, 2018 4:28 PM To: Bi, Dandan <dandan.bi@intel.com>; edk2-devel@lists.01.org Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Carsey, Jaben <jaben.carsey@intel.com> Subject: Re: [patch 3/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS build failure Dandan, What is the reason for providing this patch addressing the same issues which were fixed by already reviewed patch sent on 13 July? See thread for https://lists.01.org/pipermail/edk2-devel/2018-July/027139.html Alexei ________________________________ From: Dandan Bi <dandan.bi@intel.com<mailto:dandan.bi@intel.com>> Sent: 30 July 2018 03:27:02 To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> Cc: Alexei Fedorov; Ruiyu Ni; Jaben Carsey Subject: [patch 3/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS build failure 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 <Alexei.Fedorov@arm.com<mailto:Alexei.Fedorov@arm.com>> cc: Ruiyu Ni <ruiyu.ni@intel.com<mailto:ruiyu.ni@intel.com>> cc: Jaben Carsey <jaben.carsey@intel.com<mailto:jaben.carsey@intel.com>> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com<mailto:dandan.bi@intel.com>> --- .../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 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
© 2016 - 2025 Red Hat, Inc.