From 66979ff5c555e7f616fc4f68ad9c59c326c351f9 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Sun, 16 Feb 2020 15:46:12 +0300 Subject: [PATCH] Build: Fix analysis warnings closes acidanthera/bugtracker#722 --- Library/OcBootManagementLib/DefaultEntryChoice.c | 8 +++++--- Library/OcConsoleLib/ConsoleGop.c | 4 ++-- Library/OcCpuLib/FrequencyDetect.c | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Library/OcBootManagementLib/DefaultEntryChoice.c b/Library/OcBootManagementLib/DefaultEntryChoice.c index b18e969d..4e990417 100644 --- a/Library/OcBootManagementLib/DefaultEntryChoice.c +++ b/Library/OcBootManagementLib/DefaultEntryChoice.c @@ -1123,8 +1123,10 @@ InternalLoadBootEntry ( ZeroMem (DmgLoadContext, sizeof (*DmgLoadContext)); - EntryData = NULL; - EntryDataSize = 0; + EntryData = NULL; + EntryDataSize = 0; + ParentDeviceHandle = NULL; + ParentFilePath = NULL; if (BootEntry->IsFolder) { if ((Context->LoadPolicy & OC_LOAD_ALLOW_DMG_BOOT) == 0) { @@ -1244,7 +1246,7 @@ InternalLoadBootEntry ( // fields to our custom device path, so we fix it up here. // REF: https://github.com/acidanthera/bugtracker/issues/712 // - if (LoadedImage->DeviceHandle == NULL) { + if (LoadedImage->DeviceHandle == NULL && ParentDeviceHandle != NULL) { if (LoadedImage->FilePath != NULL) { FreePool (LoadedImage->FilePath); } diff --git a/Library/OcConsoleLib/ConsoleGop.c b/Library/OcConsoleLib/ConsoleGop.c index 281e2c14..f6d34eaf 100644 --- a/Library/OcConsoleLib/ConsoleGop.c +++ b/Library/OcConsoleLib/ConsoleGop.c @@ -189,7 +189,7 @@ DirectGopFromTarget ( ConfigureSize = 0; Status = FrameBufferBltConfigure ( - (VOID *) FramebufferBase, + (VOID *)(UINTN) FramebufferBase, Info, NULL, &ConfigureSize @@ -204,7 +204,7 @@ DirectGopFromTarget ( } Status = FrameBufferBltConfigure ( - (VOID *) FramebufferBase, + (VOID *)(UINTN) FramebufferBase, Info, Context, &ConfigureSize diff --git a/Library/OcCpuLib/FrequencyDetect.c b/Library/OcCpuLib/FrequencyDetect.c index a72180b6..75db8130 100644 --- a/Library/OcCpuLib/FrequencyDetect.c +++ b/Library/OcCpuLib/FrequencyDetect.c @@ -461,10 +461,10 @@ InternalCalculateVMTFrequency ( // We get kHZ from node and we should translate it first. // if (FSBFrequency != NULL) { - *FSBFrequency = CpuidEbx * 1000; + *FSBFrequency = CpuidEbx * 1000ULL; } - return CpuidEax * 1000; + return CpuidEax * 1000ULL; } UINT64