OvmfPkg/Xen: Fix VS2019 build issues

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3722

Fix VS2019 NOOPT build issues related to converting
a larger integer value to a smaller integer value.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien@xen.org>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
This commit is contained in:
Michael D Kinney 2021-11-08 08:10:56 -08:00 committed by mergify[bot]
parent 22c3b5a865
commit a92559671a
3 changed files with 8 additions and 8 deletions

View File

@ -53,9 +53,9 @@ EpochToEfiTime (
m = (((da * 5) + 308) / 153) - 2; m = (((da * 5) + 308) / 153) - 2;
d = da - (((m + 4) * 153) / 5) + 122; d = da - (((m + 4) * 153) / 5) + 122;
Time->Year = y - 4800 + ((m + 2) / 12); Time->Year = (UINT16)(y - 4800 + ((m + 2) / 12));
Time->Month = ((m + 2) % 12) + 1; Time->Month = ((m + 2) % 12) + 1;
Time->Day = d + 1; Time->Day = (UINT8)(d + 1);
ss = EpochSeconds % 60; ss = EpochSeconds % 60;
a = (EpochSeconds - ss) / 60; a = (EpochSeconds - ss) / 60;
@ -63,9 +63,9 @@ EpochToEfiTime (
b = (a - mm) / 60; b = (a - mm) / 60;
hh = b % 24; hh = b % 24;
Time->Hour = hh; Time->Hour = (UINT8)hh;
Time->Minute = mm; Time->Minute = (UINT8)mm;
Time->Second = ss; Time->Second = (UINT8)ss;
Time->Nanosecond = 0; Time->Nanosecond = 0;
} }

View File

@ -154,7 +154,7 @@ GetSystemMemorySizeBelow4gb (
HighestAddress = GetHighestSystemMemoryAddress (TRUE); HighestAddress = GetHighestSystemMemoryAddress (TRUE);
ASSERT (HighestAddress > 0 && HighestAddress <= BASE_4GB); ASSERT (HighestAddress > 0 && HighestAddress <= BASE_4GB);
return HighestAddress; return (UINT32)HighestAddress;
} }
// //

View File

@ -165,7 +165,7 @@ TimerDriverSetTimerPeriod (
{ {
UINT64 TimerCount; UINT64 TimerCount;
UINT32 TimerFrequency; UINT32 TimerFrequency;
UINTN DivideValue = 1; UINT32 DivideValue = 1;
if (TimerPeriod == 0) { if (TimerPeriod == 0) {
// //
@ -193,7 +193,7 @@ TimerDriverSetTimerPeriod (
// //
// Program the timer with the new count value // Program the timer with the new count value
// //
InitializeApicTimer(DivideValue, TimerCount, TRUE, LOCAL_APIC_TIMER_VECTOR); InitializeApicTimer(DivideValue, (UINT32)TimerCount, TRUE, LOCAL_APIC_TIMER_VECTOR);
// //
// Enable timer interrupt // Enable timer interrupt