]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/PciHostBridgeLib: silence IA32 VS2015x86 warnings
authorLaszlo Ersek <lersek@redhat.com>
Thu, 14 Jul 2016 15:34:38 +0000 (17:34 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Mon, 18 Jul 2016 17:23:22 +0000 (19:23 +0200)
When compiling "OvmfPkg\Library\PciHostBridgeLib\XenSupport.c" for IA32,
the VS2015x86 compiler emits the following:

> XenSupport.c(41): error C2220: warning treated as error - no 'object'
>                                file generated
> XenSupport.c(41): warning C4244: 'function': conversion from 'UINT64' to
>                                  'UINTN', possible loss of data
> XenSupport.c(48): warning C4244: 'function': conversion from 'UINT64' to
>                                  'UINTN', possible loss of data
> XenSupport.c(49): warning C4244: 'function': conversion from 'UINT64' to
>                                  'UINTN', possible loss of data
> XenSupport.c(50): warning C4244: 'function': conversion from 'UINT64' to
>                                  'UINTN', possible loss of data
> XenSupport.c(222): warning C4244: 'function': conversion from 'UINT64'
>                                   to 'UINTN', possible loss of data
> XenSupport.c(241): warning C4244: 'function': conversion from 'UINT64'
>                                   to 'UINTN', possible loss of data

PciLib functions take UINTN addresses that were encoded with the
PCI_LIB_ADDRESS() macro. We carry addresses from the macro invocations to
the function calls in two UINT64 variables however. This loses no data,
but it alerts VS2015x86. Change the variable types to UINTN.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
OvmfPkg/Library/PciHostBridgeLib/XenSupport.c

index 21896637e051a1c2f4ef5348ef741289ec6b02f4..31c63ae19e0aed84e274018b76af193a76eb8a50 100644 (file)
@@ -30,7 +30,7 @@
 STATIC\r
 VOID\r
 PcatPciRootBridgeBarExisted (\r
-  IN  UINT64                         Address,\r
+  IN  UINT                         Address,\r
   OUT UINT32                         *OriginalValue,\r
   OUT UINT32                         *Value\r
   )\r
@@ -180,7 +180,7 @@ ScanForRootBridges (
   UINT8      Device;\r
   UINT8      Function;\r
   UINTN      NumberOfDevices;\r
-  UINT64     Address;\r
+  UINT     Address;\r
   PCI_TYPE01 Pci;\r
   UINT64     Attributes;\r
   UINT64     Base;\r