From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.2580.1583980007980041753 for ; Wed, 11 Mar 2020 19:26:48 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 19:26:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,543,1574150400"; d="scan'208";a="236662100" Received: from shwde7172.ccr.corp.intel.com ([10.239.158.67]) by orsmga008.jf.intel.com with ESMTP; 11 Mar 2020 19:26:46 -0700 From: "Liming Gao" To: devel@edk2.groups.io Cc: Laszlo Ersek , Ard Biesheuvel Subject: [Patch] OvmfPkg: Fix build failure with VS2015 tool chain Date: Thu, 12 Mar 2020 10:26:35 +0800 Message-Id: <20200312022635.718-1-liming.gao@intel.com> X-Mailer: git-send-email 2.24.1.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit warning C4244: '=': conversion from 'UINT64' to 'UINTN', possible loss of data With this fix, OvmfIa32, OvmfX64 and OvmfIa32X64 can pass build. Cc: Laszlo Ersek Cc: Ard Biesheuvel Signed-off-by: Liming Gao --- OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c | 2 +- OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c index 1868c9fcaf..e52ec668f3 100644 --- a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c +++ b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c @@ -384,7 +384,7 @@ QemuLoadKernelImage ( // // Drop the terminating NUL, convert to UTF-16. // - KernelLoadedImage->LoadOptionsSize = (CommandLineSize - 1) * 2; + KernelLoadedImage->LoadOptionsSize = (UINT32) ((CommandLineSize - 1) * 2); } QemuFwCfgSelectItem (QemuFwCfgItemInitrdSize); diff --git a/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c b/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c index 021b072826..da40c379a6 100644 --- a/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c +++ b/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c @@ -196,7 +196,7 @@ CacheInitrdFile ( ASSERT_EFI_ERROR (Status); } - mInitrdFileSize = FileSize; + mInitrdFileSize = (UINTN) FileSize; return EFI_SUCCESS; FreeMemory: -- 2.13.0.windows.1