[edk2] [PATCH 1/4] MdeModulePkg, NetworkPkg: Fix VS2017 IA32 warnings

Pete Batard posted 4 patches 7 years, 1 month ago
[edk2] [PATCH 1/4] MdeModulePkg, NetworkPkg: Fix VS2017 IA32 warnings
Posted by Pete Batard 7 years, 1 month ago
This is a preliminary patch before the introduction of VS2017 support.
Without this, IA32 compilation will produce the following warnings:
* warning C4701: potentially uninitialized local variable used
* warning C4703: potentially uninitialized local pointer variable used

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Pete Batard <pete@akeo.ie>
---
 MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c                                | 2 +-
 MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c | 2 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c                                        | 2 +-
 MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c                                              | 2 +-
 NetworkPkg/HttpBootDxe/HttpBootImpl.c                                                        | 2 +-
 NetworkPkg/HttpBootDxe/HttpBootSupport.c                                                     | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
index 17fc3db507d0..fdab07f9738c 100644
--- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
+++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
@@ -512,7 +512,7 @@ RequiredDriver (
   EFI_STATUS                  Status;
   UINT8                       ClassGuidNum;
   EFI_GUID                    *ClassGuid;
-  EFI_IFR_FORM_SET            *Buffer;
+  EFI_IFR_FORM_SET            *Buffer = NULL;
   UINTN                       BufferSize;
   UINT8                       *Ptr;
   UINTN                       TempSize;
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
index 6dd4fce13938..4ddfb0926dc2 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
@@ -308,7 +308,7 @@ IsRequiredDriver (
   EFI_STATUS                  Status;
   UINT8                       ClassGuidNum;
   EFI_GUID                    *ClassGuid;
-  EFI_IFR_FORM_SET            *Buffer;
+  EFI_IFR_FORM_SET            *Buffer = NULL;
   UINTN                       BufferSize;
   UINT8                       *Ptr;
   UINTN                       TempSize;
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index 646864f4dfc1..9e92ff5874b7 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -5307,7 +5307,7 @@ HiiConfigRoutingRouteConfig (
   EFI_STRING                          ConfigResp;
   UINTN                               Length;
   EFI_STATUS                          Status;
-  EFI_DEVICE_PATH_PROTOCOL            *DevicePath;
+  EFI_DEVICE_PATH_PROTOCOL            *DevicePath = NULL;
   EFI_DEVICE_PATH_PROTOCOL            *TempDevicePath;
   LIST_ENTRY                          *Link;
   HII_DATABASE_RECORD                 *Database;
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
index 31c2e3e5b849..04adae62572b 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
@@ -520,7 +520,7 @@ MnpTransmit (
   EFI_STATUS        Status;
   MNP_INSTANCE_DATA *Instance;
   MNP_SERVICE_DATA  *MnpServiceData;
-  UINT8             *PktBuf;
+  UINT8             *PktBuf = NULL;
   UINT32            PktLen;
   EFI_TPL           OldTpl;
 
diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
index 06a8a6a38615..2687696b0de1 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
@@ -121,7 +121,7 @@ HttpBootStart (
 {
   UINTN                Index;
   EFI_STATUS           Status;
-  CHAR8                *Uri;
+  CHAR8                *Uri = NULL;
   
 
   if (Private == NULL || FilePath == NULL) {
diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
index d508e2c1a979..787dd24e3c71 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
@@ -1199,7 +1199,7 @@ HttpBootCheckImageType (
 {
   EFI_STATUS            Status;
   EFI_HTTP_HEADER       *Header;
-  CHAR8                 *FilePath;
+  CHAR8                 *FilePath = NULL;
   CHAR8                 *FilePost;
 
   if (Uri == NULL || UriParser == NULL || ImageType == NULL) {
-- 
2.14.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel