From 83593a5ab91c1a9485d1ce167ad13e035b75aeb2 Mon Sep 17 00:00:00 2001 From: jief666 Date: Tue, 28 Sep 2021 16:54:31 +0300 Subject: [PATCH] Convert bool to XBool. --- .../CloverX64.xcodeproj/project.pbxproj | 2 + rEFIt_UEFI/Platform/AcpiPatcher.cpp | 6 +- rEFIt_UEFI/Platform/BdsConnect.cpp | 6 +- rEFIt_UEFI/Platform/BootOptions.cpp | 20 +- rEFIt_UEFI/Platform/BootOptions.h | 14 +- rEFIt_UEFI/Platform/DataHub.cpp | 4 +- rEFIt_UEFI/Platform/DataHubCpu.cpp | 2 +- rEFIt_UEFI/Platform/FixBiosDsdt.cpp | 16 +- rEFIt_UEFI/Platform/Hibernate.cpp | 12 +- rEFIt_UEFI/Platform/Injectors.cpp | 2 +- .../Platform/KERNEL_AND_KEXT_PATCHES.cpp | 6 +- rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.h | 52 +- rEFIt_UEFI/Platform/KextList.cpp | 16 +- rEFIt_UEFI/Platform/LegacyBiosThunk.cpp | 24 +- rEFIt_UEFI/Platform/MacOsVersion.h | 18 +- rEFIt_UEFI/Platform/Nvram.cpp | 8 +- rEFIt_UEFI/Platform/Settings.cpp | 24 +- rEFIt_UEFI/Platform/Settings.h | 580 +++++++++--------- .../Platform/SmbiosFillPatchingValues.cpp | 2 +- .../Platform/SmbiosFillPatchingValues.h | 2 +- rEFIt_UEFI/Platform/Utils.h | 4 +- rEFIt_UEFI/Platform/Volume.cpp | 6 +- rEFIt_UEFI/Platform/Volume.h | 8 +- rEFIt_UEFI/Platform/ati.cpp | 4 +- rEFIt_UEFI/Platform/ati.h | 6 +- rEFIt_UEFI/Platform/card_vlist.h | 2 +- rEFIt_UEFI/Platform/cpu.cpp | 2 +- rEFIt_UEFI/Platform/device_inject.cpp | 6 +- rEFIt_UEFI/Platform/device_inject.h | 2 +- rEFIt_UEFI/Platform/gma.cpp | 12 +- rEFIt_UEFI/Platform/guid.h | 2 +- rEFIt_UEFI/Platform/hda.cpp | 2 +- rEFIt_UEFI/Platform/kernel_patcher.cpp | 18 +- rEFIt_UEFI/Platform/kernel_patcher.h | 10 +- rEFIt_UEFI/Platform/kext_inject.cpp | 8 +- rEFIt_UEFI/Platform/kext_patcher.cpp | 6 +- rEFIt_UEFI/Platform/nvidia.cpp | 6 +- rEFIt_UEFI/Platform/platformdata.cpp | 12 +- rEFIt_UEFI/Platform/platformdata.h | 12 +- rEFIt_UEFI/Platform/plist/TagArray.cpp | 4 +- rEFIt_UEFI/Platform/plist/TagArray.h | 6 +- rEFIt_UEFI/Platform/plist/TagBool.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagBool.h | 12 +- rEFIt_UEFI/Platform/plist/TagData.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagData.h | 4 +- rEFIt_UEFI/Platform/plist/TagDate.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagDate.h | 4 +- rEFIt_UEFI/Platform/plist/TagDict.cpp | 4 +- rEFIt_UEFI/Platform/plist/TagDict.h | 6 +- rEFIt_UEFI/Platform/plist/TagFloat.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagFloat.h | 4 +- rEFIt_UEFI/Platform/plist/TagInt64.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagInt64.h | 4 +- rEFIt_UEFI/Platform/plist/TagKey.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagKey.h | 4 +- rEFIt_UEFI/Platform/plist/TagString8.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagString8.h | 4 +- rEFIt_UEFI/Platform/plist/plist.cpp | 20 +- rEFIt_UEFI/Platform/plist/plist.h | 34 +- rEFIt_UEFI/Platform/smbios.cpp | 10 +- rEFIt_UEFI/Platform/smbios.h | 34 +- rEFIt_UEFI/Platform/spd.cpp | 2 +- rEFIt_UEFI/Platform/usbfix.cpp | 2 +- rEFIt_UEFI/PlatformEFI/BasicIO.cpp | 2 +- rEFIt_UEFI/PlatformPOSIX+EFI/BootLog.cpp | 2 +- rEFIt_UEFI/PlatformPOSIX/BootLog.cpp | 2 +- rEFIt_UEFI/Settings/ConfigManager.cpp | 2 +- rEFIt_UEFI/Settings/ConfigManager.h | 16 +- .../ConfigPlist/ConfigPlistAbstract.cpp | 10 +- .../ConfigPlist/ConfigPlistAbstract.h | 8 +- .../Settings/ConfigPlist/ConfigPlistClass.h | 2 +- rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI.h | 18 +- .../Settings/ConfigPlist/Config_ACPI_DSDT.cpp | 2 +- .../Settings/ConfigPlist/Config_ACPI_DSDT.h | 30 +- .../Settings/ConfigPlist/Config_ACPI_SSDT.h | 38 +- rEFIt_UEFI/Settings/ConfigPlist/Config_Boot.h | 34 +- rEFIt_UEFI/Settings/ConfigPlist/Config_CPU.h | 20 +- .../Settings/ConfigPlist/Config_Devices.h | 4 +- .../ConfigPlist/Config_Devices_Arbitrary.h | 2 +- .../ConfigPlist/Config_Devices_Audio.h | 8 +- .../ConfigPlist/Config_Devices_Properties.h | 4 +- .../Settings/ConfigPlist/Config_Devices_USB.h | 2 +- .../Settings/ConfigPlist/Config_GUI.cpp | 2 +- rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.h | 84 +-- .../Settings/ConfigPlist/Config_Graphics.h | 16 +- .../ConfigPlist/Config_KernelAndKextPatches.h | 46 +- .../Settings/ConfigPlist/Config_Quirks.h | 64 +- .../Settings/ConfigPlist/Config_RtVariables.h | 8 +- .../ConfigPlist/Config_SystemParameters.h | 20 +- rEFIt_UEFI/Settings/ConfigPlist/README.md | 12 +- rEFIt_UEFI/Settings/ConfigPlist/SMBIOSPlist.h | 30 +- rEFIt_UEFI/Settings/Self.cpp | 6 +- rEFIt_UEFI/Settings/Self.h | 10 +- rEFIt_UEFI/Settings/SelfOem.cpp | 8 +- rEFIt_UEFI/Settings/SelfOem.h | 16 +- rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h | 26 +- rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.cpp | 6 +- rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.h | 8 +- rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.cpp | 14 +- rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h | 34 +- rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp | 52 +- rEFIt_UEFI/cpp_lib/XmlLiteParser.h | 51 +- rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.cpp | 74 +-- rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h | 162 ++--- rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.cpp | 6 +- rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.h | 14 +- rEFIt_UEFI/cpp_lib/undefinable.h | 19 +- rEFIt_UEFI/cpp_unit_test/config-test.cpp | 2 + .../xml_lite-reapeatingdict-test.cpp | 2 +- rEFIt_UEFI/cpp_unit_test/xml_lite-test.cpp | 48 +- rEFIt_UEFI/entry_scan/common.cpp | 4 +- rEFIt_UEFI/entry_scan/entry_scan.h | 4 +- rEFIt_UEFI/entry_scan/legacy.cpp | 4 +- rEFIt_UEFI/entry_scan/loader.cpp | 12 +- rEFIt_UEFI/entry_scan/lockedgraphics.cpp | 6 +- rEFIt_UEFI/entry_scan/secureboot.cpp | 4 +- rEFIt_UEFI/entry_scan/securehash.cpp | 2 +- rEFIt_UEFI/entry_scan/securevars.cpp | 2 +- rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp | 4 +- rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp | 8 +- rEFIt_UEFI/gui/REFIT_MENU_SCREEN.h | 14 +- rEFIt_UEFI/gui/menu_items/menu_items.h | 38 +- rEFIt_UEFI/include/Pci.h | 2 +- rEFIt_UEFI/libeg/BmLib.cpp | 14 +- rEFIt_UEFI/libeg/EfiFileLib.h | 4 +- rEFIt_UEFI/libeg/XCinema.cpp | 2 +- rEFIt_UEFI/libeg/XCinema.h | 8 +- rEFIt_UEFI/libeg/XIcon.cpp | 6 +- rEFIt_UEFI/libeg/XIcon.h | 10 +- rEFIt_UEFI/libeg/XImage.cpp | 10 +- rEFIt_UEFI/libeg/XImage.h | 8 +- rEFIt_UEFI/libeg/XPointer.cpp | 6 +- rEFIt_UEFI/libeg/XPointer.h | 12 +- rEFIt_UEFI/libeg/XTheme.cpp | 2 +- rEFIt_UEFI/libeg/XTheme.h | 30 +- rEFIt_UEFI/libeg/image.cpp | 2 +- rEFIt_UEFI/libeg/libeg.h | 8 +- rEFIt_UEFI/libeg/text.cpp | 4 +- rEFIt_UEFI/refit/lib.cpp | 30 +- rEFIt_UEFI/refit/lib.h | 4 +- rEFIt_UEFI/refit/main.cpp | 26 +- rEFIt_UEFI/refit/menu.cpp | 96 +-- rEFIt_UEFI/refit/menu.h | 2 +- 143 files changed, 1282 insertions(+), 1268 deletions(-) diff --git a/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj b/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj index 9c793a3ac..472d85cb5 100644 --- a/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj +++ b/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj @@ -3334,6 +3334,7 @@ "-Wignored-qualifiers", "-Wreorder", "-Wmissing-braces", + "-Wnon-pod-varargs", ); }; name = Debug; @@ -3434,6 +3435,7 @@ "-Wignored-qualifiers", "-Wreorder", "-Wmissing-braces", + "-Wnon-pod-varargs", ); }; name = Release; diff --git a/rEFIt_UEFI/Platform/AcpiPatcher.cpp b/rEFIt_UEFI/Platform/AcpiPatcher.cpp index fc367cb3f..7752bb67d 100644 --- a/rEFIt_UEFI/Platform/AcpiPatcher.cpp +++ b/rEFIt_UEFI/Platform/AcpiPatcher.cpp @@ -1451,7 +1451,7 @@ void SaveOemTables() // EFI_STATUS Status; void *RsdPtr; XStringW AcpiOriginPath = L"ACPI\\origin"_XSW; - XBool Saved = false; + XBool Saved = false; CHAR8 *MemLogStart; UINTN MemLogStartLen; @@ -1716,8 +1716,8 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, const MacOsVersion& OSVersion) // UINTN ApicLen; UINTN ApicCPUNum; UINT8 *SubTable; - XBool DsdtLoaded = false; - XBool NeedUpdate = false; + XBool DsdtLoaded = false; + XBool NeedUpdate = false; OPER_REGION *tmpRegion; // XStringW AcpiOemPath = SWPrintf("%ls\\ACPI\\patched", OEMPath.wc_str()); diff --git a/rEFIt_UEFI/Platform/BdsConnect.cpp b/rEFIt_UEFI/Platform/BdsConnect.cpp index cc35e6b90..7df9adbc1 100644 --- a/rEFIt_UEFI/Platform/BdsConnect.cpp +++ b/rEFIt_UEFI/Platform/BdsConnect.cpp @@ -432,8 +432,8 @@ EFI_STATUS BdsLibConnectMostlyAllEfi() EFI_HANDLE *HandleBuffer = NULL; UINT32 *HandleType = NULL; UINTN HandleIndex; - XBool Parent; - XBool Device; + XBool Parent; + XBool Device; EFI_PCI_IO_PROTOCOL* PciIo = NULL; PCI_TYPE00 Pci; @@ -552,7 +552,7 @@ BdsLibConnectUsbDevByShortFormDP( UINTN Index; EFI_PCI_IO_PROTOCOL *PciIo; UINT8 Class[3]; - XBool AtLeastOneConnected; + XBool AtLeastOneConnected; // // Check the passed in parameters diff --git a/rEFIt_UEFI/Platform/BootOptions.cpp b/rEFIt_UEFI/Platform/BootOptions.cpp index b3fc8b648..9e8e392e8 100644 --- a/rEFIt_UEFI/Platform/BootOptions.cpp +++ b/rEFIt_UEFI/Platform/BootOptions.cpp @@ -168,9 +168,9 @@ Clover_FindDevicePathNodeWithType ( */ EFI_STATUS CreateBootOptionDevicePath ( - IN EFI_HANDLE FileDeviceHandle, + IN EFI_HANDLE FileDeviceHandle, IN CONST XStringW& FileName, - IN XBool UseShortForm, + IN XBool UseShortForm, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath ) { @@ -226,7 +226,7 @@ DevicePathEqual ( IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2 ) { - XBool Equal; + XBool Equal; UINT8 Type1; UINT8 SubType1; UINTN Len1; @@ -831,7 +831,7 @@ FindBootOptionForFile ( /** Prints BootXXXX vars found listed in BootOrder, plus print others if AllBootOptions == true. */ void PrintBootOptions ( - IN XBool AllBootOptions + IN XBool AllBootOptions ) { EFI_STATUS Status; @@ -840,7 +840,7 @@ PrintBootOptions ( UINTN Index; UINTN BootNum; BO_BOOT_OPTION BootOption; - XBool FoundOthers; + XBool FoundOthers; DBG("\nBoot options:\n-------------\n"); @@ -997,13 +997,13 @@ AddBootOption ( */ EFI_STATUS AddBootOptionForFile ( - IN EFI_HANDLE FileDeviceHandle, + IN EFI_HANDLE FileDeviceHandle, IN CONST XStringW& FileName, - IN XBool UseShortForm, - IN CONST CHAR16 *Description, + IN XBool UseShortForm, + IN CONST CHAR16 *Description, IN UINT8 *OptionalData, - IN UINTN OptionalDataSize, - IN UINTN BootIndex, + IN UINTN OptionalDataSize, + IN UINTN BootIndex, OUT UINT16 *BootNum ) { diff --git a/rEFIt_UEFI/Platform/BootOptions.h b/rEFIt_UEFI/Platform/BootOptions.h index f5b701881..35084b81f 100644 --- a/rEFIt_UEFI/Platform/BootOptions.h +++ b/rEFIt_UEFI/Platform/BootOptions.h @@ -122,14 +122,14 @@ FindBootOptionForFile ( */ EFI_STATUS AddBootOptionForFile ( - IN EFI_HANDLE FileDeviceHandle, + IN EFI_HANDLE FileDeviceHandle, IN CONST XStringW &FileName, - IN XBool UseShortForm, - IN CONST CHAR16 *Description, - IN UINT8 *OptionalData, - IN UINTN OptionalDataSize, - IN UINTN BootIndex, - OUT UINT16 *BootNum + IN XBool UseShortForm, + IN CONST CHAR16 *Description, + IN UINT8 *OptionalData, + IN UINTN OptionalDataSize, + IN UINTN BootIndex, + OUT UINT16 *BootNum ); /** Deletes boot option specified with BootNum (XXXX in BootXXXX var name). */ diff --git a/rEFIt_UEFI/Platform/DataHub.cpp b/rEFIt_UEFI/Platform/DataHub.cpp index 0e4714aa3..74b801fce 100755 --- a/rEFIt_UEFI/Platform/DataHub.cpp +++ b/rEFIt_UEFI/Platform/DataHub.cpp @@ -173,14 +173,14 @@ GetNextDataRecord ( { EFI_DATA_ENTRY *LogEntry; LIST_ENTRY *Link; - XBool ReturnFirstEntry; + XBool ReturnFirstEntry; EFI_DATA_RECORD_HEADER *Record; EFI_DATA_ENTRY *NextLogEntry; // // If MonotonicCount == 0 just return the first one // - ReturnFirstEntry = (XBool) (*PtrCurrentMTC == 0); + ReturnFirstEntry = *PtrCurrentMTC == 0; Record = NULL; for (Link = GetFirstNode(Head); Link != Head; Link = GetNextNode(Head, Link)) { diff --git a/rEFIt_UEFI/Platform/DataHubCpu.cpp b/rEFIt_UEFI/Platform/DataHubCpu.cpp index 06fedab63..105666015 100644 --- a/rEFIt_UEFI/Platform/DataHubCpu.cpp +++ b/rEFIt_UEFI/Platform/DataHubCpu.cpp @@ -467,7 +467,7 @@ SetupDataForOSX(XBool Hibernate) UINT64 ARTFrequency; UINTN Revision; UINT16 Zero = 0; - XBool isRevLess = (ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[0] == 0 && + XBool isRevLess = (ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[0] == 0 && ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[1] == 0 && ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[2] == 0 && ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[3] == 0 && diff --git a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp index db9e1632f..dfb989562 100755 --- a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp +++ b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp @@ -1231,7 +1231,7 @@ XBool GetName(UINT8 *dsdt, INT32 adr, OUT CHAR8* name, OUT INTN *shift) XBool CmpAdr (UINT8 *dsdt, UINT32 j, UINT32 PciAdr) { // Name (_ADR, 0x001f0001) - return (XBool) + return ((dsdt[j + 4] == 0x08) && (dsdt[j + 5] == 0x5F) && (dsdt[j + 6] == 0x41) && @@ -1267,7 +1267,7 @@ XBool CmpPNP (UINT8 *dsdt, UINT32 j, UINT16 PNP) { // Name (_HID, EisaId ("PNP0C0F")) for PNP=0x0C0F BigEndian if (PNP == 0) { - return (XBool) + return ((dsdt[j + 0] == 0x08) && (dsdt[j + 1] == 0x5F) && (dsdt[j + 2] == 0x48) && @@ -1277,7 +1277,7 @@ XBool CmpPNP (UINT8 *dsdt, UINT32 j, UINT16 PNP) (dsdt[j + 6] == 0x41) && (dsdt[j + 7] == 0xD0)); } - return (XBool) + return ((dsdt[j + 0] == 0x08) && (dsdt[j + 1] == 0x5F) && (dsdt[j + 2] == 0x48) && @@ -4265,14 +4265,14 @@ UINT8 VenIDE[] = {0x86,0x80,0x00,0x00}; UINT32 FIXIDE (UINT8 *dsdt, UINT32 len) { - UINT32 i, k; - UINT32 j; - UINT32 IDEADR = 0, BridgeSize = 0, Size; - INT32 sizeoffset; + UINT32 i, k; + UINT32 j; + UINT32 IDEADR = 0, BridgeSize = 0, Size; + INT32 sizeoffset; AML_CHUNK *root; AML_CHUNK *device; CHAR8 *ide; - XBool PATAFIX=true; + XBool PATAFIX=true; AML_CHUNK *met, *met2; AML_CHUNK *pack; AML_CHUNK *device1; diff --git a/rEFIt_UEFI/Platform/Hibernate.cpp b/rEFIt_UEFI/Platform/Hibernate.cpp index 7fed30f94..6c5445fde 100644 --- a/rEFIt_UEFI/Platform/Hibernate.cpp +++ b/rEFIt_UEFI/Platform/Hibernate.cpp @@ -712,13 +712,13 @@ STATIC CHAR16 OffsetHexStr[100]; XBool IsOsxHibernated (IN LOADER_ENTRY *Entry) { - EFI_STATUS Status = EFI_SUCCESS; - UINTN Size = 0; + EFI_STATUS Status = EFI_SUCCESS; + UINTN Size = 0; UINT8 *Data = NULL; // REFIT_VOLUME *ThisVolume = Entry->Volume; REFIT_VOLUME *Volume = Entry->Volume; EFI_GUID *BootGUID = NULL; - XBool ret = false; + XBool ret = false; UINT8 *Value = NULL; // UINTN VolumeIndex; @@ -986,9 +986,9 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) UINT8 *VarData = NULL; REFIT_VOLUME *SleepImageVolume; UINT32 Attributes; - XBool HasIORTCVariables = false; - XBool HasHibernateInfo = false; - XBool HasHibernateInfoInRTC = false; + XBool HasIORTCVariables = false; + XBool HasHibernateInfo = false; + XBool HasHibernateInfoInRTC = false; DBG("PrepareHibernation:\n"); diff --git a/rEFIt_UEFI/Platform/Injectors.cpp b/rEFIt_UEFI/Platform/Injectors.cpp index f3dfd15fa..575ccf50e 100644 --- a/rEFIt_UEFI/Platform/Injectors.cpp +++ b/rEFIt_UEFI/Platform/Injectors.cpp @@ -341,7 +341,7 @@ EFI_KEYBOARD_INFO_PROTOCOL mKeyboardInfo = { //EFIAPI //GetQuirksConfig (IN OCQUIRKS_PROTOCOL *This, // OUT OC_ABC_SETTINGS_4CLOVER *Buffer, -// OUT XBool *GopEnable +// OUT XBool *GopEnable // ) //{ // DBG("GetQuirksConfig called\n"); diff --git a/rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.cpp b/rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.cpp index d90558fd6..a196d1ce5 100644 --- a/rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.cpp +++ b/rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.cpp @@ -8,7 +8,7 @@ #include "KERNEL_AND_KEXT_PATCHES.h" #include "MacOsVersion.h" -bool ABSTRACT_PATCH::IsPatchEnabledByBuildNumber(const XString8& Build) +XBool ABSTRACT_PATCH::IsPatchEnabledByBuildNumber(const XString8& Build) { XBool ret = false; @@ -35,7 +35,7 @@ bool ABSTRACT_PATCH::IsPatchEnabledByBuildNumber(const XString8& Build) } -bool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS) +XBool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS) { XBool ret = false; @@ -63,7 +63,7 @@ bool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS) // -//bool KERNEL_AND_KEXT_PATCHES::IsPatchEnabledByBuildNumber(const XString8& Build) +//XBool KERNEL_AND_KEXT_PATCHES::IsPatchEnabledByBuildNumber(const XString8& Build) //{ // XBool ret = false; // diff --git a/rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.h b/rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.h index 52070be09..41e94f631 100644 --- a/rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.h +++ b/rEFIt_UEFI/Platform/KERNEL_AND_KEXT_PATCHES.h @@ -22,7 +22,7 @@ extern "C" { class ABSTRACT_PATCH { public: - bool Disabled = bool(); + XBool Disabled = XBool(); XBuffer Find = XBuffer (); XBuffer Replace = XBuffer (); XBuffer MaskFind = XBuffer (); @@ -43,9 +43,9 @@ public: virtual ~ABSTRACT_PATCH() {} #if __cplusplus > 201703L - bool operator == (const ABSTRACT_PATCH&) const = default; + XBool operator == (const ABSTRACT_PATCH&) const = default; #endif - bool isEqual(const ABSTRACT_PATCH& other) const + XBool isEqual(const ABSTRACT_PATCH& other) const { if ( !(Disabled == other.Disabled ) ) return false; if ( !(Find == other.Find ) ) return false; @@ -82,8 +82,8 @@ public: } /** Returns a boolean and then enable disable the patch if MachOSEntry have a match for the booted OS. */ - bool IsPatchEnabledByBuildNumber(const XString8& Build); - bool IsPatchEnabled(const MacOsVersion& CurrOS); + XBool IsPatchEnabledByBuildNumber(const XString8& Build); + XBool IsPatchEnabled(const MacOsVersion& CurrOS); }; @@ -96,15 +96,15 @@ public: #if __cplusplus > 201703L - bool operator == (const ABSTRACT_KEXT_OR_KERNEL_PATCH&) const = default; + XBool operator == (const ABSTRACT_KEXT_OR_KERNEL_PATCH&) const = default; #endif - bool isEqual(const ABSTRACT_KEXT_OR_KERNEL_PATCH& other) const + XBool isEqual(const ABSTRACT_KEXT_OR_KERNEL_PATCH& other) const { if ( !super::isEqual (other) ) return false; if ( !(ProcedureName == other.ProcedureName ) ) return false; return true; } - bool takeValueFrom(const ConfigPlistClass::KernelAndKextPatches_Class::ABSTRACT_KEXT_OR_KERNEL_PATCH& other) + XBool takeValueFrom(const ConfigPlistClass::KernelAndKextPatches_Class::ABSTRACT_KEXT_OR_KERNEL_PATCH& other) { super::takeValueFrom(other); ProcedureName = other.dgetProcedureName(); @@ -119,15 +119,15 @@ class KEXT_PATCH : public ABSTRACT_KEXT_OR_KERNEL_PATCH using super = ABSTRACT_KEXT_OR_KERNEL_PATCH; public: XString8 Name = XString8(); - bool IsPlistPatch = XBool(); + XBool IsPlistPatch = XBool(); virtual XString8 getName() const { return Name; } #if __cplusplus > 201703L - bool operator == (const KEXT_PATCH&) const = default; + XBool operator == (const KEXT_PATCH&) const = default; #endif - bool isEqual(const KEXT_PATCH& other) const + XBool isEqual(const KEXT_PATCH& other) const { if ( !super::isEqual (other) ) return false; if ( !(Name == other.Name ) ) return false; @@ -150,9 +150,9 @@ public: virtual XString8 getName() const { return "kernel"_XS8; } #if __cplusplus > 201703L - bool operator == (const KERNEL_PATCH&) const = default; + XBool operator == (const KERNEL_PATCH&) const = default; #endif - bool isEqual(const KERNEL_PATCH& other) const + XBool isEqual(const KERNEL_PATCH& other) const { if ( !super::isEqual (other) ) return false; return true; @@ -171,9 +171,9 @@ public: virtual XString8 getName() const { return "boot.efi"_XS8; } #if __cplusplus > 201703L - bool operator == (const BOOT_PATCH&) const = default; + XBool operator == (const BOOT_PATCH&) const = default; #endif - bool isEqual(const BOOT_PATCH& other) const + XBool isEqual(const BOOT_PATCH& other) const { if ( !super::isEqual (other) ) return false; return true; @@ -187,15 +187,15 @@ public: class KERNEL_AND_KEXT_PATCHES { public: - bool KPDebug = bool(); - bool KPKernelLapic = bool(); - bool KPKernelXCPM = bool(); - bool _KPKernelPm = bool(); - bool KPPanicNoKextDump = bool(); - bool _KPAppleIntelCPUPM = bool(); - bool KPAppleRTC = bool(); - bool EightApple = bool(); - bool KPDELLSMBIOS = bool(); // Dell SMBIOS patch + XBool KPDebug = XBool(); + XBool KPKernelLapic = XBool(); + XBool KPKernelXCPM = XBool(); + XBool _KPKernelPm = XBool(); + XBool KPPanicNoKextDump = XBool(); + XBool _KPAppleIntelCPUPM = XBool(); + XBool KPAppleRTC = XBool(); + XBool EightApple = XBool(); + XBool KPDELLSMBIOS = XBool(); // Dell SMBIOS patch UINT32 FakeCPUID = UINT32(); XString8 KPATIConnectorsController = XString8(); XBuffer KPATIConnectorsData = XBuffer(); @@ -208,9 +208,9 @@ public: KERNEL_AND_KEXT_PATCHES() : ForceKextsToLoad(), KextPatches(), KernelPatches(), BootPatches() {} #if __cplusplus > 201703L - bool operator == (const KERNEL_AND_KEXT_PATCHES&) const = default; + XBool operator == (const KERNEL_AND_KEXT_PATCHES&) const = default; #endif - bool isEqual(const KERNEL_AND_KEXT_PATCHES& other) const + XBool isEqual(const KERNEL_AND_KEXT_PATCHES& other) const { if ( !(KPDebug == other.KPDebug ) ) return false; if ( !(KPKernelLapic == other.KPKernelLapic ) ) return false; diff --git a/rEFIt_UEFI/Platform/KextList.cpp b/rEFIt_UEFI/Platform/KextList.cpp index 8b182cebb..2ed318f73 100644 --- a/rEFIt_UEFI/Platform/KextList.cpp +++ b/rEFIt_UEFI/Platform/KextList.cpp @@ -66,17 +66,17 @@ XStringW GetBundleVersion(const XStringW& pathUnderSelf) void GetListOfInjectKext(CHAR16 *KextDirNameUnderOEMPath) { - REFIT_DIR_ITER DirIter; - EFI_FILE_INFO* DirEntry; - SIDELOAD_KEXT* mKext; - SIDELOAD_KEXT* mPlugInKext; - XStringW FullName; + REFIT_DIR_ITER DirIter; + EFI_FILE_INFO *DirEntry; + SIDELOAD_KEXT *mKext; + SIDELOAD_KEXT *mPlugInKext; + XStringW FullName; // XStringW FullPath = SWPrintf("%ls\\KEXTS\\%ls", OEMPath.wc_str(), KextDirNameUnderOEMPath); - REFIT_DIR_ITER PlugInsIter; + REFIT_DIR_ITER PlugInsIter; EFI_FILE_INFO *PlugInEntry; - XStringW PlugInsPath; + XStringW PlugInsPath; XStringW PlugInsName; - XBool Blocked = false; + XBool Blocked = false; if( !selfOem.isKextsDirFound() ) return; diff --git a/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp b/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp index dacbeeaa9..041387e87 100644 --- a/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp +++ b/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp @@ -214,8 +214,8 @@ LegacyBiosInt86 ( UINTN Status; UINTN Eflags; IA32_REGISTER_SET ThunkRegSet; - XBool Ret; - UINT16 *Stack16; + XBool Ret; + UINT16 *Stack16; ZeroMem (&ThunkRegSet, sizeof (ThunkRegSet)); ThunkRegSet.E.EFLAGS.Bits.Reserved_0 = 1; @@ -295,7 +295,7 @@ LegacyBiosInt86 ( CopyMem(&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32)); - Ret = (XBool) (Regs->E.EFLAGS.Bits.CF == 1); + Ret = Regs->E.EFLAGS.Bits.CF == 1; return Ret; } @@ -311,17 +311,17 @@ LegacyBiosFarCall86 ( // IN UINTN StackSize ) { - UINTN Status; - UINT32 Eflags; - IA32_REGISTER_SET ThunkRegSet; - XBool Ret; - UINT16 *Stack16; + UINTN Status; + UINT32 Eflags; + IA32_REGISTER_SET ThunkRegSet; + XBool Ret; + UINT16 *Stack16; // UINT16 BiosInt = 0x100; - EFI_TPL OriginalTpl; + EFI_TPL OriginalTpl; EFI_TIMER_ARCH_PROTOCOL *Timer; - UINT64 TimerPeriod = 0; + UINT64 TimerPeriod = 0; #if ENABLE_PS2MOUSE_LEGACYBOOT == 1 - UINT16 LegacyMaskOld, LegacyMaskNew; + UINT16 LegacyMaskOld, LegacyMaskNew; #endif // Disconnect EFI VGA driver (and switch to Text VGA Mode) @@ -449,7 +449,7 @@ LegacyBiosFarCall86 ( CopyMem(&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32)); - Ret = (XBool) (Regs->E.EFLAGS.Bits.CF == 1); + Ret = Regs->E.EFLAGS.Bits.CF == 1; // Connect VGA EFI Driver BdsLibConnectAllDriversToAllControllers(); diff --git a/rEFIt_UEFI/Platform/MacOsVersion.h b/rEFIt_UEFI/Platform/MacOsVersion.h index 3dbf06cca..4be6c57a9 100644 --- a/rEFIt_UEFI/Platform/MacOsVersion.h +++ b/rEFIt_UEFI/Platform/MacOsVersion.h @@ -26,8 +26,8 @@ class AbstractMacOsVersion int nbElement() const { int idx; for ( idx=0 ; idx < nbMaxElement && versionsNumber[idx] != -1 ; idx++ ) {}; return idx; } int lastElement() const { int idx; for ( idx=1 ; idx < nbMaxElement && versionsNumber[idx] != -1 ; idx++ ) {}; return versionsNumber[idx-1]; } void setEmpty() { lastError.setEmpty(); for ( size_t idx=0 ; idx < nbMaxElement ; idx++ ) versionsNumber[idx] = -1; } - bool isEmpty() const { return versionsNumber[0] == -1; } - bool notEmpty() const { return !isEmpty(); } + XBool isEmpty() const { return versionsNumber[0] == -1; } + XBool notEmpty() const { return !isEmpty(); } template int elementAt(IntegralType i) const { @@ -230,7 +230,7 @@ class MacOsVersion : public AbstractMacOsVersion } - bool match(const MacOsVersionPattern& pattern) const + XBool match(const MacOsVersionPattern& pattern) const { // int nbMax = nbElemen() <= pattern.nbMaxElement ? nbMaxElement : pattern.nbMaxElement; int idx; @@ -251,16 +251,16 @@ class MacOsVersion : public AbstractMacOsVersion return false; } - bool operator ==(const MacOsVersion &other) const + XBool operator ==(const MacOsVersion &other) const { for ( size_t idx=0 ; idx < nbMaxElement ; idx++ ) { if ( versionsNumber[idx] != other.elementAt(idx) ) return false; } return true; }; - bool operator !=(const MacOsVersion &other) const { return ! ( *this == other); } + XBool operator !=(const MacOsVersion &other) const { return ! ( *this == other); } - bool operator <(const MacOsVersion &other) const + XBool operator <(const MacOsVersion &other) const { for ( size_t idx=0 ; idx < nbMaxElement ; idx++ ) { if ( versionsNumber[idx] < other.elementAt(idx) ) return true; @@ -268,9 +268,9 @@ class MacOsVersion : public AbstractMacOsVersion } return false; // here, means it's equal }; - bool operator >=(const MacOsVersion &other) const { return ! ( *this < other); } + XBool operator >=(const MacOsVersion &other) const { return ! ( *this < other); } - bool operator >(const MacOsVersion &other) const + XBool operator >(const MacOsVersion &other) const { for ( size_t idx=0 ; idx < nbMaxElement ; idx++ ) { if ( versionsNumber[idx] > other.elementAt(idx) ) return true; @@ -278,7 +278,7 @@ class MacOsVersion : public AbstractMacOsVersion } return false; // here, means it's equal }; - bool operator <=(const MacOsVersion &other) const { return ! ( *this > other); } + XBool operator <=(const MacOsVersion &other) const { return ! ( *this > other); } }; diff --git a/rEFIt_UEFI/Platform/Nvram.cpp b/rEFIt_UEFI/Platform/Nvram.cpp index 2778dea53..b74b97e52 100755 --- a/rEFIt_UEFI/Platform/Nvram.cpp +++ b/rEFIt_UEFI/Platform/Nvram.cpp @@ -372,7 +372,7 @@ ResetNativeNvram () CHAR16 *Name; UINTN NameSize; UINTN NewNameSize; - XBool Restart = true; + XBool Restart = true; UINTN VolumeIndex; REFIT_VOLUME *Volume; EFI_FILE* FileHandle; @@ -636,7 +636,7 @@ BootVolumeDevicePathEqual ( IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2 ) { - XBool Equal; + XBool Equal; UINT8 Type1; UINT8 SubType1; UINT8 Type2; @@ -645,7 +645,7 @@ BootVolumeDevicePathEqual ( UINTN Len2; SATA_DEVICE_PATH *SataNode1; SATA_DEVICE_PATH *SataNode2; - XBool ForceEqualNodes; + XBool ForceEqualNodes; // DBG_DP (" BootVolumeDevicePathEqual:\n %ls\n %ls\n", FileDevicePathToStr (DevicePath1), FileDevicePathToStr (DevicePath2)); @@ -1243,7 +1243,7 @@ FindStartupDiskVolume ( // LOADER_ENTRY *LoaderEntry; // REFIT_VOLUME *Volume; REFIT_VOLUME *DiskVolume; - XBool IsPartitionVolume; + XBool IsPartitionVolume; XStringW LoaderPath; XStringW EfiBootVolumeStr; diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index e9f5815ba..a42e18fad 100755 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -63,7 +63,7 @@ INTN OldChosenTheme; INTN OldChosenConfig; INTN OldChosenDsdt; UINTN OldChosenAudio; -XBool SavePreBootLog; +XBool SavePreBootLog; UINT8 DefaultAudioVolume; INTN LayoutBannerOffset = 64; INTN LayoutTextOffset = 0; @@ -94,13 +94,13 @@ XStringWArray DsdtsList; XObjArray AudioList; // firmware -XBool gFirmwareClover = false; +XBool gFirmwareClover = false; UINTN gEvent; UINT16 gBacklightLevel; //XBool defDSM; -//UINT16 dropDSM; +//UINT16 dropDSM; -XBool ResumeFromCoreStorage = false; +XBool ResumeFromCoreStorage = false; //XBool gRemapSmBiosIsRequire; // QPI @@ -186,7 +186,7 @@ XString8Array CUSTOM_LOADER_SUBENTRY::getLoadOptions() const return LoadOptions; } -UINT8 CUSTOM_LOADER_SUBENTRY::getFlags(bool NoCachesDefault) const +UINT8 CUSTOM_LOADER_SUBENTRY::getFlags(XBool NoCachesDefault) const { UINT8 Flags = parent.getFlags(NoCachesDefault); if ( settings._Arguments.isDefined() ) Flags = OSFLAG_SET(Flags, OSFLAG_NODEFAULTARGS); @@ -226,7 +226,7 @@ const XString8& CUSTOM_LOADER_SUBENTRY::getFullTitle() const { }; -bool SETTINGS_DATA::GUIClass::getDarkEmbedded(bool isDaylight) const { +XBool SETTINGS_DATA::GUIClass::getDarkEmbedded(XBool isDaylight) const { if ( EmbeddedThemeType.isEqualIC("Dark") ) return true; if ( EmbeddedThemeType.isEqualIC("Daytime") ) return !isDaylight; return false; @@ -369,7 +369,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData) { ACPI_DROP_TABLE *DropTable = GlobalConfig.ACPIDropTables; DBG(" - [%02zd]: Drop table : %.4s, %16llx : ", idx, (const char*)&settingsData.ACPI.ACPIDropTablesArray[idx].Signature, settingsData.ACPI.ACPIDropTablesArray[idx].TableId); - bool Dropped = false; + XBool Dropped = false; while (DropTable) { if (((settingsData.ACPI.ACPIDropTablesArray[idx].Signature == DropTable->Signature) && (!settingsData.ACPI.ACPIDropTablesArray[idx].TableId || (DropTable->TableId == settingsData.ACPI.ACPIDropTablesArray[idx].TableId)) && @@ -943,8 +943,8 @@ SetDevices (LOADER_ENTRY *Entry) UINTN Bus; UINTN Device; UINTN Function; - XBool StringDirty = false; - XBool TmpDirty = false; + XBool StringDirty = false; + XBool TmpDirty = false; UINT32 Rcba; UINT32 Hptc; DevPropDevice *device = NULL; @@ -1943,11 +1943,11 @@ XStringW GetOSVersionKextsDir(const MacOsVersion& OSVersion) // Do we need that with OC ? For old version ? //EFI_STATUS LOADER_ENTRY::SetFSInjection() //{ -// EFI_STATUS Status; +// EFI_STATUS Status; // FSINJECTION_PROTOCOL *FSInject; // XStringW SrcDir; -// //XBool InjectionNeeded = false; -// //XBool BlockCaches = false; +// //XBool InjectionNeeded = false; +// //XBool BlockCaches = false; // FSI_STRING_LIST *Blacklist = 0; // FSI_STRING_LIST *ForceLoadKexts = NULL; // diff --git a/rEFIt_UEFI/Platform/Settings.h b/rEFIt_UEFI/Platform/Settings.h index 28cc0a6f7..10dc7f3c3 100755 --- a/rEFIt_UEFI/Platform/Settings.h +++ b/rEFIt_UEFI/Platform/Settings.h @@ -33,7 +33,7 @@ //}; extern CONST CHAR8 *AudioOutputNames[]; -extern XBool gFirmwareClover; +extern XBool gFirmwareClover; class HDA_OUTPUTS @@ -59,8 +59,8 @@ typedef struct { //UINT16 Height; CHAR8 Model[64]; CHAR8 Config[64]; - XBool LoadVBios; -//XBool PatchVBios; + XBool LoadVBios; +//XBool PatchVBios; UINTN Segment; UINTN Bus; UINTN Device; @@ -68,7 +68,7 @@ typedef struct { EFI_HANDLE Handle; UINT8 *Mmio; UINT32 Connectors; - XBool ConnChanged; + XBool ConnChanged; } GFX_PROPERTIES; typedef struct { @@ -93,9 +93,9 @@ public: XString8 Name = XString8(); #if __cplusplus > 201703L - bool operator == (const ACPI_NAME&) const = default; + XBool operator == (const ACPI_NAME&) const = default; #endif - bool isEqual(const ACPI_NAME& other) const + XBool isEqual(const ACPI_NAME& other) const { if ( !(Name == other.Name) ) return false; return true; @@ -126,9 +126,9 @@ public: XString8 renameTo = XString8(); #if __cplusplus > 201703L - bool operator == (const ACPI_RENAME_DEVICE&) const = default; + XBool operator == (const ACPI_RENAME_DEVICE&) const = default; #endif - bool isEqual(const ACPI_RENAME_DEVICE& other) const + XBool isEqual(const ACPI_RENAME_DEVICE& other) const { if ( !acpiName.isEqual(other.acpiName) ) return false; if ( !(renameTo == other.renameTo) ) return false; @@ -161,7 +161,7 @@ public: UINT32 Length; UINT64 TableId; INPUT_ITEM MenuItem = INPUT_ITEM(); - XBool OtherOS; + XBool OtherOS; ACPI_DROP_TABLE() : Next(0), Signature(0), Length(0), TableId(0), OtherOS(false) {} ACPI_DROP_TABLE(const ACPI_DROP_TABLE& other) = delete; // Can be defined if needed @@ -182,7 +182,7 @@ class CUSTOM_LOADER_SUBENTRY; class CUSTOM_LOADER_SUBENTRY_SETTINGS { public: - bool Disabled = 0; + XBool Disabled = false; public: // temporary, must be protected: // member defined with _ prefix should not be accessed from outside. I left them public for now for CompareCustomEntries() undefinable_XString8 _Arguments = undefinable_XString8(); @@ -194,9 +194,9 @@ public: // temporary, must be protected: undefinable_bool _NoCaches = undefinable_bool(); #if __cplusplus > 201703L - bool operator == (const CUSTOM_LOADER_SUBENTRY_SETTINGS&) const = default; + XBool operator == (const CUSTOM_LOADER_SUBENTRY_SETTINGS&) const = default; #endif - bool isEqual(const CUSTOM_LOADER_SUBENTRY_SETTINGS& other) const + XBool isEqual(const CUSTOM_LOADER_SUBENTRY_SETTINGS& other) const { if ( !(Disabled == other.Disabled) ) return false; if ( !(_Arguments == other._Arguments) ) return false; @@ -234,7 +234,7 @@ public: CUSTOM_LOADER_SUBENTRY(const CUSTOM_LOADER_ENTRY& _customLoaderEntry, const CUSTOM_LOADER_SUBENTRY_SETTINGS& _settings) : parent(_customLoaderEntry), settings(_settings) {} XString8Array getLoadOptions() const; - UINT8 getFlags(bool NoCachesDefault) const; + UINT8 getFlags(XBool NoCachesDefault) const; const XString8& getTitle() const; const XString8& getFullTitle() const; @@ -261,7 +261,7 @@ public: EFI_GRAPHICS_OUTPUT_BLT_PIXELClass(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& other) { Blue = other.Blue; Green = other.Green; Red = other.Red; Reserved = other.Reserved; } - bool operator == (const EFI_GRAPHICS_OUTPUT_BLT_PIXELClass& other) const { + XBool operator == (const EFI_GRAPHICS_OUTPUT_BLT_PIXELClass& other) const { if ( !(Blue == other.Blue) ) return false; if ( !(Green == other.Green) ) return false; if ( !(Red == other.Red) ) return false; @@ -273,7 +273,7 @@ public: class CUSTOM_LOADER_ENTRY_SETTINGS { public: - bool Disabled = 0; + XBool Disabled = false; XBuffer ImageData = XBuffer(); XBuffer DriveImageData = XBuffer(); XStringW Volume = XStringW(); @@ -283,10 +283,10 @@ public: XString8 FullTitle = XStringW(); XStringW Settings = XStringW(); // path of a config.plist that'll be read at the beginning of startloader char32_t Hotkey = 0; - XBool CommonSettings = false; + XBool CommonSettings = false; // UINT8 Flags = 0; - bool Hidden = 0; - bool AlwaysHidden = 0; + XBool Hidden = false; + XBool AlwaysHidden = false; UINT8 Type = 0; UINT8 VolumeType = 0; UINT8 KernelScan = KERNEL_SCAN_ALL; @@ -304,14 +304,14 @@ public: // temporary, must be protected: UINT8 CustomLogoTypeSettings = 0; XStringW m_ImagePath = XStringW(); - bool ForceTextMode = 0; // 2021-04-22 + XBool ForceTextMode = false; // 2021-04-22 public: #if __cplusplus > 201703L - bool operator == (const CUSTOM_LOADER_ENTRY_SETTINGS&) const = default; + XBool operator == (const CUSTOM_LOADER_ENTRY_SETTINGS&) const = default; #endif - bool isEqual(const CUSTOM_LOADER_ENTRY_SETTINGS& other) const + XBool isEqual(const CUSTOM_LOADER_ENTRY_SETTINGS& other) const { if ( !(Disabled == other.Disabled) ) return false; if ( !(ImageData == other.ImageData) ) return false; @@ -417,7 +417,7 @@ public: XString8Array getLoadOptions() const; - UINT8 getFlags(bool NoCachesDefault) const { + UINT8 getFlags(XBool NoCachesDefault) const { UINT8 Flags = 0; if ( settings.Arguments.isDefined() ) Flags = OSFLAG_SET(Flags, OSFLAG_NODEFAULTARGS); if ( settings.AlwaysHidden ) Flags = OSFLAG_SET(Flags, OSFLAG_DISABLED); @@ -440,7 +440,7 @@ public: class CUSTOM_LEGACY_ENTRY_SETTINGS { public: - bool Disabled = 0; + XBool Disabled = false; XStringW ImagePath = XStringW(); XBuffer ImageData = XBuffer(); XStringW DriveImagePath = XStringW(); @@ -450,15 +450,15 @@ public: XStringW Title = XStringW(); char32_t Hotkey = 0; // UINT8 Flags = 0; - bool Hidden = 0; - bool AlwaysHidden = 0; + XBool Hidden = false; + XBool AlwaysHidden = false; UINT8 Type = 0; UINT8 VolumeType = 0; #if __cplusplus > 201703L - bool operator == (const CUSTOM_LEGACY_ENTRY_SETTINGS&) const = default; + XBool operator == (const CUSTOM_LEGACY_ENTRY_SETTINGS&) const = default; #endif - bool isEqual(const CUSTOM_LEGACY_ENTRY_SETTINGS& other) const + XBool isEqual(const CUSTOM_LEGACY_ENTRY_SETTINGS& other) const { if ( !(Disabled == other.Disabled) ) return false; if ( !(ImagePath == other.ImagePath) ) return false; @@ -528,7 +528,7 @@ public: class CUSTOM_TOOL_ENTRY_SETTINGS { public: - bool Disabled = 0; + XBool Disabled = false; XStringW ImagePath = XStringW(); XBuffer ImageData = XBuffer(); XStringW Volume = XStringW(); @@ -539,14 +539,14 @@ public: XStringW Title = XStringW(); char32_t Hotkey = 0; // UINT8 Flags = 0; - bool Hidden = 0; - bool AlwaysHidden = 0; + XBool Hidden = false; + XBool AlwaysHidden = false; UINT8 VolumeType = 0; #if __cplusplus > 201703L - bool operator == (const CUSTOM_TOOL_ENTRY_SETTINGS&) const = default; + XBool operator == (const CUSTOM_TOOL_ENTRY_SETTINGS&) const = default; #endif - bool isEqual(const CUSTOM_TOOL_ENTRY_SETTINGS& other) const + XBool isEqual(const CUSTOM_TOOL_ENTRY_SETTINGS& other) const { if ( !(Disabled == other.Disabled) ) return false; if ( !(ImagePath == other.ImagePath) ) return false; @@ -645,9 +645,9 @@ public: XBuffer Replace = XBuffer(); #if __cplusplus > 201703L - bool operator == (const VBIOS_PATCH&) const = default; + XBool operator == (const VBIOS_PATCH&) const = default; #endif - bool isEqual(const VBIOS_PATCH& other) const + XBool isEqual(const VBIOS_PATCH& other) const { if ( !(Find == other.Find) ) return false; if ( !(Replace == other.Replace) ) return false; @@ -666,7 +666,7 @@ class PatchVBiosBytesNewClass : public XObjArrayWithTakeValueFromXmlArray 201703L - bool operator == (const PatchVBiosBytesNewClass& other) const { return XObjArray::operator ==(other); } + XBool operator == (const PatchVBiosBytesNewClass& other) const { return XObjArray::operator ==(other); } #endif // Temporary bridge to old struct. @@ -683,7 +683,7 @@ public: return size(); } - bool isEqual(const PatchVBiosBytesNewClass& other) const + XBool isEqual(const PatchVBiosBytesNewClass& other) const { return XObjArray::isEqual(other); // getVBIOS_PATCH_BYTES(); @@ -705,7 +705,7 @@ public: class SETTINGS_DATA; class ConfigPlistClass; class TagDict; -//bool CompareOldNewSettings(const SETTINGS_DATA& , const ConfigPlistClass& ); +//XBool CompareOldNewSettings(const SETTINGS_DATA& , const ConfigPlistClass& ); //EFI_STATUS GetUserSettings(const TagDict* CfgDict, SETTINGS_DATA& gSettings); class SETTINGS_DATA { @@ -714,22 +714,22 @@ public: class BootClass { public: INTN Timeout = -1; - bool SkipHibernateTimeout = false; - bool DisableCloverHotkeys = false; + XBool SkipHibernateTimeout = false; + XBool DisableCloverHotkeys = false; XString8 BootArgs = XString8(); - bool NeverDoRecovery = 0; - bool LastBootedVolume = false; + XBool NeverDoRecovery = false; + XBool LastBootedVolume = false; XStringW DefaultVolume = XStringW(); XStringW DefaultLoader = XStringW(); - bool DebugLog = false; - bool FastBoot = false; - bool NoEarlyProgress = false; - bool NeverHibernate = false; - bool StrictHibernate = false; - bool RtcHibernateAware = false; - bool HibernationFixup = false; - bool SignatureFixup = false; - INT8 SecureSetting = 0; // 0 == false, 1 == true, -1 == undefined + XBool DebugLog = false; + XBool FastBoot = false; + XBool NoEarlyProgress = false; + XBool NeverHibernate = false; + XBool StrictHibernate = false; + XBool RtcHibernateAware = false; + XBool HibernationFixup = false; + XBool SignatureFixup = false; + INT8 SecureSetting = 0; // 0 == false, 1 == true, -1 == undefined //UINT8 SecureBoot = 0; //UINT8 SecureBootSetupMode = 0; UINT8 SecureBootPolicy = 0; @@ -745,9 +745,9 @@ public: XBuffer CustomLogoAsData = XBuffer(); #if __cplusplus > 201703L - bool operator == (const BootClass&) const = default; + XBool operator == (const BootClass&) const = default; #endif - bool isEqual(const BootClass& other) const + XBool isEqual(const BootClass& other) const { if ( !(Timeout == other.Timeout) ) return false; if ( !(SkipHibernateTimeout == other.SkipHibernateTimeout) ) return false; @@ -820,12 +820,12 @@ public: }; UINT64 TableId = 0; UINT32 TabLength = 0; - bool OtherOS = 0; + XBool OtherOS = false; #if __cplusplus > 201703L - bool operator == (const ACPIDropTablesClass&) const = default; + XBool operator == (const ACPIDropTablesClass&) const = default; #endif - bool isEqual(const ACPIDropTablesClass& other) const + XBool isEqual(const ACPIDropTablesClass& other) const { if ( !(Signature == other.Signature) ) return false; if ( !(TableId == other.TableId) ) return false; @@ -848,7 +848,7 @@ public: class DSDT_Patch { public : - bool Disabled = bool(); + XBool Disabled = XBool(); XString8 PatchDsdtLabel = XString8(); XBuffer PatchDsdtFind = XBuffer(); XBuffer PatchDsdtReplace = XBuffer(); @@ -856,9 +856,9 @@ public: INPUT_ITEM PatchDsdtMenuItem = INPUT_ITEM(); // Not read from config.plist. Should be moved out. #if __cplusplus > 201703L - bool operator == (const DSDT_Patch&) const = default; + XBool operator == (const DSDT_Patch&) const = default; #endif - bool isEqual(const DSDT_Patch& other) const + XBool isEqual(const DSDT_Patch& other) const { if ( !(Disabled == other.Disabled) ) return false; if ( !(PatchDsdtLabel == other.PatchDsdtLabel) ) return false; @@ -880,20 +880,20 @@ public: }; XStringW DsdtName = XStringW(); - bool DebugDSDT = 0; - bool Rtc8Allowed = 0; + XBool DebugDSDT = false; + XBool Rtc8Allowed = false; UINT8 PNLF_UID = 0; UINT32 FixDsdt = 0; - bool ReuseFFFF = 0; - bool SuspendOverride = 0; + XBool ReuseFFFF = false; + XBool SuspendOverride = false; // XObjArray DSDTPatchArray = XObjArray(); XObjArrayWithTakeValueFromXmlArray DSDTPatchArray = XObjArrayWithTakeValueFromXmlArray(); #if __cplusplus > 201703L - bool operator == (const DSDTClass&) const = default; + XBool operator == (const DSDTClass&) const = default; #endif - bool isEqual(const DSDTClass& other) const + XBool isEqual(const DSDTClass& other) const { if ( !(DsdtName == other.DsdtName) ) return false; if ( !(DebugDSDT == other.DebugDSDT) ) return false; @@ -924,16 +924,16 @@ public: class GenerateClass { public: - bool GeneratePStates = 0; - bool GenerateCStates = 0; - bool GenerateAPSN = 0; - bool GenerateAPLF = 0; - bool GeneratePluginType = 0; + XBool GeneratePStates = false; + XBool GenerateCStates = false; + XBool GenerateAPSN = false; + XBool GenerateAPLF = false; + XBool GeneratePluginType = false; #if __cplusplus > 201703L - bool operator == (const GenerateClass&) const = default; + XBool operator == (const GenerateClass&) const = default; #endif - bool isEqual(const GenerateClass& other) const + XBool isEqual(const GenerateClass& other) const { if ( !(GeneratePStates == other.GeneratePStates) ) return false; if ( !(GenerateCStates == other.GenerateCStates) ) return false; @@ -952,27 +952,27 @@ public: } }; - bool DropSSDTSetting = 0; - bool NoOemTableId = 0; - bool NoDynamicExtract = 0; - bool EnableISS = 0; - bool EnableC7 = 0; - bool _EnableC6 = 0; - bool _EnableC4 = 0; - bool _EnableC2 = 0; + XBool DropSSDTSetting = false; + XBool NoOemTableId = false; + XBool NoDynamicExtract = false; + XBool EnableISS = false; + XBool EnableC7 = false; + XBool _EnableC6 = false; + XBool _EnableC4 = false; + XBool _EnableC2 = false; UINT16 _C3Latency = 0; UINT8 PLimitDict = 0; UINT8 UnderVoltStep = 0; - bool DoubleFirstState = 0; + XBool DoubleFirstState = false; UINT8 MinMultiplier = 0; UINT8 MaxMultiplier = 0; UINT8 PluginType = 0; GenerateClass Generate = GenerateClass(); #if __cplusplus > 201703L - bool operator == (const SSDTClass&) const = default; + XBool operator == (const SSDTClass&) const = default; #endif - bool isEqual(const SSDTClass& other) const + XBool isEqual(const SSDTClass& other) const { if ( !(DropSSDTSetting == other.DropSSDTSetting) ) return false; if ( !(NoOemTableId == other.NoOemTableId) ) return false; @@ -1015,13 +1015,13 @@ public: UINT64 ResetAddr = 0; UINT8 ResetVal = 0; - bool SlpSmiEnable = 0; - bool FixHeaders = 0; - bool FixMCFG = 0; - bool NoASPM = 0; - bool smartUPS = 0; - bool PatchNMI = 0; - bool AutoMerge = 0; + XBool SlpSmiEnable = false; + XBool FixHeaders = false; + XBool FixMCFG = false; + XBool NoASPM = false; + XBool smartUPS = false; + XBool PatchNMI = false; + XBool AutoMerge = false; XStringWArray DisabledAML = XStringWArray(); XString8Array SortedACPI = XString8Array(); // XObjArray DeviceRename = XObjArray(); @@ -1066,9 +1066,9 @@ public: SSDTClass SSDT = SSDTClass(); #if __cplusplus > 201703L - bool operator == (const ACPIClass&) const = default; + XBool operator == (const ACPIClass&) const = default; #endif - bool isEqual(const ACPIClass& other) const + XBool isEqual(const ACPIClass& other) const { if ( !(ResetAddr == other.ResetAddr) ) return false; if ( !(ResetVal == other.ResetVal) ) return false; @@ -1112,14 +1112,14 @@ public: class MouseClass { public: INTN PointerSpeed = 0; - bool PointerEnabled = 0; + XBool PointerEnabled = false; UINT64 DoubleClickTime = 0; - bool PointerMirror = 0; + XBool PointerMirror = false; #if __cplusplus > 201703L - bool operator == (const MouseClass&) const = default; + XBool operator == (const MouseClass&) const = default; #endif - bool isEqual(const MouseClass& other) const + XBool isEqual(const MouseClass& other) const { if ( !(PointerSpeed == other.PointerSpeed) ) return false; if ( !(PointerEnabled == other.PointerEnabled) ) return false; @@ -1137,17 +1137,17 @@ public: } ; class ScanClass { public: - bool DisableEntryScan = 0; - bool DisableToolScan = 0; + XBool DisableEntryScan = false; + XBool DisableToolScan = false; UINT8 KernelScan = 0; - bool LinuxScan = 0; - bool LegacyFirst = false; - bool NoLegacy = false; + XBool LinuxScan = false; + XBool LegacyFirst = false; + XBool NoLegacy = false; #if __cplusplus > 201703L - bool operator == (const ScanClass&) const = default; + XBool operator == (const ScanClass&) const = default; #endif - bool isEqual(const ScanClass& other) const + XBool isEqual(const ScanClass& other) const { if ( !(DisableEntryScan == other.DisableEntryScan) ) return false; if ( !(DisableToolScan == other.DisableToolScan) ) return false; @@ -1170,18 +1170,18 @@ public: INT32 Timezone = 0xFF; XStringW Theme = XStringW(); - //bool DarkEmbedded = 0; + //XBool DarkEmbedded = 0; XString8 EmbeddedThemeType = XString8(); - bool PlayAsync = 0; - bool CustomIcons = false; - bool TextOnly = false; - bool ShowOptimus = false; + XBool PlayAsync = false; + XBool CustomIcons = false; + XBool TextOnly = false; + XBool ShowOptimus = false; XStringW ScreenResolution = XStringW(); - bool ProvideConsoleGop = 0; + XBool ProvideConsoleGop = false; INTN ConsoleMode = 0; XString8 Language = XString8(); LanguageCode languageCode = english; - bool KbdPrevLang = 0; + XBool KbdPrevLang = false; XString8Array HVHideStrings = XString8Array(); ScanClass Scan = ScanClass(); MouseClass Mouse = MouseClass(); @@ -1195,12 +1195,12 @@ public: XObjArrayWithTakeValueFromXmlArray CustomToolSettings = XObjArrayWithTakeValueFromXmlArray(); - bool getDarkEmbedded(bool isDaylight) const; + XBool getDarkEmbedded(XBool isDaylight) const; #if __cplusplus > 201703L - bool operator == (const GUIClass&) const = default; + XBool operator == (const GUIClass&) const = default; #endif - bool isEqual(const GUIClass& other) const + XBool isEqual(const GUIClass& other) const { if ( !(Timezone == other.Timezone) ) return false; if ( !(Theme == other.Theme) ) return false; @@ -1253,23 +1253,23 @@ public: UINT16 QPI = 0; UINT32 CpuFreqMHz = 0; UINT16 CpuType = 0; - bool QEMU = 0; - bool UseARTFreq = 0; + XBool QEMU = false; + XBool UseARTFreq = false; UINT32 BusSpeed = 0; //in kHz - bool UserChange = 0; + XBool UserChange = false; UINT8 SavingMode = 0; - bool HWPEnable = false; + XBool HWPEnable = false; undefinable_uint32 HWPValue = undefinable_uint32(); UINT8 TDP = 0; - bool TurboDisabled = 0; + XBool TurboDisabled = false; undefinable_bool _EnableC6 = undefinable_bool(); undefinable_bool _EnableC4 = undefinable_bool(); undefinable_bool _EnableC2 = undefinable_bool(); #if __cplusplus > 201703L - bool operator == (const CPUClass&) const = default; + XBool operator == (const CPUClass&) const = default; #endif - bool isEqual(const CPUClass& other) const + XBool isEqual(const CPUClass& other) const { if ( !(QPI == other.QPI) ) return false; if ( !(CpuFreqMHz == other.CpuFreqMHz) ) return false; @@ -1310,24 +1310,24 @@ public: class SystemParametersClass { public: - bool WithKexts = true; - bool WithKextsIfNoFakeSMC = 0; - bool NoCaches = 0; + XBool WithKexts = true; + XBool WithKextsIfNoFakeSMC = false; + XBool NoCaches = false; uint16_t BacklightLevel = 0xFFFF; - bool BacklightLevelConfig = false; + XBool BacklightLevelConfig = false; XString8 CustomUuid = XString8(); public: // temporary, must be protected: UINT8 _InjectSystemID = 2; // 0=false, 1=true, other value = default. public: - bool NvidiaWeb = 0; + XBool NvidiaWeb = false; // friend class ::SETTINGS_DATA; // friend unsigned long long ::GetUserSettings(const TagDict* CfgDict, SETTINGS_DATA& gSettings); #if __cplusplus > 201703L - bool operator == (const SystemParametersClass&) const = default; + XBool operator == (const SystemParametersClass&) const = default; #endif - bool isEqual(const SystemParametersClass& other) const + XBool isEqual(const SystemParametersClass& other) const { if ( !(WithKexts == other.WithKexts) ) return false; if ( !(WithKextsIfNoFakeSMC == other.WithKextsIfNoFakeSMC) ) return false; @@ -1356,7 +1356,7 @@ public: public: class EDIDClass { public: - bool InjectEDID = bool(); + XBool InjectEDID = XBool(); XBuffer CustomEDID = XBuffer (); UINT16 VendorEDID = UINT16(); UINT16 ProductEDID = UINT16(); @@ -1364,9 +1364,9 @@ public: UINT8 EdidFixVideoInputSignal = UINT8(); #if __cplusplus > 201703L - bool operator == (const EDIDClass&) const = default; + XBool operator == (const EDIDClass&) const = default; #endif - bool isEqual(const EDIDClass& other) const + XBool isEqual(const EDIDClass& other) const { if ( !(InjectEDID == other.InjectEDID) ) return false; if ( !(CustomEDID == other.CustomEDID) ) return false; @@ -1389,15 +1389,15 @@ public: class InjectAsDictClass { public: - bool GraphicsInjector = bool(); - bool InjectIntel = bool(); - bool InjectATI = bool(); - bool InjectNVidia = bool(); + XBool GraphicsInjector = XBool(); + XBool InjectIntel = XBool(); + XBool InjectATI = XBool(); + XBool InjectNVidia = XBool(); #if __cplusplus > 201703L - bool operator == (const InjectAsDictClass&) const = default; + XBool operator == (const InjectAsDictClass&) const = default; #endif - bool isEqual(const InjectAsDictClass& other) const + XBool isEqual(const InjectAsDictClass& other) const { if ( !(GraphicsInjector == other.GraphicsInjector) ) return false; if ( !(InjectIntel == other.InjectIntel) ) return false; @@ -1422,12 +1422,12 @@ public: UINT32 SubId = 0; UINT64 VideoRam = 0; UINTN VideoPorts = 0; - bool LoadVBios = 0; + XBool LoadVBios = false; #if __cplusplus > 201703L - bool operator == (const GRAPHIC_CARD&) const = default; + XBool operator == (const GRAPHIC_CARD&) const = default; #endif - bool isEqual(const GRAPHIC_CARD& other) const + XBool isEqual(const GRAPHIC_CARD& other) const { if ( !(Signature == other.Signature) ) return false; if ( !(Model == other.Model) ) return false; @@ -1450,18 +1450,18 @@ public: } }; - bool PatchVBios = bool(); + XBool PatchVBios = XBool(); PatchVBiosBytesNewClass PatchVBiosBytes = PatchVBiosBytesNewClass(); // undefinable_bool InjectAsBool = undefinable_bool(); - bool RadeonDeInit = bool(); - bool LoadVBios = bool(); - UINT64 VRAM = bool(); + XBool RadeonDeInit = XBool(); + XBool LoadVBios = XBool(); + UINT64 VRAM = XBool(); UINT32 RefCLK = UINT32(); XStringW FBName = XStringW(); UINT16 VideoPorts = UINT16(); - bool NvidiaGeneric = bool(); - bool NvidiaNoEFI = bool(); - bool NvidiaSingle = bool(); + XBool NvidiaGeneric = XBool(); + XBool NvidiaNoEFI = XBool(); + XBool NvidiaSingle = XBool(); XArray Dcfg = XArray(); XArray NVCAP = XArray(); INT8 BootDisplay = INT8(); @@ -1480,9 +1480,9 @@ public: } #if __cplusplus > 201703L - bool operator == (const GraphicsClass&) const = default; + XBool operator == (const GraphicsClass&) const = default; #endif - bool isEqual(const GraphicsClass& other) const + XBool isEqual(const GraphicsClass& other) const { if ( !(PatchVBios == other.PatchVBios) ) return false; if ( !PatchVBiosBytes.isEqual(other.PatchVBiosBytes) ) return false; @@ -1530,10 +1530,10 @@ public: NVIDIACardList.takeValueFrom(configPlist.NVIDIA); } - //bool getGraphicsInjector() const { return InjectAsBool.isDefined() ? InjectAsBool.value() : InjectAsDict.GraphicsInjector; } - //bool InjectIntel() const { return InjectAsBool.isDefined() ? InjectAsBool.value() : InjectAsDict.InjectIntel; } - //bool InjectATI() const { return InjectAsBool.isDefined() ? InjectAsBool.value() : InjectAsDict.InjectATI; } - //bool InjectNVidia() const { return InjectAsBool.isDefined() ? InjectAsBool.value() : InjectAsDict.InjectNVidia; } + //XBool getGraphicsInjector() const { return InjectAsBool.isDefined() ? InjectAsBool.value() : InjectAsDict.GraphicsInjector; } + //XBool InjectIntel() const { return InjectAsBool.isDefined() ? InjectAsBool.value() : InjectAsDict.InjectIntel; } + //XBool InjectATI() const { return InjectAsBool.isDefined() ? InjectAsBool.value() : InjectAsDict.InjectATI; } + //XBool InjectNVidia() const { return InjectAsBool.isDefined() ? InjectAsBool.value() : InjectAsDict.InjectNVidia; } }; @@ -1542,15 +1542,15 @@ public: class AudioClass { public: - bool ResetHDA = bool(); - bool HDAInjection = bool(); + XBool ResetHDA = XBool(); + XBool HDAInjection = XBool(); INT32 HDALayoutId = INT32(); - bool AFGLowPowerState = bool(); + XBool AFGLowPowerState = XBool(); #if __cplusplus > 201703L - bool operator == (const AudioClass&) const = default; + XBool operator == (const AudioClass&) const = default; #endif - bool isEqual(const AudioClass& other) const + XBool isEqual(const AudioClass& other) const { if ( !(ResetHDA == other.ResetHDA) ) return false; if ( !(HDAInjection == other.HDAInjection) ) return false; @@ -1568,17 +1568,17 @@ public: }; class USBClass { public: - bool USBInjection = bool(); - bool USBFixOwnership = bool(); - bool InjectClockID = bool(); - bool HighCurrent = bool(); - bool NameEH00 = bool(); - bool NameXH00 = bool(); // is it used? + XBool USBInjection = XBool(); + XBool USBFixOwnership = XBool(); + XBool InjectClockID = XBool(); + XBool HighCurrent = XBool(); + XBool NameEH00 = XBool(); + XBool NameXH00 = XBool(); // is it used? #if __cplusplus > 201703L - bool operator == (const USBClass&) const = default; + XBool operator == (const USBClass&) const = default; #endif - bool isEqual(const USBClass& other) const + XBool isEqual(const USBClass& other) const { if ( !(USBInjection == other.USBInjection) ) return false; if ( !(USBFixOwnership == other.USBFixOwnership) ) return false; @@ -1613,9 +1613,9 @@ public: AddPropertyClass() {} #if __cplusplus > 201703L - bool operator == (const AddPropertyClass&) const = default; + XBool operator == (const AddPropertyClass&) const = default; #endif - bool isEqual(const AddPropertyClass& other) const + XBool isEqual(const AddPropertyClass& other) const { if ( !(Device == other.Device) ) return false; if ( !(Key == other.Key) ) return false; @@ -1650,9 +1650,9 @@ public: SimplePropertyClass() {} #if __cplusplus > 201703L - bool operator == (const SimplePropertyClass&) const = default; + XBool operator == (const SimplePropertyClass&) const = default; #endif - bool isEqual(const SimplePropertyClass& other) const + XBool isEqual(const SimplePropertyClass& other) const { if ( !(Key == other.Key) ) return false; if ( !(Value == other.Value) ) return false; @@ -1684,7 +1684,7 @@ public: { public: - bool Enabled = true; + XBool Enabled = true; XStringW DevicePathAsString = XStringW(); // XString8 Label = XString8(); // Label is the same as DevicePathAsString, so it's not needed. XObjArrayWithTakeValueFromXmlRepeatingDict propertiesArray = XObjArrayWithTakeValueFromXmlRepeatingDict(); @@ -1707,9 +1707,9 @@ public: #endif #if __cplusplus > 201703L - bool operator == (const PropertyClass&) const = default; + XBool operator == (const PropertyClass&) const = default; #endif - bool isEqual(const PropertyClass& other) const + XBool isEqual(const PropertyClass& other) const { if ( !(Enabled == other.Enabled) ) return false; if ( !(DevicePathAsString == other.DevicePathAsString) ) return false; @@ -1730,9 +1730,9 @@ public: XObjArrayWithTakeValueFromXmlRepeatingDict PropertyArray = XObjArrayWithTakeValueFromXmlRepeatingDict(); #if __cplusplus > 201703L - bool operator == (const PropertiesClass&) const = default; + XBool operator == (const PropertiesClass&) const = default; #endif - bool isEqual(const PropertiesClass& other) const + XBool isEqual(const PropertiesClass& other) const { if ( !(propertiesAsString == other.propertiesAsString) ) return false; if ( !PropertyArray.isEqual(other.PropertyArray) ) return false; @@ -1753,9 +1753,9 @@ public: ArbitraryPropertyClass() {} #if __cplusplus > 201703L - bool operator == (const ArbitraryPropertyClass&) const = default; + XBool operator == (const ArbitraryPropertyClass&) const = default; #endif - bool isEqual(const ArbitraryPropertyClass& other) const + XBool isEqual(const ArbitraryPropertyClass& other) const { if ( !(Device == other.Device) ) return false; if ( !(Label == other.Label) ) return false; @@ -1783,9 +1783,9 @@ public: UINT32 FakeIMEI = UINT32(); //106 #if __cplusplus > 201703L - bool operator == (const FakeIDClass&) const = default; + XBool operator == (const FakeIDClass&) const = default; #endif - bool isEqual(const FakeIDClass& other) const + XBool isEqual(const FakeIDClass& other) const { if ( !(FakeATI == other.FakeATI) ) return false; if ( !(FakeNVidia == other.FakeNVidia) ) return false; @@ -1810,15 +1810,15 @@ public: } }; - bool StringInjector = bool(); - bool IntelMaxBacklight = bool(); - bool IntelBacklight = bool(); + XBool StringInjector = XBool(); + XBool IntelMaxBacklight = XBool(); + XBool IntelBacklight = XBool(); UINT32 IntelMaxValue = UINT32(); - bool LANInjection = bool(); - bool HDMIInjection = bool(); - bool NoDefaultProperties = bool(); - bool UseIntelHDMI = bool(); - bool ForceHPET = bool(); + XBool LANInjection = XBool(); + XBool HDMIInjection = XBool(); + XBool NoDefaultProperties = XBool(); + XBool UseIntelHDMI = XBool(); + XBool ForceHPET = XBool(); UINT32 DisableFunctions = UINT32(); XString8 AirportBridgeDeviceName = XString8(); AudioClass Audio = AudioClass(); @@ -1831,9 +1831,9 @@ public: #if __cplusplus > 201703L - bool operator == (const DevicesClass&) const = default; + XBool operator == (const DevicesClass&) const = default; #endif - bool isEqual(const DevicesClass& other) const + XBool isEqual(const DevicesClass& other) const { if ( !(StringInjector == other.StringInjector) ) return false; if ( !(IntelMaxBacklight == other.IntelMaxBacklight) ) return false; @@ -1882,7 +1882,7 @@ public: public: void FillDevicePropertiesOld(SETTINGS_DATA& gSettings, const TagDict* DevicesDict); - bool compareDevProperty(const XString8& label, const DEV_PROPERTY& oldProp, const DEV_PROPERTY& newProp) const + XBool compareDevProperty(const XString8& label, const DEV_PROPERTY& oldProp, const DEV_PROPERTY& newProp) const { if ( newProp.Device != oldProp.Device ) { @@ -1958,7 +1958,7 @@ printf("%s", ""); return true; } - bool compareOldAndCompatibleArb() + XBool compareOldAndCompatibleArb() { // { // size_t oldArbIdx = 0; @@ -2050,12 +2050,12 @@ printf("%s", ""); public : UINTN address = 0; XString8 comment = XString8(); - bool enabled = 0; + XBool enabled = false; #if __cplusplus > 201703L - bool operator == (const MMIOWhiteList&) const = default; + XBool operator == (const MMIOWhiteList&) const = default; #endif - bool isEqual(const MMIOWhiteList& other) const + XBool isEqual(const MMIOWhiteList& other) const { if ( !(address == other.address) ) return false; if ( !(comment == other.comment) ) return false; @@ -2072,28 +2072,28 @@ printf("%s", ""); class OcKernelQuirksClass { public: - // bool AppleCpuPmCfgLock = false; - // bool AppleXcpmCfgLock = false; - bool AppleXcpmExtraMsrs = false; - bool AppleXcpmForceBoost = false; - // bool CustomSmbiosGuid = false; - bool DisableIoMapper = false; - bool DisableLinkeditJettison = false; - // bool DisableRtcChecksum = false; - bool DummyPowerManagement = false; - bool ExtendBTFeatureFlags = false; - bool ExternalDiskIcons = false; - bool IncreasePciBarSize = false; - // bool LapicKernelPanic = false; - // bool PanicNoKextDump = false; - bool PowerTimeoutKernelPanic = false; - bool ThirdPartyDrives = false; - bool XhciPortLimit = false; + // XBool AppleCpuPmCfgLock = false; + // XBool AppleXcpmCfgLock = false; + XBool AppleXcpmExtraMsrs = false; + XBool AppleXcpmForceBoost = false; + // XBool CustomSmbiosGuid = false; + XBool DisableIoMapper = false; + XBool DisableLinkeditJettison = false; + // XBool DisableRtcChecksum = false; + XBool DummyPowerManagement = false; + XBool ExtendBTFeatureFlags = false; + XBool ExternalDiskIcons = false; + XBool IncreasePciBarSize = false; + // XBool LapicKernelPanic = false; + // XBool PanicNoKextDump = false; + XBool PowerTimeoutKernelPanic = false; + XBool ThirdPartyDrives = false; + XBool XhciPortLimit = false; #if __cplusplus > 201703L - bool operator == (const OcKernelQuirksClass&) const = default; + XBool operator == (const OcKernelQuirksClass&) const = default; #endif - bool isEqual(const OcKernelQuirksClass& other) const + XBool isEqual(const OcKernelQuirksClass& other) const { if ( !(AppleXcpmExtraMsrs == other.AppleXcpmExtraMsrs) ) return false; if ( !(AppleXcpmForceBoost == other.AppleXcpmForceBoost) ) return false; @@ -2127,28 +2127,28 @@ printf("%s", ""); class OcBooterQuirksClass { public: - bool AvoidRuntimeDefrag = false; - bool DevirtualiseMmio = false; - bool DisableSingleUser = false; - bool DisableVariableWrite = false; - bool DiscardHibernateMap = false; - bool EnableSafeModeSlide = false; - bool EnableWriteUnprotector = false; - bool ForceExitBootServices = false; - bool ProtectMemoryRegions = false; - bool ProtectSecureBoot = false; - bool ProtectUefiServices = false; - bool ProvideCustomSlide = false; + XBool AvoidRuntimeDefrag = false; + XBool DevirtualiseMmio = false; + XBool DisableSingleUser = false; + XBool DisableVariableWrite = false; + XBool DiscardHibernateMap = false; + XBool EnableSafeModeSlide = false; + XBool EnableWriteUnprotector = false; + XBool ForceExitBootServices = false; + XBool ProtectMemoryRegions = false; + XBool ProtectSecureBoot = false; + XBool ProtectUefiServices = false; + XBool ProvideCustomSlide = false; uint8_t ProvideMaxSlide = false; - bool RebuildAppleMemoryMap = false; - bool SetupVirtualMap = false; - bool SignalAppleOS = false; - bool SyncRuntimePermissions = false; + XBool RebuildAppleMemoryMap = false; + XBool SetupVirtualMap = false; + XBool SignalAppleOS = false; + XBool SyncRuntimePermissions = false; #if __cplusplus > 201703L - bool operator == (const OcBooterQuirksClass&) const = default; + XBool operator == (const OcBooterQuirksClass&) const = default; #endif - bool isEqual(const OcBooterQuirksClass& other) const + XBool isEqual(const OcBooterQuirksClass& other) const { if ( !(AvoidRuntimeDefrag == other.AvoidRuntimeDefrag) ) return false; if ( !(DevirtualiseMmio == other.DevirtualiseMmio) ) return false; @@ -2192,7 +2192,7 @@ printf("%s", ""); }; - bool FuzzyMatch = bool(); + XBool FuzzyMatch = XBool(); XString8 OcKernelCache = XString8(); // UINTN MaxSlide; OcKernelQuirksClass OcKernelQuirks = OcKernelQuirksClass(); @@ -2201,9 +2201,9 @@ printf("%s", ""); UINT32 QuirksMask = 0; #if __cplusplus > 201703L - bool operator == (const QuirksClass&) const = default; + XBool operator == (const QuirksClass&) const = default; #endif - bool isEqual(const QuirksClass& other) const + XBool isEqual(const QuirksClass& other) const { if ( !(FuzzyMatch == other.FuzzyMatch) ) return false; if ( !(OcKernelCache == other.OcKernelCache) ) return false; @@ -2229,15 +2229,15 @@ printf("%s", ""); class RT_VARIABLES { public: - bool Disabled = bool(); + XBool Disabled = XBool(); XString8 Comment = XStringW(); XStringW Name = XStringW(); EFI_GUIDClass Guid = EFI_GUIDClass(); #if __cplusplus > 201703L - bool operator == (const RT_VARIABLES&) const = default; + XBool operator == (const RT_VARIABLES&) const = default; #endif - bool isEqual(const RT_VARIABLES& other) const + XBool isEqual(const RT_VARIABLES& other) const { if ( !(Disabled == other.Disabled) ) return false; if ( !(Comment == other.Comment) ) return false; @@ -2262,14 +2262,14 @@ printf("%s", ""); XString8 BooterCfgStr = XString8(); XObjArrayWithTakeValueFromXmlArray BlockRtVariableArray = XObjArrayWithTakeValueFromXmlArray(); - bool GetLegacyLanAddress() const { + XBool GetLegacyLanAddress() const { return RtROMAsString.isEqualIC("UseMacAddr0") || RtROMAsString.isEqualIC("UseMacAddr1"); } #if __cplusplus > 201703L - bool operator == (const RtVariablesClass&) const = default; + XBool operator == (const RtVariablesClass&) const = default; #endif - bool isEqual(const RtVariablesClass& other) const + XBool isEqual(const RtVariablesClass& other) const { if ( !(RtROMAsString == other.RtROMAsString) ) return false; if ( !(RtROMAsData == other.RtROMAsData) ) return false; @@ -2311,9 +2311,9 @@ printf("%s", ""); SlotDeviceClass() {} #if __cplusplus > 201703L - bool operator == (const SLOT_DEVICE&) const = default; + XBool operator == (const SLOT_DEVICE&) const = default; #endif - bool isEqual(const SlotDeviceClass& other) const + XBool isEqual(const SlotDeviceClass& other) const { if ( !(SmbiosIndex == other.SmbiosIndex) ) return false; if ( !(SlotID == other.SlotID) ) return false; @@ -2333,7 +2333,7 @@ printf("%s", ""); class SlotDeviceArrayClass : public XObjArrayWithTakeValueFromXmlArray { public: - bool doesSlotForIndexExist(uint8_t idx2Look4) const { + XBool doesSlotForIndexExist(uint8_t idx2Look4) const { for ( size_t idx = 0 ; idx < size() ; ++idx ) { if ( ElementAt(idx).SmbiosIndex == idx2Look4 ) return true; } @@ -2363,14 +2363,14 @@ printf("%s", ""); XString8 PartNo = XString8(); XString8 SerialNo = XString8(); UINT8 Type = UINT8(); - bool InUse = bool(); + XBool InUse = XBool(); RamSlotInfo() {} #if __cplusplus > 201703L - bool operator == (const RamSlotInfo&) const = default; + XBool operator == (const RamSlotInfo&) const = default; #endif - bool isEqual(const RamSlotInfo& other) const + XBool isEqual(const RamSlotInfo& other) const { if ( !(Slot == other.Slot ) ) return false; if ( !(ModuleSize == other.ModuleSize ) ) return false; @@ -2382,7 +2382,7 @@ printf("%s", ""); if ( !(InUse == other.InUse ) ) return false; return true; } - bool takeValueFrom(const SmbiosPlistClass::SmbiosDictClass::MemoryDictClass::ModuleDictClass& other) + XBool takeValueFrom(const SmbiosPlistClass::SmbiosDictClass::MemoryDictClass::ModuleDictClass& other) { Slot = other.dgetSlotNo(); ModuleSize = other.dgetModuleSize(); @@ -2405,9 +2405,9 @@ printf("%s", ""); RamSlotInfoArrayClass() {} #if __cplusplus > 201703L - bool operator == (const RamSlotInfoArrayClass&) const = default; + XBool operator == (const RamSlotInfoArrayClass&) const = default; #endif - bool isEqual(const RamSlotInfoArrayClass& other) const + XBool isEqual(const RamSlotInfoArrayClass& other) const { if ( !(SlotCounts == other.SlotCounts) ) return false; if ( !(UserChannels == other.UserChannels) ) return false; @@ -2444,7 +2444,7 @@ printf("%s", ""); XString8 BoardVersion = XString8(); UINT8 BoardType = UINT8(); // SMBIOS TYPE3 - bool Mobile = bool(); + XBool Mobile = XBool(); UINT8 ChassisType = UINT8(); XString8 ChassisManufacturer = XString8(); XString8 ChassisAssetTag = XString8(); @@ -2459,12 +2459,12 @@ printf("%s", ""); // XString8 MemorySpeed; // SMBIOS TYPE131 // SMBIOS TYPE132 - bool TrustSMBIOS = 0; - bool InjectMemoryTables = bool(); // same as Memory.SlotCounts + XBool TrustSMBIOS = false; + XBool InjectMemoryTables = XBool(); // same as Memory.SlotCounts // SMBIOS TYPE133 UINT64 gPlatformFeature = UINT64(); // PatchTableType11 - bool NoRomInfo = bool(); + XBool NoRomInfo = XBool(); UINT32 FirmwareFeatures = UINT32(); UINT32 FirmwareFeaturesMask = UINT32(); @@ -2476,9 +2476,9 @@ printf("%s", ""); SmbiosClass() {} #if __cplusplus > 201703L - bool operator == (const SmbiosClass&) const = default; + XBool operator == (const SmbiosClass&) const = default; #endif - bool isEqual(const SmbiosClass& other) const + XBool isEqual(const SmbiosClass& other) const { // SMBIOS TYPE0 if ( !(BiosVendor == other.BiosVendor) ) return false; @@ -2587,9 +2587,9 @@ printf("%s", ""); } #if __cplusplus > 201703L - bool operator == (const BootGraphicsClass&) const = default; + XBool operator == (const BootGraphicsClass&) const = default; #endif - bool isEqual(const BootGraphicsClass& other) const + XBool isEqual(const BootGraphicsClass& other) const { if ( !(DefaultBackgroundColor == other.DefaultBackgroundColor) ) return false; if ( !(UIScale == other.UIScale) ) return false; @@ -2623,16 +2623,16 @@ printf("%s", ""); //other // UINT16 DropOEM_DSM; // not used anymore. -// XBool LpcTune; // never set to true. +// XBool LpcTune; // never set to true. SETTINGS_DATA() {} // SETTINGS_DATA(const SETTINGS_DATA& other) = delete; // Can be defined if needed // const SETTINGS_DATA& operator = ( const SETTINGS_DATA & ) = delete; // Can be defined if needed #if __cplusplus > 201703L - bool operator == (const SETTINGS_DATA&) const = default; + XBool operator == (const SETTINGS_DATA&) const = default; #endif - bool isEqual(const SETTINGS_DATA& other) const + XBool isEqual(const SETTINGS_DATA& other) const { if ( !Boot.isEqual(other.Boot) ) return false; if ( !ACPI.isEqual(other.ACPI) ) return false; @@ -2673,25 +2673,25 @@ printf("%s", ""); const XString8& getUUID(EFI_GUIDClass* efiGuid); // If CustomUuid is defined, return false by default // If SmUUID is defined, return true by default. - bool ShouldInjectSystemID() { + XBool ShouldInjectSystemID() { if ( SystemParameters.CustomUuid.notEmpty() && SystemParameters.CustomUuid != nullGuidAsString ) { if ( SystemParameters._InjectSystemID == 2 ) return false; - else return SystemParameters._InjectSystemID; + else return SystemParameters._InjectSystemID != 0; } if ( Smbios.SmUUID.isEmpty() || Smbios.SmUUID == nullGuidAsString ) return false; if ( SystemParameters._InjectSystemID == 2 ) return true; - return SystemParameters._InjectSystemID; + return SystemParameters._InjectSystemID != 0; } - bool getEnableC6() const { + XBool getEnableC6() const { if ( CPU._EnableC6.isDefined() ) return CPU._EnableC6.value(); return ACPI.SSDT._EnableC6; } - bool getEnableC4() const { + XBool getEnableC4() const { if ( CPU._EnableC4.isDefined() ) return CPU._EnableC4.value(); return ACPI.SSDT._EnableC4; } - bool getEnableC2() const { + XBool getEnableC2() const { if ( CPU._EnableC2.isDefined() ) return CPU._EnableC2.value(); return ACPI.SSDT._EnableC2; } @@ -2762,7 +2762,7 @@ extern INTN OldChosenTheme; extern INTN OldChosenConfig; extern INTN OldChosenDsdt; extern UINTN OldChosenAudio; -extern XBool SavePreBootLog; +extern XBool SavePreBootLog; extern UINT8 DefaultAudioVolume; @@ -2772,7 +2772,7 @@ extern UINT8 DefaultAudioVolume; //extern UINTN NHDA; //extern UINT16 gCPUtype; extern SETTINGS_DATA gSettings; -extern XBool gFirmwareClover; +extern XBool gFirmwareClover; extern DRIVERS_FLAGS gDriversFlags; extern EFI_EDID_DISCOVERED_PROTOCOL *EdidDiscovered; //extern UINT8 *gEDID; @@ -2781,7 +2781,7 @@ extern UINTN gEvent; extern UINT16 gBacklightLevel; -//extern XBool defDSM; +//extern XBool defDSM; //extern UINT16 dropDSM; //extern TagDict* gConfigDict[]; @@ -2797,8 +2797,8 @@ extern XObjArray ACPIPatchedAML; extern CHAR16 *IconFormat; -extern XBool ResumeFromCoreStorage; -//extern XBool gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here +extern XBool ResumeFromCoreStorage; +//extern XBool gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here extern EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl; @@ -2811,8 +2811,8 @@ class REFIT_CONFIG { public: UINTN DisableFlags = 0; //to disable some volume types (optical, firewire etc) - XBool Quiet = true; - XBool SpecialBootMode = false; // content of nvram var "aptiofixflag" + XBool Quiet = true; + XBool SpecialBootMode = false; // content of nvram var "aptiofixflag" XBool gBootChanged = false; XBool gThemeChanged = false; @@ -2822,18 +2822,18 @@ public: UINT8 CustomLogoType = 0; // this will be initialized with gSettings.Boot.CustomBoot and set back to CUSTOM_BOOT_DISABLED if CustomLogo could not be loaded or decoded (see afterGetUserSettings) XImage *CustomLogo = 0; - bool DropSSDT = 0; // init with gSettings.Boot.DropSSDTSetting. Put back to false if one table is dropped (see afterGetUserSettings) + XBool DropSSDT = false; // init with gSettings.Boot.DropSSDTSetting. Put back to false if one table is dropped (see afterGetUserSettings) UINT8 SecureBoot = 0; UINT8 SecureBootSetupMode = 0; - XBool SetTable132 = false; - XBool HWP = false; + XBool SetTable132 = false; + XBool HWP = false; - bool EnableC6 = 0; - bool EnableC4 = 0; - bool EnableC2 = 0; - uint16_t C3Latency = 0; + XBool EnableC6 = false; + XBool EnableC4 = false; + XBool EnableC2 = false; + uint16_t C3Latency = 0; XObjArray CustomEntries = XObjArray(); XObjArray CustomLegacyEntries = XObjArray(); @@ -2842,28 +2842,28 @@ public: INTN Codepage = 0xC0; INTN CodepageSize = 0xC0; - bool KPKernelPm = bool(); - bool KPAppleIntelCPUPM = bool(); + XBool KPKernelPm = XBool(); + XBool KPAppleIntelCPUPM = XBool(); XBuffer RtROM = XBuffer(); XString8 RtMLB = XString8(); - bool Turbo = true; + XBool Turbo = true; - XString8 OEMProductFromSmbios = XString8(); - XString8 OEMVendorFromSmbios = XString8(); - XString8 OEMBoardFromSmbios = XString8(); - UINT8 EnabledCores = 0; + XString8 OEMProductFromSmbios = XString8(); + XString8 OEMVendorFromSmbios = XString8(); + XString8 OEMBoardFromSmbios = XString8(); + UINT8 EnabledCores = 0; // XStringW ConfigName; // Set but never used - UINT32 OptionsBits = 0; - UINT32 FlagsBits = 0; + UINT32 OptionsBits = 0; + UINT32 FlagsBits = 0; XStringW BlockKexts = XStringW(); // KernelAndKextPatches - XBool KextPatchesAllowed = true; - XBool KernelPatchesAllowed = true; //From GUI: Only for user patches, not internal Clover + XBool KextPatchesAllowed = true; + XBool KernelPatchesAllowed = true; //From GUI: Only for user patches, not internal Clover XString8 BiosVersionUsed = XString8(); XString8 EfiVersionUsed = XString8(); @@ -2880,7 +2880,7 @@ public: const REFIT_CONFIG& operator = ( const REFIT_CONFIG & ) = delete; // Can be defined if needed ~REFIT_CONFIG() { } - bool isFastBoot() { return SpecialBootMode || gSettings.Boot.FastBoot; } + XBool isFastBoot() { return SpecialBootMode || gSettings.Boot.FastBoot; } } ; diff --git a/rEFIt_UEFI/Platform/SmbiosFillPatchingValues.cpp b/rEFIt_UEFI/Platform/SmbiosFillPatchingValues.cpp index 3b0ca5679..8116b0ee6 100644 --- a/rEFIt_UEFI/Platform/SmbiosFillPatchingValues.cpp +++ b/rEFIt_UEFI/Platform/SmbiosFillPatchingValues.cpp @@ -70,7 +70,7 @@ static void SmbiosFillPatchingValues(const SETTINGS_DATA::SmbiosClass::RamSlotIn SmbiosFillPatchingValues(other.User, &Memory._User); } -void SmbiosFillPatchingValues(bool _SetTable132, uint8_t pEnabledCores, uint16_t pRamSlotCount, const SlotDeviceArrayClass& SlotDeviceArray, const SETTINGS_DATA& globalSettings, const CPU_STRUCTURE& CPUStructure, SmbiosInjectedSettings* smbiosInjectedSettingsPtr) +void SmbiosFillPatchingValues(XBool _SetTable132, uint8_t pEnabledCores, uint16_t pRamSlotCount, const SlotDeviceArrayClass& SlotDeviceArray, const SETTINGS_DATA& globalSettings, const CPU_STRUCTURE& CPUStructure, SmbiosInjectedSettings* smbiosInjectedSettingsPtr) { SmbiosInjectedSettings& smbiosInjectedSetting = *smbiosInjectedSettingsPtr; // from CPUStructure diff --git a/rEFIt_UEFI/Platform/SmbiosFillPatchingValues.h b/rEFIt_UEFI/Platform/SmbiosFillPatchingValues.h index 2f71604ad..1231b1f6d 100644 --- a/rEFIt_UEFI/Platform/SmbiosFillPatchingValues.h +++ b/rEFIt_UEFI/Platform/SmbiosFillPatchingValues.h @@ -12,7 +12,7 @@ #include "../Platform/Settings.h" #include "../Platform/smbios.h" -void SmbiosFillPatchingValues(bool _SetTable132, uint8_t pEnabledCores, uint16_t pRamSlotCount, const SlotDeviceArrayClass& SlotDeviceArray, const SETTINGS_DATA& globalSettings, const CPU_STRUCTURE& CPUStructure, SmbiosInjectedSettings* smbiosInjectedSettingsPtr); +void SmbiosFillPatchingValues(XBool _SetTable132, uint8_t pEnabledCores, uint16_t pRamSlotCount, const SlotDeviceArrayClass& SlotDeviceArray, const SETTINGS_DATA& globalSettings, const CPU_STRUCTURE& CPUStructure, SmbiosInjectedSettings* smbiosInjectedSettingsPtr); diff --git a/rEFIt_UEFI/Platform/Utils.h b/rEFIt_UEFI/Platform/Utils.h index 69cb05d02..ac9dc979a 100755 --- a/rEFIt_UEFI/Platform/Utils.h +++ b/rEFIt_UEFI/Platform/Utils.h @@ -35,12 +35,12 @@ #define IS_PUNCT(x) ((x == '.') || (x == '-')) #define IS_BLANK(x) ((x == ' ') || (x == '\t')) -inline bool isPathSeparator(char32_t c) { return c == '/' || c == '\\'; } +inline XBool isPathSeparator(char32_t c) { return c == '/' || c == '\\'; } ////void LowCase (IN OUT CHAR8 *Str); //UINT32 hex2bin(IN const CHAR8 *hex, OUT UINT8 *bin, UINT32 len); -XBool IsHexDigit (CHAR8 c); +XBool IsHexDigit (CHAR8 c); UINT8 hexstrtouint8 (CONST CHAR8* buf); //one or two hex letters to one byte diff --git a/rEFIt_UEFI/Platform/Volume.cpp b/rEFIt_UEFI/Platform/Volume.cpp index 10a180820..b87383e68 100644 --- a/rEFIt_UEFI/Platform/Volume.cpp +++ b/rEFIt_UEFI/Platform/Volume.cpp @@ -25,9 +25,9 @@ GetRootUUID (IN REFIT_VOLUME *Volume) CONST CHAR16* SystemPlistP; CONST CHAR16* SystemPlistS; - XBool HasRock; - XBool HasPaper; - XBool HasScissors; + XBool HasRock; + XBool HasPaper; + XBool HasScissors; Status = EFI_NOT_FOUND; if (Volume == NULL) { diff --git a/rEFIt_UEFI/Platform/Volume.h b/rEFIt_UEFI/Platform/Volume.h index 4800a4eb7..c43c17fd1 100644 --- a/rEFIt_UEFI/Platform/Volume.h +++ b/rEFIt_UEFI/Platform/Volume.h @@ -37,11 +37,11 @@ public: XStringW VolLabel = XStringW(); // comes from \\.VolumeLabel.txt, or empty. UINT8 DiskKind = 0; LEGACY_OS *LegacyOS = 0; - XBool Hidden = false; + XBool Hidden = false; UINT8 BootType = 0; - XBool IsAppleLegacy = false; - XBool HasBootCode = false; - XBool IsMbrPartition = false; + XBool IsAppleLegacy = false; + XBool HasBootCode = false; + XBool IsMbrPartition = false; UINTN MbrPartitionIndex = 0; EFI_BLOCK_IO *BlockIO = 0; UINT64 BlockIOOffset = 0; diff --git a/rEFIt_UEFI/Platform/ati.cpp b/rEFIt_UEFI/Platform/ati.cpp index d76edf571..c0b3d30ce 100644 --- a/rEFIt_UEFI/Platform/ati.cpp +++ b/rEFIt_UEFI/Platform/ati.cpp @@ -1543,9 +1543,9 @@ void free_val(value_t *val ) // {FLAGTRUE, false, "ATY,VendorID", NULL, WRDVAL(0x1002) }, /*typedef struct { UINT32 flags; - XBool all_ports; + XBool all_ports; CHAR8 *name; - XBool (*get_value)(value_t *val, INTN index, XBool Sier); + XBool (*get_value)(value_t *val, INTN index, XBool Sier); value_t default_val; } AtiDevProp; */ diff --git a/rEFIt_UEFI/Platform/ati.h b/rEFIt_UEFI/Platform/ati.h index 6cb746a3e..85a2b9649 100644 --- a/rEFIt_UEFI/Platform/ati.h +++ b/rEFIt_UEFI/Platform/ati.h @@ -245,7 +245,7 @@ typedef struct { const CHAR8 *cfg_name; UINT8 ports; UINT32 flags; - XBool posted; + XBool posted; } card_t; // Chip flags @@ -278,9 +278,9 @@ typedef struct { typedef struct { UINT32 flags; - XBool all_ports; + XBool all_ports; CONST CHAR8 *name; - XBool (*get_value)(value_t *val, INTN index, XBool Sier); + XBool (*get_value)(value_t *val, INTN index, XBool Sier); value_t default_val; } AtiDevProp; diff --git a/rEFIt_UEFI/Platform/card_vlist.h b/rEFIt_UEFI/Platform/card_vlist.h index 55def70e5..0cc64c54e 100644 --- a/rEFIt_UEFI/Platform/card_vlist.h +++ b/rEFIt_UEFI/Platform/card_vlist.h @@ -27,7 +27,7 @@ FindCardWithIds ( // UINT32 SubId, // UINT64 VideoRam, // UINTN VideoPorts, -// XBool LoadVBios +// XBool LoadVBios // ); diff --git a/rEFIt_UEFI/Platform/cpu.cpp b/rEFIt_UEFI/Platform/cpu.cpp index a8b49a6b3..57c30cd2a 100755 --- a/rEFIt_UEFI/Platform/cpu.cpp +++ b/rEFIt_UEFI/Platform/cpu.cpp @@ -1441,7 +1441,7 @@ MACHINE_TYPES GetDefaultModel() return MacPro61; } // TODO: Add more CPU models and configure the correct machines per CPU/GFX model - bool isMobile = getMobileFromSmbios(); + XBool isMobile = getMobileFromSmbios(); if(isMobile) { switch (gCPUStructure.Model) { diff --git a/rEFIt_UEFI/Platform/device_inject.cpp b/rEFIt_UEFI/Platform/device_inject.cpp index 058d16a8a..ba0e6afda 100644 --- a/rEFIt_UEFI/Platform/device_inject.cpp +++ b/rEFIt_UEFI/Platform/device_inject.cpp @@ -276,7 +276,7 @@ XBool devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *vl, return true; } -bool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer& vl) +XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer& vl) { return devprop_add_value(device, nm.data(), vl.data(), vl.size()); } @@ -350,7 +350,7 @@ XBool set_eth_props(pci_dt_t *eth_dev) #endif DevPropDevice *device = NULL; UINT8 builtin = 0x0; - XBool Injected = false; + XBool Injected = false; UINTN i; CHAR8 compatible[64]; @@ -437,7 +437,7 @@ XBool set_usb_props(pci_dt_t *usb_dev) #endif DevPropDevice *device = NULL; UINT32 fake_devid; - XBool Injected = false; + XBool Injected = false; UINTN i; if (!device_inject_string) diff --git a/rEFIt_UEFI/Platform/device_inject.h b/rEFIt_UEFI/Platform/device_inject.h index 6c37b5fc7..a613356c8 100644 --- a/rEFIt_UEFI/Platform/device_inject.h +++ b/rEFIt_UEFI/Platform/device_inject.h @@ -122,7 +122,7 @@ DevPropString *devprop_create_string(void); //DevPropDevice *devprop_add_device(DevPropString *string, char *path); DevPropDevice *devprop_add_device_pci(DevPropString *string, pci_dt_t *PciDt, EFI_DEVICE_PATH_PROTOCOL *DevicePath); XBool devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *vl, UINTN len); // to be removed -bool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer& vl); +XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer& vl); XBuffer devprop_generate_string(DevPropString *string); void devprop_free_string(DevPropString *string); diff --git a/rEFIt_UEFI/Platform/gma.cpp b/rEFIt_UEFI/Platform/gma.cpp index c3830b6d8..6dc0b1fc5 100755 --- a/rEFIt_UEFI/Platform/gma.cpp +++ b/rEFIt_UEFI/Platform/gma.cpp @@ -970,12 +970,12 @@ XBool setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& BuildV UINT32 FakeID; UINT32 DualLink = 1; // UINT64 os_version = AsciiOSVersionToUint64(macOSVersion); - XBool SetUGAWidth = false; - XBool SetUGAHeight = false; - XBool Injected = false; - XBool SetFake = false; - XBool SetSnb = false; - XBool SetIg = false; + XBool SetUGAWidth = false; + XBool SetUGAHeight = false; + XBool Injected = false; + XBool SetFake = false; + XBool SetSnb = false; + XBool SetIg = false; MACHINE_TYPES MacModel = GetModelFromString(gSettings.Smbios.ProductName); diff --git a/rEFIt_UEFI/Platform/guid.h b/rEFIt_UEFI/Platform/guid.h index 9f16a9bfc..0e12c963f 100644 --- a/rEFIt_UEFI/Platform/guid.h +++ b/rEFIt_UEFI/Platform/guid.h @@ -28,7 +28,7 @@ public: EFI_GUIDClass(const EFI_GUID& other) { Data1 = other.Data1; Data2 = other.Data2; Data3 = other.Data3; memcpy(Data4, other.Data4, sizeof(Data4)); } - bool operator == (const EFI_GUID& other) const { + XBool operator == (const EFI_GUID& other) const { if ( !(Data1 == other.Data1) ) return false; if ( !(Data2 == other.Data2) ) return false; if ( !(Data3 == other.Data3) ) return false; diff --git a/rEFIt_UEFI/Platform/hda.cpp b/rEFIt_UEFI/Platform/hda.cpp index 3007324bd..23136a3ac 100644 --- a/rEFIt_UEFI/Platform/hda.cpp +++ b/rEFIt_UEFI/Platform/hda.cpp @@ -156,7 +156,7 @@ XBool setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const Mac DevPropDevice *device = NULL; UINT32 layoutId = 0; UINT32 codecId = 0; - XBool Injected = false; + XBool Injected = false; UINTN i; if (!device_inject_string) { diff --git a/rEFIt_UEFI/Platform/kernel_patcher.cpp b/rEFIt_UEFI/Platform/kernel_patcher.cpp index feb20c7b6..1758eb2b9 100644 --- a/rEFIt_UEFI/Platform/kernel_patcher.cpp +++ b/rEFIt_UEFI/Platform/kernel_patcher.cpp @@ -52,13 +52,13 @@ //UINT32 *dtLength; //UINT8 *KernelData = NULL; //UINT32 KernelSlide = 0; -//XBool isKernelcache = false; -//XBool is64BitKernel = false; -//XBool SSSE3; +//XBool isKernelcache = false; +//XBool is64BitKernel = false; +//XBool SSSE3; -//XBool PatcherInited = false; -//XBool gSNBEAICPUFixRequire = false; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not -//XBool gBDWEIOPCIFixRequire = false; // Broadwell-E IOPCIFamily fix require or not +//XBool PatcherInited = false; +//XBool gSNBEAICPUFixRequire = false; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not +//XBool gBDWEIOPCIFixRequire = false; // Broadwell-E IOPCIFamily fix require or not extern EFI_GUID gEfiAppleBootGuid; @@ -224,7 +224,7 @@ UINTN LOADER_ENTRY::searchProcInDriver(UINT8 * driver, UINT32 driverLen, const X } INT32 i; UINT32 Offset = 0; // Init to avoid warning - bool found = false; + XBool found = false; for (i = 0; i < lSizeVtable; ++i) { Offset = vArray[i].n_un.n_strx; if (strstr(&Names[Offset], procedure.c_str())) { @@ -334,7 +334,7 @@ UINTN LOADER_ENTRY::searchProc(const XString8& procedure) //search for the name // gBS->Stall(9000000); size_t i; - bool found = false; + XBool found = false; for (i=0; i 0) && isBundle?(AsciiStrCmp(gKextBundleIdentifier, Name.c_str()) == 0):(AsciiStrStr(gKextBundleIdentifier, Name.c_str()) != NULL)) { // (AsciiStrStr(InfoPlist, KernelAndKextPatches.KextPatches[i].Name) != NULL)) { diff --git a/rEFIt_UEFI/Platform/nvidia.cpp b/rEFIt_UEFI/Platform/nvidia.cpp index a0a7f3f15..c47b63afa 100644 --- a/rEFIt_UEFI/Platform/nvidia.cpp +++ b/rEFIt_UEFI/Platform/nvidia.cpp @@ -2177,8 +2177,8 @@ XBool setup_nvidia_devprop(pci_dt_t *nvda_dev) EFI_STATUS Status = EFI_NOT_FOUND; DevPropDevice *device = NULL; XString8 devicepath; - XBool load_vbios = gSettings.Graphics.LoadVBios; - XBool Injected = false; + XBool load_vbios = gSettings.Graphics.LoadVBios; + XBool Injected = false; UINT8 *rom = NULL; UINT16 nvCardType = 0; UINT64 videoRam = 0; @@ -2194,7 +2194,7 @@ XBool setup_nvidia_devprop(pci_dt_t *nvda_dev) INT32 crlf_count = 0; option_rom_pci_header_t *rom_pci_header; XString8 version_str; - XBool RomAssigned = false; + XBool RomAssigned = false; UINT32 device_id, subsys_id; const SETTINGS_DATA::GraphicsClass::GRAPHIC_CARD *nvcard; diff --git a/rEFIt_UEFI/Platform/platformdata.cpp b/rEFIt_UEFI/Platform/platformdata.cpp index 59300c561..8bf9fcc57 100644 --- a/rEFIt_UEFI/Platform/platformdata.cpp +++ b/rEFIt_UEFI/Platform/platformdata.cpp @@ -757,7 +757,7 @@ uint64_t GetExtFwFeaturesMask(MACHINE_TYPES Model) return (uint64_t)GetFwFeaturesMaskFromModel(Model) + 0xFF00000000ull; } -bool GetMobile(MACHINE_TYPES Model) +XBool GetMobile(MACHINE_TYPES Model) { // Mobile: the battery tab in Energy Saver switch ( Model ) @@ -988,7 +988,7 @@ UINT64 GetPlatformFeature(MACHINE_TYPES Model) } } -void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RBr[8]) +void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, XBool isMobile, char RBr[8]) { memset(RBr, 0, 8); if (ApplePlatformData[Model].smcBranch[0] != 'N') { @@ -1066,7 +1066,7 @@ void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RBr[8]) } } -void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RPlt[8]) +void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, XBool isMobile, char RPlt[8]) { memset(RPlt, 0, 8); if (ApplePlatformData[Model].smcPlatform[0] != 'N') { @@ -1142,7 +1142,7 @@ void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RPlt[8]) } } -bool isReleaseDateWithYear20(MACHINE_TYPES Model) +XBool isReleaseDateWithYear20(MACHINE_TYPES Model) { switch ( Model ) { @@ -1598,11 +1598,11 @@ int compareBiosVersion(const XString8& version1, const XString8& version2) } } -bool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2) +XBool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2) { return compareBiosVersion(version1, version2) <= 0; } -bool isBiosVersionEquel(const XString8& version1, const XString8& version2) +XBool isBiosVersionEquel(const XString8& version1, const XString8& version2) { return compareBiosVersion(version1, version2) == 0; } diff --git a/rEFIt_UEFI/Platform/platformdata.h b/rEFIt_UEFI/Platform/platformdata.h index e40aff758..e706676e2 100644 --- a/rEFIt_UEFI/Platform/platformdata.h +++ b/rEFIt_UEFI/Platform/platformdata.h @@ -196,21 +196,21 @@ extern PLATFORMDATA ApplePlatformData[]; void SetDMISettingsForModel(MACHINE_TYPES Model, SETTINGS_DATA* settingsData, REFIT_CONFIG* liveConfig); MACHINE_TYPES GetModelFromString (const XString8& ProductName); -bool isReleaseDateWithYear20(MACHINE_TYPES Model); +XBool isReleaseDateWithYear20(MACHINE_TYPES Model); XString8 GetReleaseDate (MACHINE_TYPES Model); uint8_t GetChassisTypeFromModel(MACHINE_TYPES Model); uint32_t GetFwFeaturesMaskFromModel(MACHINE_TYPES Model); uint32_t GetFwFeatures(MACHINE_TYPES Model); uint64_t GetExtFwFeatures(MACHINE_TYPES Model); uint64_t GetExtFwFeaturesMask(MACHINE_TYPES Model); -bool GetMobile(MACHINE_TYPES Model); +XBool GetMobile(MACHINE_TYPES Model); UINT64 GetPlatformFeature(MACHINE_TYPES Model); -void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RBr[8]); -void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RPlt[8]); +void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, XBool isMobile, char RBr[8]); +void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, XBool isMobile, char RPlt[8]); int compareBiosVersion(const XString8& version1, const XString8& version2); -bool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2); -bool isBiosVersionEquel(const XString8& version1, const XString8& version2); +XBool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2); +XBool isBiosVersionEquel(const XString8& version1, const XString8& version2); int compareReleaseDate(const XString8& date1, const XString8& date2); diff --git a/rEFIt_UEFI/Platform/plist/TagArray.cpp b/rEFIt_UEFI/Platform/plist/TagArray.cpp index 0669774c6..1cee53354 100755 --- a/rEFIt_UEFI/Platform/plist/TagArray.cpp +++ b/rEFIt_UEFI/Platform/plist/TagArray.cpp @@ -46,7 +46,7 @@ XObjArray TagArray::tagsFree; -bool TagArray::operator == (const TagStruct& other) const +XBool TagArray::operator == (const TagStruct& other) const { if ( !other.isArray() ) return false; if ( _arrayContent.size() != other.getArray()->arrayContent().size() ) { @@ -60,7 +60,7 @@ bool TagArray::operator == (const TagStruct& other) const return true; } -bool TagArray::debugIsEqual(const TagStruct& other, const XString8& label) const +XBool TagArray::debugIsEqual(const TagStruct& other, const XString8& label) const { if ( !other.isArray() ) { MsgLog("counterpart of '%s' is not an array\n", label.c_str()); diff --git a/rEFIt_UEFI/Platform/plist/TagArray.h b/rEFIt_UEFI/Platform/plist/TagArray.h index 4045648de..d350eba9a 100644 --- a/rEFIt_UEFI/Platform/plist/TagArray.h +++ b/rEFIt_UEFI/Platform/plist/TagArray.h @@ -22,13 +22,13 @@ public: const TagArray& operator = (const TagArray&); // Can be defined if needed virtual ~TagArray() { } - virtual bool operator == (const TagStruct& other) const; - virtual bool debugIsEqual(const TagStruct& other, const XString8& label) const; + virtual XBool operator == (const TagStruct& other) const; + virtual XBool debugIsEqual(const TagStruct& other, const XString8& label) const; virtual TagArray* getArray() { return this; } virtual const TagArray* getArray() const { return this; } - virtual bool isArray() const { return true; } + virtual XBool isArray() const { return true; } virtual const XString8 getTypeAsXString8() const { return "Array"_XS8; } static TagArray* getEmptyTag(); virtual void FreeTag(); diff --git a/rEFIt_UEFI/Platform/plist/TagBool.cpp b/rEFIt_UEFI/Platform/plist/TagBool.cpp index 4aa558af5..a00ba2304 100755 --- a/rEFIt_UEFI/Platform/plist/TagBool.cpp +++ b/rEFIt_UEFI/Platform/plist/TagBool.cpp @@ -71,7 +71,7 @@ void TagBool::FreeTag() tagsFree.AddReference(this, true); } -bool TagBool::operator == (const TagStruct& other) const +XBool TagBool::operator == (const TagStruct& other) const { if ( !other.isBool() ) return false; return value == other.getBool()->value; diff --git a/rEFIt_UEFI/Platform/plist/TagBool.h b/rEFIt_UEFI/Platform/plist/TagBool.h index 6d0af3157..412001fc7 100644 --- a/rEFIt_UEFI/Platform/plist/TagBool.h +++ b/rEFIt_UEFI/Platform/plist/TagBool.h @@ -13,7 +13,7 @@ class TagBool : public TagStruct { static XObjArray tagsFree; - bool value; + XBool value; public: @@ -22,12 +22,12 @@ public: const TagBool& operator = (const TagBool&); // Can be defined if needed virtual ~TagBool() { } - virtual bool operator == (const TagStruct& other) const; + virtual XBool operator == (const TagStruct& other) const; virtual TagBool* getBool() { return this; } virtual const TagBool* getBool() const { return this; } - virtual bool isBool() const { return true; } + virtual XBool isBool() const { return true; } virtual const XString8 getTypeAsXString8() const { return "Bool"_XS8; } static TagBool* getEmptyTag(); virtual void FreeTag(); @@ -37,14 +37,14 @@ public: /* * getters and setters */ - bool boolValue() const + XBool boolValue() const { // if ( !isBool() ) panic("TagBool::boolValue() : !isBool() "); return value; } - void setBoolValue(bool b) + void setBoolValue(XBool b) { -// if ( !isBool() ) panic("TagBool::setIntValue(bool) : !isBool() "); +// if ( !isBool() ) panic("TagBool::setIntValue(XBool) : !isBool() "); value = b; } diff --git a/rEFIt_UEFI/Platform/plist/TagData.cpp b/rEFIt_UEFI/Platform/plist/TagData.cpp index 18a3e6eb8..9eb3ecc4e 100755 --- a/rEFIt_UEFI/Platform/plist/TagData.cpp +++ b/rEFIt_UEFI/Platform/plist/TagData.cpp @@ -73,7 +73,7 @@ void TagData::FreeTag() tagsFree.AddReference(this, true); } -bool TagData::operator == (const TagStruct& other) const +XBool TagData::operator == (const TagStruct& other) const { if ( !other.isData() ) return false; if ( dataBuffer != other.getData()->dataBuffer ) return false; diff --git a/rEFIt_UEFI/Platform/plist/TagData.h b/rEFIt_UEFI/Platform/plist/TagData.h index 269568d48..c38c2bf3a 100644 --- a/rEFIt_UEFI/Platform/plist/TagData.h +++ b/rEFIt_UEFI/Platform/plist/TagData.h @@ -23,12 +23,12 @@ public: const TagData& operator = (const TagData&); // Can be defined if needed virtual ~TagData() { } - virtual bool operator == (const TagStruct& other) const; + virtual XBool operator == (const TagStruct& other) const; virtual TagData* getData() { return this; } virtual const TagData* getData() const { return this; } - virtual bool isData() const { return true; } + virtual XBool isData() const { return true; } virtual const XString8 getTypeAsXString8() const { return "Data"_XS8; } static TagData* getEmptyTag(); virtual void FreeTag(); diff --git a/rEFIt_UEFI/Platform/plist/TagDate.cpp b/rEFIt_UEFI/Platform/plist/TagDate.cpp index 35c632b94..da5690c9a 100755 --- a/rEFIt_UEFI/Platform/plist/TagDate.cpp +++ b/rEFIt_UEFI/Platform/plist/TagDate.cpp @@ -72,7 +72,7 @@ void TagDate::FreeTag() tagsFree.AddReference(this, true); } -bool TagDate::operator == (const TagStruct& other) const +XBool TagDate::operator == (const TagStruct& other) const { if ( !other.isDate() ) return false; return string == other.getDate()->string; diff --git a/rEFIt_UEFI/Platform/plist/TagDate.h b/rEFIt_UEFI/Platform/plist/TagDate.h index c35f84e51..0637804c2 100644 --- a/rEFIt_UEFI/Platform/plist/TagDate.h +++ b/rEFIt_UEFI/Platform/plist/TagDate.h @@ -22,12 +22,12 @@ public: const TagDate& operator = (const TagDate&); // Can be defined if needed virtual ~TagDate() { } - virtual bool operator == (const TagStruct& other) const; + virtual XBool operator == (const TagStruct& other) const; virtual TagDate* getDate() { return this; } virtual const TagDate* getDate() const { return this; } - virtual bool isDict() const { return true; } + virtual XBool isDict() const { return true; } virtual const XString8 getTypeAsXString8() const { return "Dict"_XS8; } static TagDate* getEmptyTag(); virtual void FreeTag(); diff --git a/rEFIt_UEFI/Platform/plist/TagDict.cpp b/rEFIt_UEFI/Platform/plist/TagDict.cpp index 72fad6c32..d2184caa3 100755 --- a/rEFIt_UEFI/Platform/plist/TagDict.cpp +++ b/rEFIt_UEFI/Platform/plist/TagDict.cpp @@ -75,7 +75,7 @@ void TagDict::FreeTag() tagsFree.AddReference(this, true); } -bool TagDict::operator == (const TagStruct& other) const +XBool TagDict::operator == (const TagStruct& other) const { if ( !other.isDict() ) return false; if ( _dictContent.size() != other.getDict()->_dictContent.size() ) { @@ -89,7 +89,7 @@ bool TagDict::operator == (const TagStruct& other) const return true; } -bool TagDict::debugIsEqual(const TagStruct& other, const XString8& label) const +XBool TagDict::debugIsEqual(const TagStruct& other, const XString8& label) const { if ( !other.isDict()) { MsgLog("counterpart of '%s' is not a dict\n", label.c_str()); diff --git a/rEFIt_UEFI/Platform/plist/TagDict.h b/rEFIt_UEFI/Platform/plist/TagDict.h index 833c9302a..e3641441c 100644 --- a/rEFIt_UEFI/Platform/plist/TagDict.h +++ b/rEFIt_UEFI/Platform/plist/TagDict.h @@ -22,13 +22,13 @@ public: const TagDict& operator = (const TagDict&); // Can be defined if needed virtual ~TagDict() { } - virtual bool operator == (const TagStruct& other) const; - virtual bool debugIsEqual(const TagStruct& other, const XString8& label) const; + virtual XBool operator == (const TagStruct& other) const; + virtual XBool debugIsEqual(const TagStruct& other, const XString8& label) const; virtual TagDict* getDict() { return this; } virtual const TagDict* getDict() const { return this; } - virtual bool isDict() const { return true; } + virtual XBool isDict() const { return true; } virtual const XString8 getTypeAsXString8() const { return "Dict"_XS8; } static TagDict* getEmptyTag(); virtual void FreeTag(); diff --git a/rEFIt_UEFI/Platform/plist/TagFloat.cpp b/rEFIt_UEFI/Platform/plist/TagFloat.cpp index 10b9727ed..e3a9ec639 100755 --- a/rEFIt_UEFI/Platform/plist/TagFloat.cpp +++ b/rEFIt_UEFI/Platform/plist/TagFloat.cpp @@ -73,7 +73,7 @@ void TagFloat::FreeTag() tagsFree.AddReference(this, true); } -bool TagFloat::operator == (const TagStruct& other) const +XBool TagFloat::operator == (const TagStruct& other) const { if ( !other.isFloat() ) return false; return value == other.getFloat()->value; diff --git a/rEFIt_UEFI/Platform/plist/TagFloat.h b/rEFIt_UEFI/Platform/plist/TagFloat.h index 381e39588..231221618 100644 --- a/rEFIt_UEFI/Platform/plist/TagFloat.h +++ b/rEFIt_UEFI/Platform/plist/TagFloat.h @@ -22,12 +22,12 @@ public: const TagFloat& operator = (const TagFloat&); // Can be defined if needed virtual ~TagFloat() { } - virtual bool operator == (const TagStruct& other) const; + virtual XBool operator == (const TagStruct& other) const; virtual TagFloat* getFloat() { return this; } virtual const TagFloat* getFloat() const { return this; } - virtual bool isFloat() const { return true; } + virtual XBool isFloat() const { return true; } virtual const XString8 getTypeAsXString8() const { return "Float"_XS8; } static TagFloat* getEmptyTag(); virtual void FreeTag(); diff --git a/rEFIt_UEFI/Platform/plist/TagInt64.cpp b/rEFIt_UEFI/Platform/plist/TagInt64.cpp index d2907e14b..a42b59861 100755 --- a/rEFIt_UEFI/Platform/plist/TagInt64.cpp +++ b/rEFIt_UEFI/Platform/plist/TagInt64.cpp @@ -73,7 +73,7 @@ void TagInt64::FreeTag() tagsFree.AddReference(this, true); } -bool TagInt64::operator == (const TagStruct& other) const +XBool TagInt64::operator == (const TagStruct& other) const { if ( !other.isInt64() ) return false; return value == other.getInt64()->value; diff --git a/rEFIt_UEFI/Platform/plist/TagInt64.h b/rEFIt_UEFI/Platform/plist/TagInt64.h index c77f9706c..de6c1625d 100644 --- a/rEFIt_UEFI/Platform/plist/TagInt64.h +++ b/rEFIt_UEFI/Platform/plist/TagInt64.h @@ -22,12 +22,12 @@ public: const TagInt64& operator = (const TagInt64&); // Can be defined if needed virtual ~TagInt64() { } - virtual bool operator == (const TagStruct& other) const; + virtual XBool operator == (const TagStruct& other) const; virtual TagInt64* getInt64() { return this; } virtual const TagInt64* getInt64() const { return this; } - virtual bool isInt64() const { return true; } + virtual XBool isInt64() const { return true; } virtual const XString8 getTypeAsXString8() const { return "Int64"_XS8; } static TagInt64* getEmptyTag(); virtual void FreeTag(); diff --git a/rEFIt_UEFI/Platform/plist/TagKey.cpp b/rEFIt_UEFI/Platform/plist/TagKey.cpp index 563b62db1..7de4872af 100755 --- a/rEFIt_UEFI/Platform/plist/TagKey.cpp +++ b/rEFIt_UEFI/Platform/plist/TagKey.cpp @@ -73,7 +73,7 @@ void TagKey::FreeTag() tagsFree.AddReference(this, true); } -bool TagKey::operator == (const TagStruct& other) const +XBool TagKey::operator == (const TagStruct& other) const { if ( !other.isKey() ) return false; return _string == other.getKey()->_string; diff --git a/rEFIt_UEFI/Platform/plist/TagKey.h b/rEFIt_UEFI/Platform/plist/TagKey.h index c10e29e6d..844fcb7bd 100644 --- a/rEFIt_UEFI/Platform/plist/TagKey.h +++ b/rEFIt_UEFI/Platform/plist/TagKey.h @@ -22,12 +22,12 @@ public: const TagKey& operator = (const TagKey&); // Can be defined if needed virtual ~TagKey() { } - virtual bool operator == (const TagStruct& other) const; + virtual XBool operator == (const TagStruct& other) const; virtual TagKey* getKey() { return this; } virtual const TagKey* getKey() const { return this; } - virtual bool isKey() const { return true; } + virtual XBool isKey() const { return true; } virtual const XString8 getTypeAsXString8() const { return "Key"_XS8; } static TagKey* getEmptyTag(); virtual void FreeTag(); diff --git a/rEFIt_UEFI/Platform/plist/TagString8.cpp b/rEFIt_UEFI/Platform/plist/TagString8.cpp index eeb72bbeb..69dcad8e9 100755 --- a/rEFIt_UEFI/Platform/plist/TagString8.cpp +++ b/rEFIt_UEFI/Platform/plist/TagString8.cpp @@ -72,7 +72,7 @@ void TagString::FreeTag() tagsFree.AddReference(this, true); } -bool TagString::operator == (const TagStruct& other) const +XBool TagString::operator == (const TagStruct& other) const { if ( !other.isString() ) return false; return _string == other.getString()->_string; diff --git a/rEFIt_UEFI/Platform/plist/TagString8.h b/rEFIt_UEFI/Platform/plist/TagString8.h index edbcd0d05..3341e5657 100644 --- a/rEFIt_UEFI/Platform/plist/TagString8.h +++ b/rEFIt_UEFI/Platform/plist/TagString8.h @@ -22,12 +22,12 @@ public: const TagString& operator = (const TagString&); // Can be defined if needed virtual ~TagString() { } - virtual bool operator == (const TagStruct& other) const; + virtual XBool operator == (const TagStruct& other) const; virtual TagString* getString() { return this; } virtual const TagString* getString() const { return this; } - virtual bool isString() const { return true; } + virtual XBool isString() const { return true; } virtual const XString8 getTypeAsXString8() const { return "String8"_XS8; } static TagString* getEmptyTag(); virtual void FreeTag(); diff --git a/rEFIt_UEFI/Platform/plist/plist.cpp b/rEFIt_UEFI/Platform/plist/plist.cpp index c5bd745ac..507961e3a 100755 --- a/rEFIt_UEFI/Platform/plist/plist.cpp +++ b/rEFIt_UEFI/Platform/plist/plist.cpp @@ -57,7 +57,7 @@ EFI_STATUS ParseTagInteger(CHAR8* buffer, TagStruct* * tag, UINT32* lenPtr); EFI_STATUS ParseTagFloat(CHAR8* buffer, TagStruct* * tag, UINT32* lenPtr); EFI_STATUS ParseTagData(CHAR8* buffer, TagStruct* * tag, UINT32* lenPtr); EFI_STATUS ParseTagDate(CHAR8* buffer, TagStruct* * tag, UINT32* lenPtr); -EFI_STATUS ParseTagBoolean(TagStruct* * tag, bool value, UINT32* lenPtr); +EFI_STATUS ParseTagBoolean(TagStruct* * tag, XBool value, UINT32* lenPtr); EFI_STATUS XMLParseNextTag (CHAR8 *buffer, TagStruct**tag, UINT32 *lenPtr); @@ -165,7 +165,7 @@ EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CONST CHAR8* tag,UINT32* lenPtr); //} // -bool TagStruct::debugIsEqual(const TagStruct& other, const XString8& label) const +XBool TagStruct::debugIsEqual(const TagStruct& other, const XString8& label) const { if ( *this != other ) { MsgLog("Difference at %s\n", label.c_str()); @@ -184,29 +184,29 @@ void TagStruct::printf(unsigned int ident) const } // Convenience method -bool TagStruct::isTrue() const +XBool TagStruct::isTrue() const { if ( isBool() ) return getBool()->boolValue(); return false; } -bool TagStruct::isFalse() const +XBool TagStruct::isFalse() const { if ( isBool() ) return !getBool()->boolValue(); return false; } -bool TagStruct::isTrueOrYy() const +XBool TagStruct::isTrueOrYy() const { if ( isBool() ) return getBool()->boolValue(); if ( isString() && getString()->stringValue().notEmpty() && (getString()->stringValue()[0] == 'y' || getString()->stringValue()[0] == 'Y') ) return true; return false; } -bool TagStruct::isTrueOrYes() const +XBool TagStruct::isTrueOrYes() const { if ( isBool() ) return getBool()->boolValue(); if ( isString() && getString()->stringValue().isEqual("Yes"_XS8) ) return true; return false; } -bool TagStruct::isFalseOrNn() const +XBool TagStruct::isFalseOrNn() const { if ( isBool() ) return !getBool()->boolValue(); if ( isString() && getString()->stringValue().notEmpty() && (getString()->stringValue()[0] == 'n' || getString()->stringValue()[0] == 'N') ) return true; @@ -426,7 +426,7 @@ EFI_STATUS XMLParseNextTag(CHAR8* buffer, TagStruct** tag, UINT32* lenPtr) //========================================================================== // ParseTagList -EFI_STATUS __ParseTagList(bool isArray, CHAR8* buffer, TagStruct** tag, UINT32 empty, UINT32* lenPtr) +EFI_STATUS __ParseTagList(XBool isArray, CHAR8* buffer, TagStruct** tag, UINT32 empty, UINT32* lenPtr) { EFI_STATUS Status = EFI_SUCCESS; UINT32 pos; @@ -558,7 +558,7 @@ EFI_STATUS ParseTagInteger(CHAR8* buffer, TagStruct** tag, UINT32* lenPtr) UINT32 length = 0; INTN integer; UINT32 size; - XBool negative = false; + XBool negative = false; CHAR8* val = buffer; TagInt64* tmpTag; @@ -711,7 +711,7 @@ EFI_STATUS ParseTagDate(CHAR8* buffer, TagStruct* * tag,UINT32* lenPtr) //========================================================================== // ParseTagBoolean -EFI_STATUS ParseTagBoolean(TagStruct** tag, bool value, UINT32* lenPtr) +EFI_STATUS ParseTagBoolean(TagStruct** tag, XBool value, UINT32* lenPtr) { TagBool* tmpTag; diff --git a/rEFIt_UEFI/Platform/plist/plist.h b/rEFIt_UEFI/Platform/plist/plist.h index 21ed0cea0..847661ae4 100644 --- a/rEFIt_UEFI/Platform/plist/plist.h +++ b/rEFIt_UEFI/Platform/plist/plist.h @@ -50,9 +50,9 @@ public: // static TagStruct* getEmptyArrayTag(); virtual void FreeTag() = 0; - virtual bool operator == (const TagStruct& other) const = 0; - virtual bool operator != (const TagStruct& other) const { return !(*this == other); }; - virtual bool debugIsEqual(const TagStruct& other, const XString8& label) const; + virtual XBool operator == (const TagStruct& other) const = 0; + virtual XBool operator != (const TagStruct& other) const { return !(*this == other); }; + virtual XBool debugIsEqual(const TagStruct& other, const XString8& label) const; virtual void sprintf(unsigned int ident, XString8* s) const = 0; void printf(unsigned int ident) const; @@ -100,25 +100,25 @@ public: #endif - virtual bool isDict() const { return false; } - virtual bool isKey() const { return false; } - virtual bool isString() const { return false; } - virtual bool isInt64() const { return false; } - virtual bool isFloat() const { return false; } - virtual bool isBool() const { return false; } - virtual bool isData() const { return false; } - virtual bool isDate() const { return false; } - virtual bool isArray() const { return false; } + virtual XBool isDict() const { return false; } + virtual XBool isKey() const { return false; } + virtual XBool isString() const { return false; } + virtual XBool isInt64() const { return false; } + virtual XBool isFloat() const { return false; } + virtual XBool isBool() const { return false; } + virtual XBool isData() const { return false; } + virtual XBool isDate() const { return false; } + virtual XBool isArray() const { return false; } virtual const XString8 getTypeAsXString8() const = 0; // Convenience method - bool isTrue() const; - bool isFalse() const; - bool isTrueOrYy() const; - bool isTrueOrYes() const; - bool isFalseOrNn() const; + XBool isTrue() const; + XBool isFalse() const; + XBool isTrueOrYy() const; + XBool isTrueOrYes() const; + XBool isFalseOrNn() const; }; #include "TagDict.h" diff --git a/rEFIt_UEFI/Platform/smbios.cpp b/rEFIt_UEFI/Platform/smbios.cpp index 171e9a377..4ba1d7a57 100755 --- a/rEFIt_UEFI/Platform/smbios.cpp +++ b/rEFIt_UEFI/Platform/smbios.cpp @@ -94,9 +94,9 @@ UINT16 mHandle19; UINT16 mMemory17[MAX_RAM_SLOTS]; UINT64 mInstalled[MAX_RAM_SLOTS]; UINT64 mEnabled[MAX_RAM_SLOTS]; -XBool gMobile; +XBool gMobile; UINT8 gBootStatus; -XBool Once; +XBool Once; MEM_STRUCTURE gRAM; @@ -664,7 +664,7 @@ DBG("%s : UpdateSmbiosString Version=BoardVersion=%s\n", __PRETTY_FUNCTION__, sm return; } -bool getMobileFromSmbios() +XBool getMobileFromSmbios() { // System Chassis Information // @@ -1123,7 +1123,7 @@ void PatchTableType9(const SmbiosInjectedSettings& smbiosSettings) DBG("SlotDevice[%hhu].SlotID = %hhd\n", Index, smbiosSettings.SlotDevices.getSlotForIndex(Index).SlotID); DBG("SlotDevice[%hhu].SlotType = %d\n", Index, smbiosSettings.SlotDevices.getSlotForIndex(Index).SlotType); DBG("SlotDevice[%hhu].SlotName = %s\n", Index, smbiosSettings.SlotDevices.getSlotForIndex(Index).SlotName.c_str()); - DBG("SlotDevice[%hhu].Valid = %d\n", Index, smbiosSettings.SlotDevices.isSlotForIndexValid(Index)); + DBG("SlotDevice[%hhu].Valid = %d\n", Index, (bool)smbiosSettings.SlotDevices.isSlotForIndexValid(Index)); } #endif @@ -1441,7 +1441,7 @@ DBG("gSettings.Smbios.Memory.SlotCounts=%d\n", smbiosSettings.Memory.SlotCounts) DBG("gSettings.Smbios.Memory.UserChannels=%d\n", smbiosSettings.Memory.UserChannels); for (uint64_t Index = 0; Index < smbiosSettings.Memory.SlotCounts; Index++) { DBG("gSettings.Smbios.Memory.User[%lld].Frequency=%d\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).Frequency); - DBG("gSettings.Smbios.Memory.User[%lld].InUse=%d\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).InUse); + DBG("gSettings.Smbios.Memory.User[%lld].InUse=%d\n", Index, (bool)smbiosSettings.Memory.getSlotInfoForSlotID(Index).InUse); DBG("gSettings.Smbios.Memory.User[%lld].ModuleSize=%d\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).ModuleSize); DBG("gSettings.Smbios.Memory.User[%lld].PartNo=%s\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).PartNo.c_str()); DBG("gSettings.Smbios.Memory.User[%lld].SerialNo=%s\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).SerialNo.c_str()); diff --git a/rEFIt_UEFI/Platform/smbios.h b/rEFIt_UEFI/Platform/smbios.h index 85a998750..b3288bfa3 100644 --- a/rEFIt_UEFI/Platform/smbios.h +++ b/rEFIt_UEFI/Platform/smbios.h @@ -25,14 +25,14 @@ static_assert(MAX_RAM_SLOTS < UINT8_MAX, "MAX_RAM_SLOTS < UINT8_MAX"); // Import class RAM_SLOT_INFO { public: - UINT64 Slot = UINT64(); - UINT32 ModuleSize = UINT32(); - UINT32 Frequency = UINT32(); + UINT64 Slot = UINT64(); + UINT32 ModuleSize = UINT32(); + UINT32 Frequency = UINT32(); XString8 Vendor = XString8(); XString8 PartNo = XString8(); XString8 SerialNo = XString8(); - UINT8 Type = UINT8(); - bool InUse = bool(); + UINT8 Type = UINT8(); + XBool InUse = false; RAM_SLOT_INFO() {} }; @@ -151,19 +151,19 @@ class SmbiosInjectedSettings XString8 ChassisAssetTag = XString8(); XString8 FamilyName = XString8(); XString8 SmUUID = XString8(); - bool NoRomInfo = 0; - uint8_t EnabledCores = 0; - bool TrustSMBIOS = 0; - bool InjectMemoryTables = 0; - uint8_t BoardType = 0; - uint8_t ChassisType = 0; + XBool NoRomInfo = false; + uint8_t EnabledCores = 0; + XBool TrustSMBIOS = false; + XBool InjectMemoryTables = false; + uint8_t BoardType = 0; + uint8_t ChassisType = 0; class SlotDevicesArrayClass : protected XObjArray { using super = XObjArray; public: void setEmpty() { super::setEmpty(); } - void AddReference(SLOT_DEVICE* newElement, bool FreeIt) { super::AddReference(newElement, FreeIt); } + void AddReference(SLOT_DEVICE* newElement, XBool FreeIt) { super::AddReference(newElement, FreeIt); } const SLOT_DEVICE& getSlotForIndex(size_t Index) const { if ( Index >= MAX_RAM_SLOTS) { @@ -185,7 +185,7 @@ class SmbiosInjectedSettings AddReference(slotDevice, true); return *slotDevice; } - bool isSlotForIndexValid(uint8_t Index) const { + XBool isSlotForIndexValid(uint8_t Index) const { if ( Index >= MAX_RAM_SLOTS) { log_technical_bug("%s : Index >= MAX_RAM_SLOTS", __PRETTY_FUNCTION__); } @@ -205,11 +205,11 @@ class SmbiosInjectedSettings uint64_t ExtendedFirmwareFeaturesMask = 0; int8_t Attribute = 0; - bool KPDELLSMBIOS = 0; + XBool KPDELLSMBIOS = false; // CPU uint16_t CpuType = 0; - bool SetTable132 = 0; + XBool SetTable132 = false; uint16_t QPI = 0; // from SmBios @@ -242,7 +242,7 @@ extern APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable; // TODO stop using globals. extern MEM_STRUCTURE gRAM; -extern XBool gMobile; +extern XBool gMobile; @@ -256,7 +256,7 @@ EFI_STATUS PrepatchSmbios(SmbiosDiscoveredSettings* smbiosSettings); void PatchSmbios(const SmbiosInjectedSettings& smbiosSettings); void FinalizeSmbios(const SmbiosInjectedSettings& smbiosSettings); -bool getMobileFromSmbios(); +XBool getMobileFromSmbios(); XString8 getSmUUIDFromSmbios(); diff --git a/rEFIt_UEFI/Platform/spd.cpp b/rEFIt_UEFI/Platform/spd.cpp index a4855afa1..628c249fe 100644 --- a/rEFIt_UEFI/Platform/spd.cpp +++ b/rEFIt_UEFI/Platform/spd.cpp @@ -37,7 +37,7 @@ #endif -XBool smbIntel; +XBool smbIntel; UINT8 smbPage; CONST CHAR8 *spd_memory_types[] = diff --git a/rEFIt_UEFI/Platform/usbfix.cpp b/rEFIt_UEFI/Platform/usbfix.cpp index 4f581c196..038554744 100644 --- a/rEFIt_UEFI/Platform/usbfix.cpp +++ b/rEFIt_UEFI/Platform/usbfix.cpp @@ -65,7 +65,7 @@ DBG("FixOwnership() -> begin\n"); UINTN isOSowned; UINTN isBIOSowned; - XBool isOwnershipConflict; + XBool isOwnershipConflict; // // Find the usb host controller diff --git a/rEFIt_UEFI/PlatformEFI/BasicIO.cpp b/rEFIt_UEFI/PlatformEFI/BasicIO.cpp index faf6ba1e0..5f9487b1c 100644 --- a/rEFIt_UEFI/PlatformEFI/BasicIO.cpp +++ b/rEFIt_UEFI/PlatformEFI/BasicIO.cpp @@ -23,7 +23,7 @@ extern "C" { XBool ReadAllKeyStrokes(void) { - XBool GotKeyStrokes; + XBool GotKeyStrokes; EFI_STATUS Status; EFI_INPUT_KEY key; diff --git a/rEFIt_UEFI/PlatformPOSIX+EFI/BootLog.cpp b/rEFIt_UEFI/PlatformPOSIX+EFI/BootLog.cpp index f1de9a472..bdfdb9972 100644 --- a/rEFIt_UEFI/PlatformPOSIX+EFI/BootLog.cpp +++ b/rEFIt_UEFI/PlatformPOSIX+EFI/BootLog.cpp @@ -52,7 +52,7 @@ PrintBytes(IN void *Bytes, IN UINTN Number) } } -bool gEnableCloverLog = false; +XBool gEnableCloverLog = false; // Changed MsgLog(...) it now calls this function // with DebugMode == 0. - apianti diff --git a/rEFIt_UEFI/PlatformPOSIX/BootLog.cpp b/rEFIt_UEFI/PlatformPOSIX/BootLog.cpp index f1de9a472..bdfdb9972 100644 --- a/rEFIt_UEFI/PlatformPOSIX/BootLog.cpp +++ b/rEFIt_UEFI/PlatformPOSIX/BootLog.cpp @@ -52,7 +52,7 @@ PrintBytes(IN void *Bytes, IN UINTN Number) } } -bool gEnableCloverLog = false; +XBool gEnableCloverLog = false; // Changed MsgLog(...) it now calls this function // with DebugMode == 0. - apianti diff --git a/rEFIt_UEFI/Settings/ConfigManager.cpp b/rEFIt_UEFI/Settings/ConfigManager.cpp index 37ac6251c..ddf0cd06a 100644 --- a/rEFIt_UEFI/Settings/ConfigManager.cpp +++ b/rEFIt_UEFI/Settings/ConfigManager.cpp @@ -524,7 +524,7 @@ EFI_STATUS LoadPlist(const XStringW& ConfName, C* plist) } XmlLiteParser xmlLiteParser; - bool parsingOk = plist->parse((const CHAR8*)ConfigPtr, Size, ""_XS8, &xmlLiteParser); + XBool parsingOk = plist->parse((const CHAR8*)ConfigPtr, Size, ""_XS8, &xmlLiteParser); if ( xmlLiteParser.getErrorsAndWarnings().size() ) { if ( xmlLiteParser.getErrorsAndWarnings().size() > 1 ) { DebugLog(2, "There are problems in plist '%ls'\n", configPlistPath.wc_str()); diff --git a/rEFIt_UEFI/Settings/ConfigManager.h b/rEFIt_UEFI/Settings/ConfigManager.h index f4ef48c74..7bd9396ef 100644 --- a/rEFIt_UEFI/Settings/ConfigManager.h +++ b/rEFIt_UEFI/Settings/ConfigManager.h @@ -52,10 +52,10 @@ public: EFI_HANDLE Handle = 0; UINT8 *Mmio = 0; UINT32 Connectors = 0; - XBool ConnChanged = false; + XBool ConnChanged = false; // ATTENTION : this is not discovered. This will be assigned once config plist is read. - bool LoadVBios = 0; + XBool LoadVBios = false; DiscoveredGfx() {} DiscoveredGfx(const DiscoveredGfx&) = default; // default copy is ok because we can copy Mmio, because it's not allocated and still make sense once copied. @@ -67,7 +67,7 @@ class GfxPropertiesArrayClass : public XObjArray public: - bool hasBrand(HRDW_MANUFACTERER brand) const { + XBool hasBrand(HRDW_MANUFACTERER brand) const { for ( size_t idx = 0 ; idx < size() ; ++idx ) { if ( ElementAt(idx).Vendor == brand ) return true; } @@ -75,11 +75,11 @@ public: } - bool hasNvidia() const { return hasBrand(Nvidia); } - bool hasIntel() const { return hasBrand(Intel); } + XBool hasNvidia() const { return hasBrand(Nvidia); } + XBool hasIntel() const { return hasBrand(Intel); } - bool isCardAtPosIntel(size_t pos) const { return size() > pos && ElementAt(pos).Vendor == Intel; } - bool isCardAtPosNvidia(size_t pos) const { return size() > pos && ElementAt(pos).Vendor == Nvidia; } + XBool isCardAtPosIntel(size_t pos) const { return size() > pos && ElementAt(pos).Vendor == Intel; } + XBool isCardAtPosNvidia(size_t pos) const { return size() > pos && ElementAt(pos).Vendor == Nvidia; } }; @@ -113,7 +113,7 @@ class LanCardArrayClass : public XObjArray { public: /* Requirment : MacAddressToLookFor is 6 chars long */ - bool containsMacAddress(const UINT8* MacAddressToLookFor) const { + XBool containsMacAddress(const UINT8* MacAddressToLookFor) const { for ( size_t idx = 0 ; idx < size() ; ++idx ) { if ( memcmp(MacAddressToLookFor, ElementAt(idx).MacAddress, 6) == 0 ) return true; } diff --git a/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistAbstract.cpp b/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistAbstract.cpp index d77c34769..e880818c1 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistAbstract.cpp +++ b/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistAbstract.cpp @@ -11,32 +11,32 @@ -bool ConfigPlistAbstractClass::parse(XmlLiteParser* xmlLiteParser, const XString8& xmlPath) +XBool ConfigPlistAbstractClass::parse(XmlLiteParser* xmlLiteParser, const XString8& xmlPath) { xmlLiteParser->moveForwardUntilSignificant(); xmlLiteParser->skipHeader(); auto pos = xmlLiteParser->getPosition(); - bool b = parseFromXmlLite(xmlLiteParser, xmlPath, true); + XBool b = parseFromXmlLite(xmlLiteParser, xmlPath, true); if ( !b ) return false; b = validate(xmlLiteParser, xmlPath, pos, true); return b; } -bool ConfigPlistAbstractClass::parse(const LString8& buf, size_t size, const XString8& xmlPath, XmlLiteParser* xmlLiteParser) +XBool ConfigPlistAbstractClass::parse(const LString8& buf, size_t size, const XString8& xmlPath, XmlLiteParser* xmlLiteParser) { xmlLiteParser->init(buf.c_str(), size); return parse(xmlLiteParser, xmlPath); } -bool ConfigPlistAbstractClass::parse(const LString8& buf, size_t size, const XString8& xmlPath) +XBool ConfigPlistAbstractClass::parse(const LString8& buf, size_t size, const XString8& xmlPath) { XmlLiteParser xmlLiteParser; xmlLiteParser.init(buf.c_str(), size); return parse(&xmlLiteParser, xmlPath); } -bool ConfigPlistAbstractClass::parse(const LString8& buf, size_t size) +XBool ConfigPlistAbstractClass::parse(const LString8& buf, size_t size) { return parse(buf, size, ""_XS8); } diff --git a/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistAbstract.h b/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistAbstract.h index de55667bb..b296e4bd1 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistAbstract.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistAbstract.h @@ -18,10 +18,10 @@ public: ConfigPlistAbstractClass() {}; - bool parse(XmlLiteParser* xmlLiteParser, const XString8& xmlPath); - bool parse(const LString8& buf, size_t size, const XString8& xmlPath, XmlLiteParser* xmlLiteParser); - bool parse(const LString8& buf, size_t size, const XString8& xmlPath); - bool parse(const LString8& buf, size_t size); + XBool parse(XmlLiteParser* xmlLiteParser, const XString8& xmlPath); + XBool parse(const LString8& buf, size_t size, const XString8& xmlPath, XmlLiteParser* xmlLiteParser); + XBool parse(const LString8& buf, size_t size, const XString8& xmlPath); + XBool parse(const LString8& buf, size_t size); }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistClass.h b/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistClass.h index 20d95bae7..11d2b7037 100755 --- a/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistClass.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistClass.h @@ -101,7 +101,7 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !isDefined() ) return true; if ( LString8(ACPI.DSDT.Fixes.ACPI_DSDT_Fixe_Array[29].getNewName()) != "FixHeaders_20000000"_XS8 ) { diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI.h index 0f3234bf6..1ec33752e 100755 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI.h @@ -76,7 +76,7 @@ public: class Signature_Class : public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !isDefined() ) return true; if ( xstring8.length() == 4 ) return true; @@ -111,7 +111,7 @@ public: return *(UINT64*)&Id; }; UINT32 dgetTabLength() const { return Length.isDefined() ? Length.value() : 0; }; - bool dgetOtherOS() const { return DropForAllOS.isDefined() ? DropForAllOS.value() : false; }; + XBool dgetOtherOS() const { return DropForAllOS.isDefined() ? DropForAllOS.value() : XBool(false); }; }; @@ -173,13 +173,13 @@ public: const decltype(FixHeaders)& getFixHeaders() const { return FixHeaders; }; - bool dgetSlpSmiEnable() const { return HaltEnabler.isDefined() ? HaltEnabler.value() : false; }; - bool dgetFixHeaders() const { return FixHeaders.isDefined() ? FixHeaders.value() : false; }; - bool dgetFixMCFG() const { return FixMCFG.isDefined() ? FixMCFG.value() : false; }; - bool dgetNoASPM() const { return DisableASPM.isDefined() ? DisableASPM.value() : false; }; - bool dgetsmartUPS() const { return smartUPS.isDefined() ? smartUPS.value() : false; }; - bool dgetPatchNMI() const { return PatchAPIC.isDefined() ? PatchAPIC.value() : false; }; - bool dgetAutoMerge() const { return AutoMerge.isDefined() ? AutoMerge.value() : false; }; + XBool dgetSlpSmiEnable() const { return HaltEnabler.isDefined() ? HaltEnabler.value() : XBool(false); }; + XBool dgetFixHeaders() const { return FixHeaders.isDefined() ? FixHeaders.value() : XBool(false); }; + XBool dgetFixMCFG() const { return FixMCFG.isDefined() ? FixMCFG.value() : XBool(false); }; + XBool dgetNoASPM() const { return DisableASPM.isDefined() ? DisableASPM.value() : XBool(false); }; + XBool dgetsmartUPS() const { return smartUPS.isDefined() ? smartUPS.value() : XBool(false); }; + XBool dgetPatchNMI() const { return PatchAPIC.isDefined() ? PatchAPIC.value() : XBool(false); }; + XBool dgetAutoMerge() const { return AutoMerge.isDefined() ? AutoMerge.value() : XBool(false); }; const decltype(DisabledAML)::ValueType& dgetDisabledAML() const { return DisabledAML.isDefined() ? DisabledAML.value() : DisabledAML.nullValue; }; const decltype(SortedOrder)::ValueType& dgetSortedACPI() const { return SortedOrder.isDefined() ? SortedOrder.value() : SortedOrder.nullValue; }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_DSDT.cpp b/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_DSDT.cpp index 989f8299e..afe6c3738 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_DSDT.cpp +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_DSDT.cpp @@ -12,7 +12,7 @@ -XmlAbstractType& ConfigPlistClass::ACPI_Class::DSDT_Class::ACPI_DSDT_Fixes_Class::parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, bool* keyFound) +XmlAbstractType& ConfigPlistClass::ACPI_Class::DSDT_Class::ACPI_DSDT_Fixes_Class::parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, XBool* keyFound) { #ifdef JIEF_DEBUG if ( strncmp(keyValue, "FixHeaders", strlen("FixHeaders")) == 0 ) { diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_DSDT.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_DSDT.h index 9e3beada4..736e88c72 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_DSDT.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_DSDT.h @@ -35,8 +35,8 @@ public: ACPI_DSDT_Fix& operator = (const ACPI_DSDT_Fix&) = delete; // { panic("copy ctor"); }; // = delete; virtual const char* getDescription() override { panic("not defined"); }; - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { panic("not defined"); }; - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override { panic("not defined"); }; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { panic("not defined"); }; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override { panic("not defined"); }; virtual void reset() override { super::reset(); @@ -48,10 +48,10 @@ public: const CHAR8* getOldName() const { return m_oldName; } uint32_t getBitData() const { return m_bitData; } - bool dgetOldEnabled() const { return oldEnabled.isDefined() ? oldEnabled.value() : false; }; - bool dgetNewEnabled() const { return newEnabled.isDefined() ? newEnabled.value() : false; }; + XBool dgetOldEnabled() const { return oldEnabled.isDefined() ? oldEnabled.value() : XBool(false); }; + XBool dgetNewEnabled() const { return newEnabled.isDefined() ? newEnabled.value() : XBool(false); }; - bool dgetEnabled() const { + XBool dgetEnabled() const { if ( oldEnabled.isDefined() && oldEnabled.value() ) return true; if ( newEnabled.isDefined() && newEnabled.value() ) return true; return false; @@ -104,9 +104,9 @@ public: } }; - virtual XmlAbstractType& parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, bool* keyFound) override; + virtual XmlAbstractType& parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, XBool* keyFound) override; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !isDefined() ) return true; // if ( LString8(ACPI_DSDT_Fixe_Array[29].getNewName()) != "FixHeaders_20000000"_XS8 ) { @@ -135,7 +135,7 @@ public: } return FixDsdt; } - bool dgetFixHeaders() const { + XBool dgetFixHeaders() const { return getFixHeaders().dgetEnabled(); } }; @@ -147,7 +147,7 @@ public: class TgtBridgeClass : public XmlData { using super = XmlData; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { #ifdef JIEF_DEBUG if ( xmlPath.contains("ACPI/DSDT/Patches[15]"_XS8) ) { NOP; @@ -175,8 +175,8 @@ if ( xmlPath.contains("ACPI/DSDT/Patches[15]"_XS8) ) { virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; public: - bool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : false; }; - uint8_t dgetBValue() const { return Disabled.isDefined() ? Disabled.value() : false; }; + XBool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : XBool(false); }; + uint8_t dgetBValue() const { return Disabled.isDefined() ? Disabled.value() : XBool(false); }; XString8 dgetPatchDsdtLabel() const { return Comment.isDefined() ? Comment.value() : "(NoLabel)"_XS8; }; const XBuffer& dgetPatchDsdtFind() const { return Find.isDefined() ? Find.value() : XBuffer::NullXBuffer; }; const XBuffer& dgetPatchDsdtReplace() const { return Replace.isDefined() ? Replace.value() : XBuffer::NullXBuffer; }; @@ -211,8 +211,8 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; XString8 dgetDsdtName() const { return Name.isDefined() && Name.value().notEmpty() ? Name.value() : "DSDT.aml"_XS8; }; - bool dgetDebugDSDT() const { return Debug.isDefined() ? Debug.value() : false; }; - bool dgetRtc8Allowed() const { return Rtc8Allowed.isDefined() ? Rtc8Allowed.value() : false; }; + XBool dgetDebugDSDT() const { return Debug.isDefined() ? Debug.value() : XBool(false); }; + XBool dgetRtc8Allowed() const { return Rtc8Allowed.isDefined() ? Rtc8Allowed.value() : XBool(false); }; uint8_t dgetPNLF_UID() const { return isDefined() ? PNLF_UID.isDefined() ? PNLF_UID.value() : 0x0a : 0; }; // TODO: different default value if section is not defined uint32_t dgetFixDsdt() const { // priority is given to Fixes @@ -221,8 +221,8 @@ public: }; // const ACPI_DSDT_Fixes_Class& getFixes() const { return Fixes; }; // const XmlArray& getPatches() const { return Patches; }; - bool dgetReuseFFFF() const { return ReuseFFFF.isDefined() ? ReuseFFFF.value() : false; }; - bool dgetSuspendOverride() const { return SuspendOverride.isDefined() ? SuspendOverride.value() : false; }; + XBool dgetReuseFFFF() const { return ReuseFFFF.isDefined() ? ReuseFFFF.value() : XBool(false); }; + XBool dgetSuspendOverride() const { return SuspendOverride.isDefined() ? SuspendOverride.value() : XBool(false); }; }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_SSDT.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_SSDT.h index e38b627ed..2d6dda3e7 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_SSDT.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_ACPI_SSDT.h @@ -37,11 +37,11 @@ protected: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - bool dgetPStates() const { return PStates.isDefined() ? PStates.value() : false; }; - bool dgetCStates() const { return CStates.isDefined() ? CStates.value() : false; }; - bool dgetAPSN() const { return APSN.isDefined() ? APSN.value() : false; }; - bool dgetAPLF() const { return APLF.isDefined() ? APLF.value() : false; }; - bool dgetPluginType() const { return PluginType.isDefined() ? PluginType.value() : false; }; + XBool dgetPStates() const { return PStates.isDefined() ? PStates.value() : XBool(false); }; + XBool dgetCStates() const { return CStates.isDefined() ? CStates.value() : XBool(false); }; + XBool dgetAPSN() const { return APSN.isDefined() ? APSN.value() : XBool(false); }; + XBool dgetAPLF() const { return APLF.isDefined() ? APLF.value() : XBool(false); }; + XBool dgetPluginType() const { return PluginType.isDefined() ? PluginType.value() : XBool(false); }; undefinable_bool getPStates() const { return PStates.isDefined() ? undefinable_bool(PStates.value()) : undefinable_bool(); }; undefinable_bool getCStates() const { return CStates.isDefined() ? undefinable_bool(CStates.value()) : undefinable_bool(); }; @@ -65,23 +65,23 @@ public: public: virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - bool dgetGeneratePStates() const { + XBool dgetGeneratePStates() const { if ( xmlBool.isDefined() ) return xmlBool.value(); return xmlDict.dgetPStates(); } - bool dgetGenerateCStates() const { + XBool dgetGenerateCStates() const { if ( xmlBool.isDefined() ) return xmlBool.value(); return xmlDict.dgetCStates(); } - bool dgetGenerateAPSN() const { + XBool dgetGenerateAPSN() const { if ( xmlBool.isDefined() ) return xmlBool.value(); return xmlDict.dgetAPSN(); } - bool dgetGenerateAPLF() const { + XBool dgetGenerateAPLF() const { if ( xmlBool.isDefined() ) return xmlBool.value(); return xmlDict.dgetAPLF(); } - bool dgetGeneratePluginType() const { + XBool dgetGeneratePluginType() const { if ( xmlBool.isDefined() ) return xmlBool.value(); return xmlDict.dgetPluginType(); } @@ -152,18 +152,18 @@ protected: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - bool dgetDropSSDTSetting() const { return DropOem.isDefined() ? DropOem.value() : false; }; - bool dgetNoOemTableId() const { return NoOemTableId.isDefined() ? NoOemTableId.value() : false; }; - bool dgetNoDynamicExtract() const { return NoDynamicExtract.isDefined() ? NoDynamicExtract.value() : false; }; - bool dgetEnableISS() const { return UseSystemIO.isDefined() ? UseSystemIO.value() : false; }; - bool dgetEnableC7() const { return EnableC7.isDefined() ? EnableC7.value() : false; }; - bool dget_EnableC6() const { return EnableC6.isDefined() ? EnableC6.value() : false; }; - bool dget_EnableC4() const { return EnableC4.isDefined() ? EnableC4.value() : false; }; - bool dget_EnableC2() const { return EnableC2.isDefined() ? EnableC2.value() : false; }; + XBool dgetDropSSDTSetting() const { return DropOem.isDefined() ? DropOem.value() : XBool(false); }; + XBool dgetNoOemTableId() const { return NoOemTableId.isDefined() ? NoOemTableId.value() : XBool(false); }; + XBool dgetNoDynamicExtract() const { return NoDynamicExtract.isDefined() ? NoDynamicExtract.value() : XBool(false); }; + XBool dgetEnableISS() const { return UseSystemIO.isDefined() ? UseSystemIO.value() : XBool(false); }; + XBool dgetEnableC7() const { return EnableC7.isDefined() ? EnableC7.value() : XBool(false); }; + XBool dget_EnableC6() const { return EnableC6.isDefined() ? EnableC6.value() : XBool(false); }; + XBool dget_EnableC4() const { return EnableC4.isDefined() ? EnableC4.value() : XBool(false); }; + XBool dget_EnableC2() const { return EnableC2.isDefined() ? EnableC2.value() : XBool(false); }; uint16_t dget_C3Latency() const { return C3Latency.isDefined() ? C3Latency.value() : 0; }; uint8_t dgetPLimitDict() const { return PLimitDict.isDefined() ? PLimitDict.value() : 0; }; uint8_t dgetUnderVoltStep() const { return UnderVoltStep.isDefined() ? UnderVoltStep.value() : 0; }; - bool dgetDoubleFirstState() const { return DoubleFirstState.isDefined() ? DoubleFirstState.value() : false; }; + XBool dgetDoubleFirstState() const { return DoubleFirstState.isDefined() ? DoubleFirstState.value() : XBool(false); }; uint8_t dgetMinMultiplier() const { return MinMultiplier.isDefined() ? MinMultiplier.value() : 0; }; uint8_t dgetMaxMultiplier() const { return MaxMultiplier.isDefined() ? MaxMultiplier.value() : 0; }; uint8_t dgetPluginType() const { return PluginType.isDefined() ? PluginType.value() : 0; }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Boot.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Boot.h index 4d9adc4ee..1c1c942c7 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Boot.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Boot.h @@ -31,9 +31,9 @@ class Boot_Class : public XmlDict XmlUnionField m_fields[3] = { xmlBool, xmlInt8, xmlString8 }; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); - if ( xmlBool.isDefined() ) return true; // ok, whatever bool value is + if ( xmlBool.isDefined() ) return true; // ok, whatever XBool value is if ( xmlInt8.isDefined() ) { if ( xmlInt8.value() < -1 || xmlInt8.value() > 2 ) { xmlLiteParser->addWarning(generateErrors, S8Printf("XMPDetection can -1, 0, 1 or 2 for tag '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); @@ -92,7 +92,7 @@ public: XmlData xmlData = XmlData(); XmlUnionField m_fields[3] = { xmlBool, xmlString8, xmlData}; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( !xmlString8.isDefined() ) return true; if ( xmlString8.value().isEqualIC("Apple") ) return true; @@ -134,25 +134,25 @@ public: /* dget method means get value and returns default if undefined. dget = short for defaultget */ int64_t dgetTimeout() const { return Timeout.isDefined() ? Timeout.value() : -1; }; - bool dgetSkipHibernateTimeout() const { return SkipHibernateTimeout.isDefined() ? SkipHibernateTimeout.value() : false; }; - bool dgetDisableCloverHotkeys() const { return DisableCloverHotkeys.isDefined() ? DisableCloverHotkeys.value() : false; }; + XBool dgetSkipHibernateTimeout() const { return SkipHibernateTimeout.isDefined() ? SkipHibernateTimeout.value() : XBool(false); }; + XBool dgetDisableCloverHotkeys() const { return DisableCloverHotkeys.isDefined() ? DisableCloverHotkeys.value() : XBool(false); }; const XString8& dgetBootArgs() const { return BootArgs.isDefined() ? BootArgs.value() : NullXString8; }; - bool dgetNeverDoRecovery() const { return NeverDoRecovery.isDefined() ? NeverDoRecovery.value() : false; }; + XBool dgetNeverDoRecovery() const { return NeverDoRecovery.isDefined() ? NeverDoRecovery.value() : XBool(false); }; const decltype(DefaultVolume)::ValueType& dgetDefaultVolume() const { if ( !DefaultVolume.isDefined() ) return DefaultVolume.nullValue; if ( DefaultVolume.value().isEqualIC("LastBootedVolume") ) return DefaultVolume.nullValue; return DefaultVolume.isDefined() ? DefaultVolume.value() : DefaultVolume.nullValue; }; const XString8& dgetDefaultLoader() const { return DefaultLoader.isDefined() ? DefaultLoader.value() : NullXString8; }; - bool dgetDebugLog() const { return Debug.isDefined() ? Debug.value() : false; }; - bool dgetFastBoot() const { return FastBoot.isDefined() ? FastBoot.value() : false; }; - bool dgetNoEarlyProgress() const { return NoEarlyProgress.isDefined() ? NoEarlyProgress.value() : false; }; - bool dgetNeverHibernate() const { return NeverHibernate.isDefined() ? NeverHibernate.value() : false; }; - bool dgetStrictHibernate() const { return StrictHibernate.isDefined() ? StrictHibernate.value() : false; }; - bool dgetRtcHibernateAware() const { return RtcHibernateAware.isDefined() ? RtcHibernateAware.value() : false; }; - bool dgetHibernationFixup() const { return HibernationFixup.isDefined() ? HibernationFixup.value() : false; }; - bool dgetSignatureFixup() const { return SignatureFixup.isDefined() ? SignatureFixup.value() : false; }; - INT8 dgetSecureSetting() const { return isDefined() ? SecureBootSetupMode.isDefined() ? SecureBootSetupMode.value() : -1 : 0; }; // to Rename to SecureBootSetupMode // TODO: different default value if section is not defined + XBool dgetDebugLog() const { return Debug.isDefined() ? Debug.value() : XBool(false); }; + XBool dgetFastBoot() const { return FastBoot.isDefined() ? FastBoot.value() : XBool(false); }; + XBool dgetNoEarlyProgress() const { return NoEarlyProgress.isDefined() ? NoEarlyProgress.value() : XBool(false); }; + XBool dgetNeverHibernate() const { return NeverHibernate.isDefined() ? NeverHibernate.value() : XBool(false); }; + XBool dgetStrictHibernate() const { return StrictHibernate.isDefined() ? StrictHibernate.value() : XBool(false); }; + XBool dgetRtcHibernateAware() const { return RtcHibernateAware.isDefined() ? RtcHibernateAware.value() : XBool(false); }; + XBool dgetHibernationFixup() const { return HibernationFixup.isDefined() ? HibernationFixup.value() : XBool(false); }; + XBool dgetSignatureFixup() const { return SignatureFixup.isDefined() ? SignatureFixup.value() : XBool(false); }; + INT8 dgetSecureSetting() const { return isDefined() ? SecureBootSetupMode.isDefined() ? (int)SecureBootSetupMode.value() : -1 : 0; }; // to Rename to SecureBootSetupMode // TODO: different default value if section is not defined UINT8 dgetSecureBootPolicy() const { if ( !SecureBootPolicy.isDefined() ) return 0; if ( SecureBootPolicy.value().length() < 1 ) return 0; @@ -190,14 +190,14 @@ public: // return 0; // }; int8_t dgetXMPDetection() const { return XMPDetection.dgetValue(); } - XString8 dgetLegacyBoot(bool isFirmwareClover) const { return isDefined() ? Legacy.isDefined() ? Legacy.value() : isFirmwareClover ? "PBR"_XS8 : "LegacyBiosDefault"_XS8 : NullXString8; }; // TODO: different default value if section is not defined + XString8 dgetLegacyBoot(XBool isFirmwareClover) const { return isDefined() ? Legacy.isDefined() ? Legacy.value() : isFirmwareClover ? "PBR"_XS8 : "LegacyBiosDefault"_XS8 : NullXString8; }; // TODO: different default value if section is not defined UINT16 dgetLegacyBiosDefaultEntry() const { return LegacyBiosDefaultEntry.isDefined() ? LegacyBiosDefaultEntry.value() : 0; }; const XString8& dgetCustomLogoAsXString8() const { return CustomLogo.xmlString8.isDefined() ? CustomLogo.xmlString8.value() : NullXString8; }; const XBuffer& dgetCustomLogoAsData() const { return CustomLogo.xmlData.isDefined() ? CustomLogo.xmlData.value() : XBuffer::NullXBuffer; }; /* calculated values */ - bool dgetLastBootedVolume() const { return DefaultVolume.isDefined() ? DefaultVolume.value() == "LastBootedVolume"_XS8 : false; } + XBool dgetLastBootedVolume() const { return DefaultVolume.isDefined() ? DefaultVolume.value() == "LastBootedVolume"_XS8 : false; } UINT8 dgetCustomLogoType() const { if ( CustomLogo.xmlBool.isDefined() ) return CustomLogo.xmlBool.value() ? CUSTOM_BOOT_APPLE : CUSTOM_BOOT_USER_DISABLED; if ( CustomLogo.xmlString8.isDefined() ) { diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_CPU.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_CPU.h index 5b8349ba1..1e6813749 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_CPU.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_CPU.h @@ -18,7 +18,7 @@ protected: { using super = XmlUInt32; public: - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( isDefined() && (value() <= 100 || value() >= 20000) ) { return xmlLiteParser->addError(generateErrors, S8Printf("FrequencyMHz must be >200 and <20000 tag '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); @@ -30,7 +30,7 @@ protected: { using super = XmlUInt16; public: - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); return xmlLiteParser->addWarning(generateErrors, S8Printf("Latency is replaced by ACPI/SSDT/C3Latency, value ignored. tag '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); } @@ -75,23 +75,23 @@ public: CPU_Class() {} - uint16_t dgetQPI() const { return QPI.isDefined() ? QPI.value() : false; }; - uint32_t dgetCpuFreqMHz() const { return FrequencyMHz.isDefined() ? FrequencyMHz.value() : false; }; + uint16_t dgetQPI() const { return QPI.isDefined() ? QPI.value() : 0; }; + uint32_t dgetCpuFreqMHz() const { return FrequencyMHz.isDefined() ? FrequencyMHz.value() : 0; }; uint16_t dgetCpuType() const { return Type.isDefined() ? Type.value() : GetAdvancedCpuType(); }; - bool dgetQEMU() const { return QEMU.isDefined() ? QEMU.value() : false; }; - bool dgetUseARTFreq() const { return UseARTFrequency.isDefined() ? UseARTFrequency.value() : false; }; - uint32_t dgetBusSpeed() const { return BusSpeedkHz.isDefined() ? BusSpeedkHz.value() : false; }; + XBool dgetQEMU() const { return QEMU.isDefined() ? QEMU.value() : XBool(false); }; + XBool dgetUseARTFreq() const { return UseARTFrequency.isDefined() ? UseARTFrequency.value() : XBool(false); }; + uint32_t dgetBusSpeed() const { return BusSpeedkHz.isDefined() ? BusSpeedkHz.value() : 0; }; undefinable_bool dget_EnableC6() const { return C6.isDefined() ? undefinable_bool(C6.value()) : undefinable_bool(); }; undefinable_bool dget_EnableC4() const { return C4.isDefined() ? undefinable_bool(C4.value()) : undefinable_bool(); }; undefinable_bool dget_EnableC2() const { return C2.isDefined() ? undefinable_bool(C2.value()) : undefinable_bool(); }; undefinable_uint16 dget_C3Latency() const { return Latency.isDefined() ? undefinable_uint16(Latency.value()) : undefinable_uint16(); }; uint8_t dgetSavingMode() const { return SavingMode.isDefined() ? SavingMode.value() : 0xFF; }; - bool dgetHWPEnable() const { return HWPEnable.isDefined() ? HWPEnable.value() : false; }; + XBool dgetHWPEnable() const { return HWPEnable.isDefined() ? HWPEnable.value() : XBool(false); }; undefinable_uint32 dgetHWPValue() const { return HWPValue.isDefined() ? undefinable_uint32(HWPValue.value()) : undefinable_uint32(); }; uint8_t dgetTDP() const { return TDP.isDefined() ? TDP.value() : false; }; - bool dgetTurboDisabled() const { return TurboDisable.isDefined() ? TurboDisable.value() : false; }; + XBool dgetTurboDisabled() const { return TurboDisable.isDefined() ? TurboDisable.value() : XBool(false); }; - bool dgetUserChange() const { return BusSpeedkHz.isDefined(); }; + XBool dgetUserChange() const { return BusSpeedkHz.isDefined(); }; undefinable_bool getUseARTFreq() const { return UseARTFrequency.isDefined() ? undefinable_bool(UseARTFrequency.value()) : undefinable_bool(); }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices.h index f7567978b..5d36494d6 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices.h @@ -122,9 +122,9 @@ protected: const decltype(SetIntelBacklight)::ValueType& dgetIntelBacklight() const { return SetIntelBacklight.isDefined() ? SetIntelBacklight.value() : SetIntelBacklight.nullValue; }; const decltype(SetIntelMaxBacklight)::ValueType& dgetIntelMaxBacklight() const { return SetIntelMaxBacklight.isDefined() ? SetIntelMaxBacklight.value() : SetIntelMaxBacklight.nullValue; }; const decltype(IntelMaxValue)::ValueType& dgetIntelMaxValue() const { return IntelMaxValue.isDefined() ? IntelMaxValue.value() : IntelMaxValue.nullValue; }; - bool dgetLANInjection() const { return isDefined() ? LANInjection.isDefined() ? LANInjection.value() : true : false; }; // TODO: different default value if section is not defined + XBool dgetLANInjection() const { return isDefined() ? LANInjection.isDefined() ? LANInjection.value() : XBool(true) : XBool(false); }; // TODO: different default value if section is not defined const decltype(HDMIInjection)::ValueType& dgetHDMIInjection() const { return HDMIInjection.isDefined() ? HDMIInjection.value() : HDMIInjection.nullValue; }; - bool dgetNoDefaultProperties() const { return isDefined() ? NoDefaultProperties.isDefined() ? NoDefaultProperties.value() : true : false; }; // TODO: different default value if section is not defined + XBool dgetNoDefaultProperties() const { return isDefined() ? NoDefaultProperties.isDefined() ? NoDefaultProperties.value() : XBool(true) : XBool(false); }; // TODO: different default value if section is not defined const decltype(UseIntelHDMI)::ValueType& dgetUseIntelHDMI() const { return UseIntelHDMI.isDefined() ? UseIntelHDMI.value() : UseIntelHDMI.nullValue; }; const decltype(ForceHPET)::ValueType& dgetForceHPET() const { return ForceHPET.isDefined() ? ForceHPET.value() : ForceHPET.nullValue; }; const decltype(DisableFunctions)::ValueType& dgetDisableFunctions() const { return DisableFunctions.isDefined() ? DisableFunctions.value() : DisableFunctions.nullValue; }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Arbitrary.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Arbitrary.h index e16e98d41..4adde734e 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Arbitrary.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Arbitrary.h @@ -14,7 +14,7 @@ class Devices_Arbitrary_Class : public XmlDict public: // class PciAddrClass : public XmlString8AllowEmpty { -// virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { +// virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { // RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); // if ( isDefined() && value().length() != 8 ) return xmlLiteParser->addError(generateErrors, S8Printf("PciAddr must be 8 chars long (ex 00:00.01) at line %d.", keyPos.getLine())); // return true; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Audio.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Audio.h index c69a6882a..1ececd6de 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Audio.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Audio.h @@ -21,7 +21,7 @@ class Devices_Audio_Class : public XmlDict XmlString8AllowEmpty xmlString8 = XmlString8AllowEmpty(); // TODO: change XmlString8AllowEmpty for XmlString8AllowEmpty XmlUnionField m_fields[2] = { xmlInt32, xmlString8}; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( !xmlString8.isDefined() ) return true; // if ( xmlString8.value().isEqualIC("Detect") ) return true; @@ -45,14 +45,14 @@ class Devices_Audio_Class : public XmlDict }; public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; -// virtual bool validate(XmlLiteParser* xmlLiteParser, const char* name, XmlAbstractType* xmlTyp, const XString8& xmlPath, const XmlParserPosition& pos, bool generateErrors) override; +// virtual XBool validate(XmlLiteParser* xmlLiteParser, const char* name, XmlAbstractType* xmlTyp, const XString8& xmlPath, const XmlParserPosition& pos, XBool generateErrors) override; const decltype(ResetHDA)::ValueType& dgetResetHDA() const { return ResetHDA.isDefined() ? ResetHDA.value() : ResetHDA.nullValue; }; const decltype(AFGLowPowerState)::ValueType& dgetAFGLowPowerState() const { return AFGLowPowerState.isDefined() ? AFGLowPowerState.value() : AFGLowPowerState.nullValue; }; - bool dgetHDAInjection() const { + XBool dgetHDAInjection() const { if ( !Inject.isDefined() ) return false; - if ( Inject.xmlInt32.isDefined() ) return Inject.xmlInt32.value(); + if ( Inject.xmlInt32.isDefined() ) return Inject.xmlInt32.value() != 0; if ( Inject.xmlString8.isDefined() ) { if ( Inject.xmlString8.value().startWithOrEqualToIC("n") ) return false; if ( Inject.xmlString8.value().startWithOrEqualToIC("0x") ) return true; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Properties.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Properties.h index b1e723a9f..d622e227d 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Properties.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Properties.h @@ -33,7 +33,7 @@ class PropertiesUnion: public XmlUnion uint8_t dgetBValue() const { if ( !parent.dgetEnabled() ) return false; - return xmlKey().isDefined() ? xmlKey().isEnabled() : false; + return xmlKey().isDefined() ? xmlKey().isEnabled() : XBool(false); } const keyType::ValueType& dgetKey() const { return xmlKey().isDefined() ? xmlKey().value() : xmlKey().nullValue; }; XBuffer dgetValue() const { return isDefined() ? value() : XBuffer::NullXBuffer; }; @@ -55,7 +55,7 @@ class PropertiesUnion: public XmlUnion public: const keyType::ValueType& dgetLabel() const { return super::xmlKey().isDefined() ? xmlKey().value() : xmlKey().nullValue; }; const keyType::ValueType& dgetDevicePathAsString() const { return xmlKey().isDefined() ? xmlKey().value() : xmlKey().nullValue; }; - bool dgetEnabled() const { return xmlKey().isDefined() ? xmlKey().isEnabled() : false; }; + XBool dgetEnabled() const { return xmlKey().isDefined() ? xmlKey().isEnabled() : XBool(false); }; }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_USB.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_USB.h index 06494e449..eb10ea02d 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_USB.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_USB.h @@ -34,7 +34,7 @@ protected: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; public: - decltype(Inject)::ValueType dgetUSBInjection() const { return Inject.isDefined() ? Inject.value() : true; }; + decltype(Inject)::ValueType dgetUSBInjection() const { return Inject.isDefined() ? Inject.value() : XBool(true); }; const decltype(AddClockID)::ValueType& dgetInjectClockID() const { return AddClockID.isDefined() ? AddClockID.value() : AddClockID.nullValue; }; const decltype(FixOwnership)::ValueType& dgetUSBFixOwnership() const { return FixOwnership.isDefined() ? FixOwnership.value() : FixOwnership.nullValue; }; const decltype(HighCurrent)::ValueType& dgetHighCurrent() const { return HighCurrent.isDefined() ? HighCurrent.value() : HighCurrent.nullValue; }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.cpp b/rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.cpp index 58ff21be6..4e029ab84 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.cpp +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.cpp @@ -14,7 +14,7 @@ #include "ConfigPlistClass.h" -bool ConfigPlistClass::GUI_Class::GUI_Custom_Class::GUI_Custom_Entry_Class::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) { +XBool ConfigPlistClass::GUI_Class::GUI_Custom_Class::GUI_Custom_Entry_Class::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; for ( size_t idx=0 ; idx < SubEntries.size() ; ++idx ) SubEntries.ElementAt(idx).Parent = this; if ( Arguments.isDefined() && AddArguments.isDefined() ) { diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.h index 5b50306ec..6fca4b125 100755 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_GUI.h @@ -36,12 +36,12 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; int64_t dgetPointerSpeed() const { return Speed.isDefined() ? Speed.value() : 2; }; - bool dgetPointerEnabled() const { + XBool dgetPointerEnabled() const { if ( dgetPointerSpeed() <= 0 ) return false; // return false, whatever value Enabled has. if ( Enabled.isDefined() ) return Enabled.value(); return true; // if !Enabled.isDefined(), return true because dgetPointerSpeed() > 0 } - bool dgetPointerMirror() const { return Mirror.isDefined() ? Mirror.value() : false; }; + XBool dgetPointerMirror() const { return Mirror.isDefined() ? Mirror.value() : XBool(false); }; uint64_t dgetDoubleClickTime() const { return DoubleClickTime.isDefined() ? DoubleClickTime.value() : 500; }; }; @@ -49,7 +49,7 @@ public: // -------------------------------------------------- Scan class - // bool or dict + // XBool or dict class GUI_Scan_Class : public XmlUnion { public: @@ -75,15 +75,15 @@ public: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - bool dgetDisableEntryScan() const { return Entries.isDefined() && Entries.value() == false; }; - bool dgetDisableToolScan() const { return Tool.isDefined() && Tool.value() == false; }; - bool dgetLinux() const { return !(Linux.isDefined() && Linux.value() == false); }; - bool dgetNoLegacy() const { + XBool dgetDisableEntryScan() const { return Entries.isDefined() && Entries.value() == false; }; + XBool dgetDisableToolScan() const { return Tool.isDefined() && Tool.value() == false; }; + XBool dgetLinux() const { return !(Linux.isDefined() && Linux.value() == false); }; + XBool dgetNoLegacy() const { if ( !Legacy.isDefined() ) return false; if ( Legacy.xmlBool.isDefined() && Legacy.xmlBool.value() == false ) return true; return false; } - bool dgetLegacyFirst() const { return Legacy.isDefined() && Legacy.xmlString8.isDefined() && Legacy.xmlString8.value().startWithIC("F"); }; + XBool dgetLegacyFirst() const { return Legacy.isDefined() && Legacy.xmlString8.isDefined() && Legacy.xmlString8.value().startWithIC("F"); }; UINT8 dgetKernel() const { if ( !Kernel.isDefined() ) return 0; if ( Kernel.xmlBool.isDefined() ) { @@ -114,23 +114,23 @@ public: XmlUnionField m_fields[2] = { ScanAsBool, ScanAsAsDict}; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - bool dgetDisableEntryScan() const { + XBool dgetDisableEntryScan() const { if ( ScanAsBool.isDefined() && ScanAsBool.value() == false ) return true; return ScanAsAsDict.dgetDisableEntryScan(); } - bool dgetDisableToolScan() const { + XBool dgetDisableToolScan() const { if ( ScanAsBool.isDefined() && ScanAsBool.value() == false ) return true; return ScanAsAsDict.dgetDisableToolScan(); } - bool dgetLinuxScan() const { + XBool dgetLinuxScan() const { if ( !ScanAsAsDict.isDefined() ) return parent.isDefined(); // TODO: different default value if section is not defined return ScanAsAsDict.dgetLinux(); } - bool dgetNoLegacy() const { + XBool dgetNoLegacy() const { if ( ScanAsBool.isDefined() && ScanAsBool.value() == false ) return true; return ScanAsAsDict.dgetNoLegacy(); } - bool dgetLegacyFirst() const { + XBool dgetLegacyFirst() const { if ( !ScanAsAsDict.isDefined() ) return false; return ScanAsAsDict.dgetLegacyFirst(); } @@ -212,7 +212,7 @@ public: XmlString8AllowEmpty xmlString8 = XmlString8AllowEmpty(); XmlUnionField m_fields[2] = { xmlBool, xmlString8}; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( !xmlString8.isDefined() ) return true; if ( xmlString8.value().isEqualIC("Always") ) return true; @@ -281,13 +281,13 @@ public: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override; + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override; - bool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : false; }; + XBool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : XBool(false); }; const XStringW& dgetVolume() const { return Volume.isDefined() ? Volume.value() : NullXStringW; }; const XStringW& dgetPath() const { return Path.isDefined() ? Path.value() : NullXStringW; }; const XStringW& dgetSettings() const { return Settings.isDefined() ? Settings.value() : NullXStringW; }; - XBool dgetCommonSettings() const { return CommonSettings.isDefined() ? CommonSettings.value() : false; }; + XBool dgetCommonSettings() const { return CommonSettings.isDefined() ? CommonSettings.value() : XBool(false); }; const XString8& dgetAddArguments() const { return AddArguments.isDefined() ? AddArguments.value() : NullXString8; }; const undefinable_XString8 dgetArguments() const { return Arguments.isDefined() ? undefinable_XString8(Arguments.value()) : undefinable_XString8(); }; const XString8& dgetm_Title() const { return Title.isDefined() ? Title.value() : NullXString8; }; @@ -319,8 +319,8 @@ public: UINTN Color = AsciiStrHexToUintn(BootBgColor.value()); return EFI_GRAPHICS_OUTPUT_BLT_PIXEL({uint8_t((Color >> 8) & 0xFF),uint8_t((Color >> 16) & 0xFF),uint8_t((Color >> 24) & 0xFF),uint8_t((Color >> 0) & 0xFF)}); } - bool dgetHidden() const { return Hidden.isDefined() && Hidden.xmlBool.isDefined() ? Hidden.xmlBool.value() : false; }; - bool dgetAlwaysHidden() const { return Hidden.isDefined() && Hidden.xmlString8.isDefined() ? Hidden.xmlString8.value().isEqualIC("Always") : false; }; + XBool dgetHidden() const { return Hidden.isDefined() && Hidden.xmlBool.isDefined() ? Hidden.xmlBool.value() : XBool(false); }; + XBool dgetAlwaysHidden() const { return Hidden.isDefined() && Hidden.xmlString8.isDefined() ? Hidden.xmlString8.value().isEqualIC("Always") : false; }; UINT8 dgetType() const { if ( Type.isDefined() ) { if ((Type.value().isEqualIC("OSX")) || @@ -377,10 +377,10 @@ public: } // 2021-04-22 - decltype(ForceTextMode)::ValueType dgetForceTextMode() const { return ForceTextMode.isDefined() ? ForceTextMode.value() : false; }; + decltype(ForceTextMode)::ValueType dgetForceTextMode() const { return ForceTextMode.isDefined() ? ForceTextMode.value() : XBool(false); }; // /* calculated values */ -// UINT8 getFlags(bool NoCachesDefault) const { +// UINT8 getFlags(XBool NoCachesDefault) const { // UINT8 Flags = 0; // if ( Arguments.isDefined() ) Flags = OSFLAG_SET(Flags, OSFLAG_NODEFAULTARGS); // if ( dgetAlwaysHidden() ) Flags = OSFLAG_SET(Flags, OSFLAG_DISABLED); @@ -432,12 +432,12 @@ public: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; return true; } - bool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : false; }; + XBool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : XBool(false); }; const XString8& dget_AddArguments() const { return AddArguments.isDefined() ? AddArguments.value() : NullXString8; }; const undefinable_XString8 dget_Arguments() const { return Arguments.isDefined() ? undefinable_XString8(Arguments.value()) : undefinable_XString8(); }; undefinable_XString8 dget_Title() const { return Title.isDefined() ? undefinable_XString8(Title.value()) : undefinable_XString8(); }; @@ -484,7 +484,7 @@ public: XmlData DriveImageData = XmlData(); class HotKeyClass : public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( !isDefined() ) return true; if ( xstring8.length() != 1 ) { @@ -520,7 +520,7 @@ public: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - bool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : false; }; + XBool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : XBool(false); }; const XString8& dgetVolume() const { return Volume.isDefined() ? Volume.value() : NullXString8; }; const XString8& dgetTitle() const { return Title.isDefined() ? Title.value() : NullXString8; }; const XString8& dgetFullTitle() const { return FullTitle.isDefined() ? FullTitle.value() : NullXString8; }; @@ -529,8 +529,8 @@ public: const XString8& dgetDriveImagePath() const { return DriveImagePath.isDefined() ? DriveImagePath.value() : NullXString8; }; const XBuffer& dgetDriveImageData() const { return DriveImageData.isDefined() ? DriveImageData.value() : XBuffer::NullXBuffer; }; char32_t dgetHotkey() const { return Hotkey.isDefined() && Hotkey.value().notEmpty() ? Hotkey.value()[0] : 0; }; - bool dgetHidden() const { return Hidden.isDefined() && Hidden.xmlBool.isDefined() ? Hidden.xmlBool.value() : false; }; - bool dgetAlwaysHidden() const { return Hidden.isDefined() && Hidden.xmlString8.isDefined() ? Hidden.xmlString8.value().isEqualIC("Always") : false; }; + XBool dgetHidden() const { return Hidden.isDefined() && Hidden.xmlBool.isDefined() ? Hidden.xmlBool.value() : XBool(false); }; + XBool dgetAlwaysHidden() const { return Hidden.isDefined() && Hidden.xmlString8.isDefined() ? Hidden.xmlString8.value().isEqualIC("Always") : false; }; UINT8 dgetType() const { if ( Type.isDefined() ) { if (Type.value().isEqualIC("Windows")) { @@ -581,7 +581,7 @@ public: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - bool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : false; }; + XBool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : XBool(false); }; const XString8& dgetVolume() const { return Volume.isDefined() ? Volume.value() : NullXString8; }; const XString8& dgetPath() const { return Path.isDefined() ? Path.value() : NullXString8; }; const XString8& dgetArguments() const { return Arguments.isDefined() ? Arguments.value() : NullXString8; }; @@ -590,8 +590,8 @@ public: const XString8& dgetImagePath() const { return ImagePath.isDefined() ? ImagePath.value() : NullXString8; }; const XBuffer& dgetImageData() const { return ImageData.isDefined() ? ImageData.value() : XBuffer::NullXBuffer; }; char32_t dgetHotkey() const { return Hotkey.isDefined() && Hotkey.value().notEmpty() ? Hotkey.value()[0] : 0; }; - bool dgetHidden() const { return Hidden.isDefined() && Hidden.xmlBool.isDefined() ? Hidden.xmlBool.value() : false; }; - bool dgetAlwaysHidden() const { return Hidden.isDefined() && Hidden.xmlString8.isDefined() ? Hidden.xmlString8.value().isEqualIC("Always") : false; }; + XBool dgetHidden() const { return Hidden.isDefined() && Hidden.xmlBool.isDefined() ? Hidden.xmlBool.value() : XBool(false); }; + XBool dgetAlwaysHidden() const { return Hidden.isDefined() && Hidden.xmlString8.isDefined() ? Hidden.xmlString8.value().isEqualIC("Always") : false; }; UINT8 dgetVolumeType() const { return VolumeType.isDefined() ? VolumeType.dgetVolumeType() : /*Parent ? Parent->dgetVolumeType() :*/ 0; } // VolumeType is duplicated in DuplicateCustomEntry(), but unconditionnally assigned in FillinCustomEntry(). So no "inheritance" from parent. }; @@ -623,7 +623,7 @@ protected: // EmbeddedThemeType class EmbeddedThemeTypeClass: public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( xstring8.isEqualIC("Dark") ) return true; if ( xstring8.isEqualIC("Light") ) return true; @@ -643,7 +643,7 @@ protected: // ScreenResolution class ScreenResolutionClass: public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); // TODO Check that resolution is Integer x Integer return true; @@ -658,7 +658,7 @@ protected: using super = XmlInt64OrString; public: // ConsoleMode_Class() : XmlInt64OrString(false) {}; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( !xmlString8.isDefined() ) return true; if ( xmlString8.value().isEqualIC("Max") ) return true; @@ -670,7 +670,7 @@ protected: // Language class LanguageClass: public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( xstring8.containsIC("en") ) return true; if ( xstring8.containsIC("ru") ) return true; @@ -733,17 +733,17 @@ public: GUI_Class() : Scan(*this) {} virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; -// virtual bool validate(XmlLiteParser* xmlLiteParser, const char* name, XmlAbstractType* xmlTyp, const XString8& xmlPath, const XmlParserPosition& pos, bool generateErrors) override; +// virtual XBool validate(XmlLiteParser* xmlLiteParser, const char* name, XmlAbstractType* xmlTyp, const XString8& xmlPath, const XmlParserPosition& pos, XBool generateErrors) override; int32_t dgetTimezone() const { return Timezone.isDefined() ? Timezone.value() : 0xFF; }; const XString8& dgetTheme() const { return Theme.isDefined() ? Theme.value() : NullXString8; }; const XString8& dgetEmbeddedThemeType() const { return EmbeddedThemeType.isDefined() ? EmbeddedThemeType.value() : NullXString8; }; - bool dgetPlayAsync() const { return PlayAsync.isDefined() ? PlayAsync.value() : false; }; - bool dgetCustomIcons() const { return CustomIcons.isDefined() ? CustomIcons.value() : false; }; - bool dgetTextOnly() const { return TextOnly.isDefined() ? TextOnly.value() : false; }; - bool dgetShowOptimus() const { return ShowOptimus.isDefined() ? ShowOptimus.value() : false; }; + XBool dgetPlayAsync() const { return PlayAsync.isDefined() ? PlayAsync.value() : XBool(false); }; + XBool dgetCustomIcons() const { return CustomIcons.isDefined() ? CustomIcons.value() : XBool(false); }; + XBool dgetTextOnly() const { return TextOnly.isDefined() ? TextOnly.value() : XBool(false); }; + XBool dgetShowOptimus() const { return ShowOptimus.isDefined() ? ShowOptimus.value() : XBool(false); }; const XString8& dgetScreenResolution() const { return ScreenResolution.isDefined() ? ScreenResolution.value() : NullXString8; }; - bool dgetProvideConsoleGop() const { return isDefined() ? ProvideConsoleGop.isDefined() ? ProvideConsoleGop.value() : true : false; }; // TODO: different default value if section is not defined + XBool dgetProvideConsoleGop() const { return isDefined() ? ProvideConsoleGop.isDefined() ? ProvideConsoleGop.value() : XBool(true) : XBool(false); }; // TODO: different default value if section is not defined int64_t dgetConsoleMode() const { if ( ConsoleMode.xmlInt64.isDefined() ) { return ConsoleMode.xmlInt64.value(); @@ -801,11 +801,11 @@ public: - bool dgetKbdPrevLang() const { return KbdPrevLang.isDefined() ? KbdPrevLang.value() : false; }; + XBool dgetKbdPrevLang() const { return KbdPrevLang.isDefined() ? KbdPrevLang.value() : XBool(false); }; /* calculated value */ - bool getDarkEmbedded(bool isDaylight) const { + XBool getDarkEmbedded(XBool isDaylight) const { if ( !EmbeddedThemeType.isDefined() ) return false; if ( EmbeddedThemeType.value().isEqualIC("Dark") ) return true; if ( EmbeddedThemeType.value().isEqualIC("Daytime") ) return !isDaylight; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Graphics.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Graphics.h index 39d347aa3..977067750 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Graphics.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Graphics.h @@ -88,7 +88,7 @@ public: }; virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); if ( Inject.isDefined() ) { if ( Inject.value() ) { @@ -147,9 +147,9 @@ public: const decltype(ATI)::ValueType& dgetATI() const { return ATI.isDefined() ? ATI.value() : ATI.nullValue; }; const decltype(NVidia)::ValueType& dgetNVidia() const { return NVidia.isDefined() ? NVidia.value() : NVidia.nullValue; }; friend class XmlInjectUnion; - bool isInjectIntelDefined() const { return Intel.isDefined(); }; - bool isInjectATIDefined() const { return ATI.isDefined(); }; - bool isInjectNVidiaDefined() const { return NVidia.isDefined(); }; + XBool isInjectIntelDefined() const { return Intel.isDefined(); }; + XBool isInjectATIDefined() const { return ATI.isDefined(); }; + XBool isInjectNVidiaDefined() const { return NVidia.isDefined(); }; }; class XmlInjectUnion: public XmlUnion @@ -160,7 +160,7 @@ public: XmlUnionField m_fields[2] = { xmlBool, xmlDict}; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; public: - bool dgetGraphicsInjector() const { + XBool dgetGraphicsInjector() const { if ( xmlBool.isDefined() ) return xmlBool.value(); return false; } @@ -168,9 +168,9 @@ public: const decltype(Graphics_Inject_Class::ATI)::ValueType& dgetInjectATI() const { return xmlBool.isDefined() ? xmlBool.value() : xmlDict.isDefined() ? xmlDict.dgetATI() : decltype(Graphics_Inject_Class::ATI)::nullValue; }; const decltype(Graphics_Inject_Class::NVidia)::ValueType& dgetInjectNVidia() const { return xmlBool.isDefined() ? xmlBool.value() : xmlDict.isDefined() ? xmlDict.dgetNVidia() : decltype(Graphics_Inject_Class::NVidia)::nullValue; }; - bool isInjectIntelDefined() const { return xmlBool.isDefined() || xmlDict.isInjectIntelDefined(); }; - bool isInjectATIDefined() const { return xmlBool.isDefined() || xmlDict.isInjectATIDefined(); }; - bool isInjectNVidiaDefined() const { return xmlBool.isDefined() || xmlDict.isInjectNVidiaDefined(); }; + XBool isInjectIntelDefined() const { return xmlBool.isDefined() || xmlDict.isInjectIntelDefined(); }; + XBool isInjectATIDefined() const { return xmlBool.isDefined() || xmlDict.isInjectATIDefined(); }; + XBool isInjectNVidiaDefined() const { return xmlBool.isDefined() || xmlDict.isInjectNVidiaDefined(); }; }; protected: diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_KernelAndKextPatches.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_KernelAndKextPatches.h index d0bc83d1e..9218bd501 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_KernelAndKextPatches.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_KernelAndKextPatches.h @@ -54,9 +54,9 @@ public: // virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; virtual void getFields(XmlDictField** fields, size_t* nb) override { panic("BUG: This cannot be called"); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; - bool b = true; + XBool b = true; // TODO after switch to new parser : name.isEmpty() if ( !Find.isDefined() || Find.value().size() == 0 ) return xmlLiteParser->addWarning(generateErrors, S8Printf("Find has to be defined in dict '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); if ( !Replace.isDefined() || Replace.value().size() == 0 ) return xmlLiteParser->addWarning(generateErrors, S8Printf("One of Find or Replace has to be defined in dict '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); @@ -67,7 +67,7 @@ public: return b; } - bool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : false; }; + XBool dgetDisabled() const { return Disabled.isDefined() ? Disabled.value() : XBool(false); }; const XBuffer& dgetFind() const { return Find.isDefined() ? Find.value() : XBuffer::NullXBuffer; }; const XBuffer& dgetReplace() const { return Replace.isDefined() ? Replace.value() : XBuffer::NullXBuffer; }; XBuffer dgetMaskFind() const @@ -152,9 +152,9 @@ public: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; - bool b = true; + XBool b = true; b = super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors); if ( !Name.isDefined() ) { b = xmlLiteParser->addWarning(generateErrors, S8Printf("Kernel patch is ignored because 'Name' is not defined in dict '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); @@ -165,7 +165,7 @@ public: const XString8& dgetName() const { return Name.isDefined() ? Name.value() : NullXString8; }; XString8 dgetLabel() const override { return Comment.isDefined() ? S8Printf("%s (%s)", Name.value().c_str(), Comment.value().c_str()) : S8Printf("%s (NoLabel)", Name.value().c_str()); }; - bool dgetIsPlistPatch() const { return InfoPlistPatch.isDefined() ? InfoPlistPatch.value() : false; }; + XBool dgetIsPlistPatch() const { return InfoPlistPatch.isDefined() ? InfoPlistPatch.value() : XBool(false); }; // override because of different defaultvalue virtual INTN dgetCount() const override { return Count.isDefined() ? Count.value() : 1; }; @@ -197,8 +197,8 @@ public: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { - bool b = true; + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { + XBool b = true; b = super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors); return b; } @@ -231,8 +231,8 @@ public: public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { - bool b = true; + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { + XBool b = true; b = super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors); return b; } @@ -245,7 +245,7 @@ public: class ForceKextsToLoadClass : public XmlStringWArray { using super = XmlStringWArray; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( value().contains("\\") ) { return xmlLiteParser->addWarning(generateErrors, S8Printf("String cannot contains '\\' for tag '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); @@ -294,9 +294,9 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; - bool b = true; + XBool b = true; if ( !ATIConnectorsController.isDefined() ) { if ( ATIConnectorsData.isDefined() ) { b = xmlLiteParser->addWarning(generateErrors, S8Printf("ATIConnectorsData is ignored because ATIConnectorsController is not defined in dict '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); @@ -324,16 +324,16 @@ public: return true; } - bool dgetKPDebug() const { return Debug.isDefined() ? Debug.value() : false; }; - bool dgetKPKernelLapic() const { return KernelLapic.isDefined() ? KernelLapic.value() : false; }; - bool dgetKPKernelXCPM() const { return KernelXCPM.isDefined() ? KernelXCPM.value() : false; }; - bool dget_KPKernelPm() const { return KernelPm.isDefined() ? KernelPm.value() : false; }; - bool dgetKPPanicNoKextDump() const { return PanicNoKextDump.isDefined() ? PanicNoKextDump.value() : false; }; - bool dget_KPAppleIntelCPUPM() const { return AppleIntelCPUPM.isDefined() ? AppleIntelCPUPM.value() : false; }; - bool dgetKPAppleRTC() const { return AppleRTC.isDefined() ? AppleRTC.value() : true; }; - bool dgetEightApple() const { return EightApple.isDefined() ? EightApple.value() : false; }; - bool dgetKPDELLSMBIOS() const { return DellSMBIOSPatch.isDefined() ? DellSMBIOSPatch.value() : false; }; - uint32_t dgetFakeCPUID() const { return FakeCPUID.isDefined() ? FakeCPUID.value() : false; }; + XBool dgetKPDebug() const { return Debug.isDefined() ? Debug.value() : XBool(false); }; + XBool dgetKPKernelLapic() const { return KernelLapic.isDefined() ? KernelLapic.value() : XBool(false); }; + XBool dgetKPKernelXCPM() const { return KernelXCPM.isDefined() ? KernelXCPM.value() : XBool(false); }; + XBool dget_KPKernelPm() const { return KernelPm.isDefined() ? KernelPm.value() : XBool(false); }; + XBool dgetKPPanicNoKextDump() const { return PanicNoKextDump.isDefined() ? PanicNoKextDump.value() : XBool(false); }; + XBool dget_KPAppleIntelCPUPM() const { return AppleIntelCPUPM.isDefined() ? AppleIntelCPUPM.value() : XBool(false); }; + XBool dgetKPAppleRTC() const { return AppleRTC.isDefined() ? AppleRTC.value() : XBool(true); }; + XBool dgetEightApple() const { return EightApple.isDefined() ? EightApple.value() : XBool(false); }; + XBool dgetKPDELLSMBIOS() const { return DellSMBIOSPatch.isDefined() ? DellSMBIOSPatch.value() : XBool(false); }; + uint32_t dgetFakeCPUID() const { return FakeCPUID.isDefined() ? FakeCPUID.value() : 0; }; const XString8& dgetKPATIConnectorsController() const { return ATIConnectorsController.isDefined() ? ATIConnectorsController.value() : NullXString8; }; const XBuffer& dgetKPATIConnectorsData() const { return ATIConnectorsData.isDefined() ? ATIConnectorsData.value() : XBuffer::NullXBuffer; }; const XBuffer& dgetKPATIConnectorsPatch() const { return ATIConnectorsPatch.isDefined() ? ATIConnectorsPatch.value() : XBuffer::NullXBuffer; }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Quirks.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Quirks.h index 99abc8631..0e605e3e5 100755 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Quirks.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Quirks.h @@ -31,9 +31,9 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; - bool b = true; + XBool b = true; if ( !Address.isDefined() || Address.value() == 0) { if ( Enabled.isDefined() && Enabled.value() ) b = xmlLiteParser->addWarning(generateErrors, S8Printf("Enabled is ignored because Address is not defined or 0 in dict '%s:%d'", xmlPath.c_str(), keyPos.getLine())); } @@ -66,17 +66,17 @@ public: XmlBool ThirdPartyDrives = XmlBool(); XmlBool XhciPortLimit = XmlBool(); - bool dgetAppleXcpmExtraMsrs() const { return AppleXcpmExtraMsrs.isDefined() ? AppleXcpmExtraMsrs.value() : AppleXcpmExtraMsrs.nullValue; }; - bool dgetAppleXcpmForceBoost() const { return AppleXcpmForceBoost.isDefined() ? AppleXcpmForceBoost.value() : AppleXcpmForceBoost.nullValue; }; - bool dgetDisableIoMapper() const { return DisableIoMapper.isDefined() ? DisableIoMapper.value() : DisableIoMapper.nullValue; }; - bool dgetDisableLinkeditJettison() const { return DisableLinkeditJettison.isDefined() ? DisableLinkeditJettison.value() : DisableLinkeditJettison.nullValue; }; - bool dgetDummyPowerManagement() const { return DummyPowerManagement.isDefined() ? DummyPowerManagement.value() : DummyPowerManagement.nullValue; }; - bool dgetExtendBTFeatureFlags() const { return ExtendBTFeatureFlags.isDefined() ? ExtendBTFeatureFlags.value() : ExtendBTFeatureFlags.nullValue; }; - bool dgetExternalDiskIcons() const { return ExternalDiskIcons.isDefined() ? ExternalDiskIcons.value() : ExternalDiskIcons.nullValue; }; - bool dgetIncreasePciBarSize() const { return IncreasePciBarSize.isDefined() ? IncreasePciBarSize.value() : IncreasePciBarSize.nullValue; }; - bool dgetPowerTimeoutKernelPanic() const { return PowerTimeoutKernelPanic.isDefined() ? PowerTimeoutKernelPanic.value() : PowerTimeoutKernelPanic.nullValue; }; - bool dgetThirdPartyDrives() const { return ThirdPartyDrives.isDefined() ? ThirdPartyDrives.value() : ThirdPartyDrives.nullValue; }; - bool dgetXhciPortLimit() const { return XhciPortLimit.isDefined() ? XhciPortLimit.value() : XhciPortLimit.nullValue; }; + XBool dgetAppleXcpmExtraMsrs() const { return AppleXcpmExtraMsrs.isDefined() ? AppleXcpmExtraMsrs.value() : AppleXcpmExtraMsrs.nullValue; }; + XBool dgetAppleXcpmForceBoost() const { return AppleXcpmForceBoost.isDefined() ? AppleXcpmForceBoost.value() : AppleXcpmForceBoost.nullValue; }; + XBool dgetDisableIoMapper() const { return DisableIoMapper.isDefined() ? DisableIoMapper.value() : DisableIoMapper.nullValue; }; + XBool dgetDisableLinkeditJettison() const { return DisableLinkeditJettison.isDefined() ? DisableLinkeditJettison.value() : DisableLinkeditJettison.nullValue; }; + XBool dgetDummyPowerManagement() const { return DummyPowerManagement.isDefined() ? DummyPowerManagement.value() : DummyPowerManagement.nullValue; }; + XBool dgetExtendBTFeatureFlags() const { return ExtendBTFeatureFlags.isDefined() ? ExtendBTFeatureFlags.value() : ExtendBTFeatureFlags.nullValue; }; + XBool dgetExternalDiskIcons() const { return ExternalDiskIcons.isDefined() ? ExternalDiskIcons.value() : ExternalDiskIcons.nullValue; }; + XBool dgetIncreasePciBarSize() const { return IncreasePciBarSize.isDefined() ? IncreasePciBarSize.value() : IncreasePciBarSize.nullValue; }; + XBool dgetPowerTimeoutKernelPanic() const { return PowerTimeoutKernelPanic.isDefined() ? PowerTimeoutKernelPanic.value() : PowerTimeoutKernelPanic.nullValue; }; + XBool dgetThirdPartyDrives() const { return ThirdPartyDrives.isDefined() ? ThirdPartyDrives.value() : ThirdPartyDrives.nullValue; }; + XBool dgetXhciPortLimit() const { return XhciPortLimit.isDefined() ? XhciPortLimit.value() : XhciPortLimit.nullValue; }; OcKernelQuirks_Class(const Quirks_Class& _parent) /*: parent(_parent)*/ {} }; @@ -103,23 +103,23 @@ public: XmlBool SignalAppleOS = XmlBool(); XmlBool SyncRuntimePermissions = XmlBool(); - bool dgetAvoidRuntimeDefrag() const { return parent.isDefined() ? AvoidRuntimeDefrag.isDefined() ? AvoidRuntimeDefrag.value() : true : false; }; // TODO: different default value if section is not defined - bool dgetDevirtualiseMmio() const { return DevirtualiseMmio.isDefined() ? DevirtualiseMmio.value() : DevirtualiseMmio.nullValue; }; - bool dgetDisableSingleUser() const { return DisableSingleUser.isDefined() ? DisableSingleUser.value() : DisableSingleUser.nullValue; }; - bool dgetDisableVariableWrite() const { return DisableVariableWrite.isDefined() ? DisableVariableWrite.value() : DisableVariableWrite.nullValue; }; - bool dgetDiscardHibernateMap() const { return DiscardHibernateMap.isDefined() ? DiscardHibernateMap.value() : DiscardHibernateMap.nullValue; }; - bool dgetEnableSafeModeSlide() const { return parent.isDefined() ? EnableSafeModeSlide.isDefined() ? EnableSafeModeSlide.value() : true : false; }; // TODO: different default value if section is not defined - bool dgetEnableWriteUnprotector() const { return parent.isDefined() ? EnableWriteUnprotector.isDefined() ? EnableWriteUnprotector.value() : true : EnableWriteUnprotector.nullValue; }; // TODO: different default value if section is not defined - bool dgetForceExitBootServices() const { return ForceExitBootServices.isDefined() ? ForceExitBootServices.value() : ForceExitBootServices.nullValue; }; - bool dgetProtectMemoryRegions() const { return ProtectMemoryRegions.isDefined() ? ProtectMemoryRegions.value() : ProtectMemoryRegions.nullValue; }; - bool dgetProtectSecureBoot() const { return ProtectSecureBoot.isDefined() ? ProtectSecureBoot.value() : ProtectSecureBoot.nullValue; }; - bool dgetProtectUefiServices() const { return ProtectUefiServices.isDefined() ? ProtectUefiServices.value() : ProtectUefiServices.nullValue; }; - bool dgetProvideCustomSlide() const { return ProvideCustomSlide.isDefined() ? ProvideCustomSlide.value() : ProvideCustomSlide.nullValue; }; + XBool dgetAvoidRuntimeDefrag() const { return parent.isDefined() ? AvoidRuntimeDefrag.isDefined() ? AvoidRuntimeDefrag.value() : XBool(true) : XBool(false); }; // TODO: different default value if section is not defined + XBool dgetDevirtualiseMmio() const { return DevirtualiseMmio.isDefined() ? DevirtualiseMmio.value() : DevirtualiseMmio.nullValue; }; + XBool dgetDisableSingleUser() const { return DisableSingleUser.isDefined() ? DisableSingleUser.value() : DisableSingleUser.nullValue; }; + XBool dgetDisableVariableWrite() const { return DisableVariableWrite.isDefined() ? DisableVariableWrite.value() : DisableVariableWrite.nullValue; }; + XBool dgetDiscardHibernateMap() const { return DiscardHibernateMap.isDefined() ? DiscardHibernateMap.value() : DiscardHibernateMap.nullValue; }; + XBool dgetEnableSafeModeSlide() const { return parent.isDefined() ? EnableSafeModeSlide.isDefined() ? EnableSafeModeSlide.value() : XBool(true) : XBool(false); }; // TODO: different default value if section is not defined + XBool dgetEnableWriteUnprotector() const { return parent.isDefined() ? EnableWriteUnprotector.isDefined() ? EnableWriteUnprotector.value() : XBool(true) : EnableWriteUnprotector.nullValue; }; // TODO: different default value if section is not defined + XBool dgetForceExitBootServices() const { return ForceExitBootServices.isDefined() ? ForceExitBootServices.value() : ForceExitBootServices.nullValue; }; + XBool dgetProtectMemoryRegions() const { return ProtectMemoryRegions.isDefined() ? ProtectMemoryRegions.value() : ProtectMemoryRegions.nullValue; }; + XBool dgetProtectSecureBoot() const { return ProtectSecureBoot.isDefined() ? ProtectSecureBoot.value() : ProtectSecureBoot.nullValue; }; + XBool dgetProtectUefiServices() const { return ProtectUefiServices.isDefined() ? ProtectUefiServices.value() : ProtectUefiServices.nullValue; }; + XBool dgetProvideCustomSlide() const { return ProvideCustomSlide.isDefined() ? ProvideCustomSlide.value() : ProvideCustomSlide.nullValue; }; uint8_t dgetProvideMaxSlide() const { return ProvideMaxSlide.isDefined() ? ProvideMaxSlide.value() : ProvideMaxSlide.nullValue; }; - bool dgetRebuildAppleMemoryMap() const { return RebuildAppleMemoryMap.isDefined() ? RebuildAppleMemoryMap.value() : RebuildAppleMemoryMap.nullValue; }; - bool dgetSetupVirtualMap() const { return parent.isDefined() ? SetupVirtualMap.isDefined() ? SetupVirtualMap.value() : true : SetupVirtualMap.nullValue; }; // TODO: different default value if section is not defined - bool dgetSignalAppleOS() const { return SignalAppleOS.isDefined() ? SignalAppleOS.value() : SignalAppleOS.nullValue; }; - bool dgetSyncRuntimePermissions() const { return parent.isDefined() ? SyncRuntimePermissions.isDefined() ? SyncRuntimePermissions.value() : true : false; }; // TODO: different default value if section is not defined + XBool dgetRebuildAppleMemoryMap() const { return RebuildAppleMemoryMap.isDefined() ? RebuildAppleMemoryMap.value() : RebuildAppleMemoryMap.nullValue; }; + XBool dgetSetupVirtualMap() const { return parent.isDefined() ? SetupVirtualMap.isDefined() ? SetupVirtualMap.value() : XBool(true) : SetupVirtualMap.nullValue; }; // TODO: different default value if section is not defined + XBool dgetSignalAppleOS() const { return SignalAppleOS.isDefined() ? SignalAppleOS.value() : SignalAppleOS.nullValue; }; + XBool dgetSyncRuntimePermissions() const { return parent.isDefined() ? SyncRuntimePermissions.isDefined() ? SyncRuntimePermissions.value() : XBool(true) : XBool(false); }; // TODO: different default value if section is not defined OcBooterQuirks_Class(const Quirks_Class& _parent) : parent(_parent) {} }; @@ -170,14 +170,14 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; - bool b = true; + XBool b = true; return b; } const decltype(FuzzyMatch)::ValueType& dgetFuzzyMatch() const { return FuzzyMatch.isDefined() ? FuzzyMatch.value() : FuzzyMatch.nullValue; }; const decltype(KernelCache)::ValueType& dgetOcKernelCache() const { return KernelCache.isDefined() ? KernelCache.value() : KernelCache.nullValue; }; -// bool dgetProvideConsoleGop() const { return ProvideConsoleGopEnable.isDefined() ? ProvideConsoleGopEnable.value() : ProvideConsoleGopEnable.nullValue; }; +// XBool dgetProvideConsoleGop() const { return ProvideConsoleGopEnable.isDefined() ? ProvideConsoleGopEnable.value() : ProvideConsoleGopEnable.nullValue; }; UINT32 dgetQuirksMask() const { UINT32 mask = 0; mask |= OcBooterQuirks.dgetAvoidRuntimeDefrag() ? QUIRK_DEFRAG:0; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_RtVariables.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_RtVariables.h index 4961f11ed..a763fdd9a 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_RtVariables.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_RtVariables.h @@ -20,7 +20,7 @@ public: public: class GuidClass : public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !isDefined() ) return true; if ( !IsValidGuidString(xstring8) ) return xmlLiteParser->addWarning(generateErrors, S8Printf("Invalid GUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX in dict '%s:%d'", xstring8.c_str(), xmlPath.c_str(), keyPos.getLine())); @@ -67,7 +67,7 @@ public: XmlData xmlData = XmlData(); XmlUnionField m_fields[2] = { xmlString8, xmlData}; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; -// virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override +// virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override // { // WARNING_IF_DEFINED; // @@ -81,7 +81,7 @@ public: // xmlLiteParser->addError(generateErrors, S8Printf("Expecting \"UseMacAddr0\", \"UseMacAddr1\", a string or data for tag '%s:%d'.", xmlPath.c_str(), pos.getLine())); // return false; // } -// virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { +// virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { //if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; // if ( !xmlString8.isDefined() ) return true; // if ( xmlString8.value().isEqualIC("UseMacAddr0") ) return true; @@ -118,7 +118,7 @@ public: }; // class ROMClass: public XmlData { -// virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { +// virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { //if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; // if ( "UseMacAddr0"_XS8.isEqualIC(value().CData()) ) return true; // if ( "UseMacAddr1"_XS8.isEqualIC(value().CData()) ) return true; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_SystemParameters.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_SystemParameters.h index 500288b05..5ce84f4e0 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_SystemParameters.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_SystemParameters.h @@ -15,7 +15,7 @@ class SystemParameters_Class : public XmlDict public: class InjectKextsClass: public XmlBoolOrString { using super = XmlBoolOrString; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( isDefined() && xmlString8.isDefined() ) { if ( !xmlString8.value().isEqualIC("Detect") ) return xmlLiteParser->addWarning(generateErrors, S8Printf("InjectKexts must be a boolean or \"Detect\" in dict '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -25,7 +25,7 @@ public: }; class CustomUUIDClass : public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !isDefined() ) return true; if ( !IsValidGuidString(xstring8) ) return xmlLiteParser->addWarning(generateErrors, S8Printf(" invalid CustomUUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX in dict '%s:%d'", xstring8.c_str(), xmlPath.c_str(), keyPos.getLine())); @@ -64,20 +64,20 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; - bool b = true; + XBool b = true; return b; } - bool dgetWithKexts() const { return true; } // looks like it can never be false anymore... - bool dgetWithKextsIfNoFakeSMC() const { return InjectKexts.xmlString8.isDefined() ? InjectKexts.xmlString8.value().isEqualIC("Detect") : false; } - bool dgetNoCaches() const { return NoCaches.isDefined() ? NoCaches.value() : false; } - bool dgetBacklightLevelConfig() const { return BacklightLevel.isDefined(); } + XBool dgetWithKexts() const { return true; } // looks like it can never be false anymore... + XBool dgetWithKextsIfNoFakeSMC() const { return InjectKexts.xmlString8.isDefined() ? InjectKexts.xmlString8.value().isEqualIC("Detect") : false; } + XBool dgetNoCaches() const { return NoCaches.isDefined() ? NoCaches.value() : XBool(false); } + XBool dgetBacklightLevelConfig() const { return BacklightLevel.isDefined(); } uint16_t dgetBacklightLevel() const { return BacklightLevel.isDefined() && BacklightLevel.xmlInt16.isDefined() ? BacklightLevel.xmlInt16.value() : 0xFFFF; } const XString8& dgetCustomUuid() const { return CustomUUID.isDefined() ? CustomUUID.value() : NullXString8; } - UINT8 dget_InjectSystemID() const { return InjectSystemID.isDefined() ? InjectSystemID.value() : 2; } - bool dgetNvidiaWeb() const { return NvidiaWeb.isDefined() ? NvidiaWeb.value() : 0; } + UINT8 dget_InjectSystemID() const { return InjectSystemID.isDefined() ? (int)InjectSystemID.value() : 2; } + XBool dgetNvidiaWeb() const { return NvidiaWeb.isDefined() ? NvidiaWeb.value() : XBool(false); } }; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/README.md b/rEFIt_UEFI/Settings/ConfigPlist/README.md index 525d23eab..459ba54a4 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/README.md +++ b/rEFIt_UEFI/Settings/ConfigPlist/README.md @@ -128,7 +128,7 @@ To validate and reject bad input, override the method validate. Imagine we have class CountClass : public XmlInt64 { using super = XmlInt64; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( value() < -2 ) { xmlLiteParser->addWarning(generateErrors, S8Printf("Count cannot be negative. It must a number between -2 and 18 inclusive at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -168,7 +168,7 @@ class MyDictClass : public XmlDict }; virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !type.isDefined() ) { xmlLiteParser->addWarning(generateErrors, S8Printf("Type must befined at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -208,7 +208,7 @@ class MyDictClass : public XmlDict }; virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !type.isDefined() ) { xmlLiteParser->addWarning(generateErrors, S8Printf("Type must befined at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -326,7 +326,7 @@ int32_t valueOne = array[1].value(); // == 2 ### Union -Sometimes, a value can be, for example, a bool or a string. In that case it's easy to declare. Just subclass XmlUnion : +Sometimes, a value can be, for example, a XBool or a string. In that case it's easy to declare. Just subclass XmlUnion : ``` class XmlBoolOrString : public XmlUnion @@ -335,10 +335,10 @@ class XmlBoolOrString : public XmlUnion public: XmlBool xmlBool = XmlBool(); XmlString8 xmlString8 = XmlString8(); - virtual const char* getDescription() override { return "bool or string"; }; + virtual const char* getDescription() override { return "XBool or string"; }; XmlUnionField m_fields[2] = { xmlBool, xmlString8 }; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; }; ``` -In this example, the value will be tried to be parsed as a bool. If it doesn't work, the next possibility is tried. Here it's xmlString8. You can create union with any kind of field you create, including dict and arrays. +In this example, the value will be tried to be parsed as a XBool. If it doesn't work, the next possibility is tried. Here it's xmlString8. You can create union with any kind of field you create, including dict and arrays. diff --git a/rEFIt_UEFI/Settings/ConfigPlist/SMBIOSPlist.h b/rEFIt_UEFI/Settings/ConfigPlist/SMBIOSPlist.h index 9ffee45ea..a6e43ed2c 100755 --- a/rEFIt_UEFI/Settings/ConfigPlist/SMBIOSPlist.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/SMBIOSPlist.h @@ -67,7 +67,7 @@ public: class SlotClass : public XmlUInt64 { using super = XmlUInt64; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !isDefined() ) return xmlLiteParser->addWarning(generateErrors, S8Printf("Slot must be defined as a number between 0 and 15 inclusive at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); if ( value() < 0 ) return xmlLiteParser->addWarning(generateErrors, S8Printf("Slot cannot be negative. It must a number between 0 and 15 inclusive at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -84,7 +84,7 @@ public: XmlString8AllowEmpty Serial = XmlString8AllowEmpty(); class TypeClass: public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( isDefined() ) { if ( xstring8.isEqualIC("DDR") ) return true; @@ -109,7 +109,7 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !Slot.isDefined() ) return false; return true; @@ -136,7 +136,7 @@ public: // Cannot happen if validate has been done properly. panic("invalid value"); } - bool dgetInUse() const { return Size.isDefined() ? Size.value() > 0 : false; }; + XBool dgetInUse() const { return Size.isDefined() ? Size.value() > 0 : false; }; }; @@ -168,9 +168,9 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; - bool b = true; + XBool b = true; return b; } @@ -204,7 +204,7 @@ public: class DeviceClass: public XmlString8AllowEmpty { using super = XmlString8AllowEmpty; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( isDefined() ) { if ( xstring8.isEqualIC("ATI") ) return true; @@ -233,9 +233,9 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; - bool b = true; + XBool b = true; return b; } const decltype(Device)::ValueType& dgetDevice() const { return Device.isDefined() ? Device.value() : Device.nullValue; }; @@ -307,7 +307,7 @@ public: { using super = XmlString8AllowEmpty; protected: - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !isDefined() ) return true; if ( !IsValidGuidString(xstring8) ) return xmlLiteParser->addWarning(generateErrors, S8Printf("Invalid SmUUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX in dict '%s:%d'", xstring8.c_str(), xmlPath.c_str(), keyPos.getLine())); @@ -320,7 +320,7 @@ public: using super = XmlString8Trimed; public: ProductNameClass() : super(true) {}; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !isDefined() ) { xmlLiteParser->addError(generateErrors, S8Printf("You must define ProductName in SMBIOS dict, line %d", keyPos.getLine())); @@ -410,7 +410,7 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !ProductName.isDefined() ) { return xmlLiteParser->addWarning(generateErrors, S8Printf("ProductName is not defined, the whole SMBIOS dict is ignored at line %d.", keyPos.getLine())); @@ -486,7 +486,7 @@ public: } return GetModelFromString(ProductName.value()); // ProductName has been validated, so Model CANNOT be MaxMachineType } - bool hasModel() const { return ProductName.isDefined(); } + XBool hasModel() const { return ProductName.isDefined(); } MACHINE_TYPES dgetModel() const { @@ -619,8 +619,8 @@ public: decltype(SmbiosVersion)::ValueType dgetSmbiosVersion() const { return SmbiosVersion.isDefined() ? SmbiosVersion.value() : 0x204; }; decltype(MemoryRank)::ValueType dgetAttribute() const { return MemoryRank.isDefined() ? MemoryRank.value() : -1; }; - decltype(Trust)::ValueType dgetTrustSMBIOS() const { return Trust.isDefined() ? Trust.value() : true; }; - bool dgetInjectMemoryTables() const { return Memory.Modules.isDefined() && Memory.Modules.size() > 0 ? Memory.dgetSlotCounts() > 0 : false; }; + decltype(Trust)::ValueType dgetTrustSMBIOS() const { return Trust.isDefined() ? Trust.value() : XBool(true); }; + XBool dgetInjectMemoryTables() const { return Memory.Modules.isDefined() && Memory.Modules.size() > 0 ? Memory.dgetSlotCounts() > 0 : false; }; decltype(PlatformFeature)::ValueType dgetgPlatformFeature() const { if ( PlatformFeature.isDefined() ) return PlatformFeature.value(); return GetPlatformFeature(dgetModel()); diff --git a/rEFIt_UEFI/Settings/Self.cpp b/rEFIt_UEFI/Settings/Self.cpp index 36847cebb..43355743f 100644 --- a/rEFIt_UEFI/Settings/Self.cpp +++ b/rEFIt_UEFI/Settings/Self.cpp @@ -5,8 +5,8 @@ * Author: jief */ -#include "../Settings/Self.h" #include +#include "../Settings/Self.h" #include "../refit/lib.h" #ifndef DEBUG_ALL @@ -21,7 +21,7 @@ #define DBG(...) DebugLog(DEBUG_SELF, __VA_ARGS__) #endif -EFI_STATUS Self::__initialize(bool debugMsg, EFI_HANDLE SelfImageHandle, EFI_LOADED_IMAGE** SelfLoadedImagePtr, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL** SelfSimpleVolumePtr, EFI_FILE** SelfVolumeRootDirPtr, XStringW* CloverDirFullPathPtr, XStringW* efiFileNamePtr, EFI_FILE** CloverDirPtr) +EFI_STATUS Self::__initialize(XBool debugMsg, EFI_HANDLE SelfImageHandle, EFI_LOADED_IMAGE** SelfLoadedImagePtr, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL** SelfSimpleVolumePtr, EFI_FILE** SelfVolumeRootDirPtr, XStringW* CloverDirFullPathPtr, XStringW* efiFileNamePtr, EFI_FILE** CloverDirPtr) { EFI_STATUS Status; @@ -131,7 +131,7 @@ Self self; constexpr const LStringW THEMES_DIRNAME = L"Themes"_XSW; -EFI_STATUS Self::_openDir(const XStringW& path, bool* b, EFI_FILE** efiDir) +EFI_STATUS Self::_openDir(const XStringW& path, XBool* b, EFI_FILE** efiDir) { EFI_STATUS Status; Status = m_CloverDir->Open(m_CloverDir, efiDir, path.wc_str(), EFI_FILE_MODE_READ, 0); diff --git a/rEFIt_UEFI/Settings/Self.h b/rEFIt_UEFI/Settings/Self.h index e77c8843d..39d502450 100644 --- a/rEFIt_UEFI/Settings/Self.h +++ b/rEFIt_UEFI/Settings/Self.h @@ -20,7 +20,7 @@ class Self { // Class method, usable even without any instance of Self. protected: - static EFI_STATUS __initialize(bool debugMsg, EFI_HANDLE m_SelfImageHandle, EFI_LOADED_IMAGE** m_SelfLoadedImage, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL** m_SelfSimpleVolumePtr, EFI_FILE** m_SelfVolumeRootDirPtr, XStringW* m_CloverDirFullPathPtr, XStringW* m_efiFileNamePtr, EFI_FILE** m_CloverDirPtr); + static EFI_STATUS __initialize(XBool debugMsg, EFI_HANDLE m_SelfImageHandle, EFI_LOADED_IMAGE** m_SelfLoadedImage, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL** m_SelfSimpleVolumePtr, EFI_FILE** m_SelfVolumeRootDirPtr, XStringW* m_CloverDirFullPathPtr, XStringW* m_efiFileNamePtr, EFI_FILE** m_CloverDirPtr); public: static const EFI_FILE_PROTOCOL* getCloverDirAndEfiFileName(EFI_HANDLE ImageHandle, XStringW* efiFileName); @@ -39,10 +39,10 @@ protected: XStringW m_CloverDirFullPath {}; // full path of folder containing this efi. XStringW m_CloverDirFullPath4Display {}; // prettier for diplay - bool m_ThemesDirExists {}; + XBool m_ThemesDirExists {}; EFI_FILE *m_ThemesDir {}; - EFI_STATUS _openDir(const XStringW& path, bool* b, EFI_FILE** efiDir); + EFI_STATUS _openDir(const XStringW& path, XBool* b, EFI_FILE** efiDir); EFI_STATUS _initialize(); public: @@ -56,7 +56,7 @@ public: EFI_STATUS reInitialize(); void closeHandle(); - bool isInitialized() const { return m_CloverDir != NULL; } + XBool isInitialized() const { return m_CloverDir != NULL; } void checkInitialized() const { #ifdef DEBUG @@ -80,7 +80,7 @@ public: const XStringW& getCloverDirFullPath() { checkInitialized(); return m_CloverDirFullPath; } const XStringW& getCloverDirFullPath4Display() { checkInitialized(); return m_CloverDirFullPath4Display; } - bool themesDirExists() { checkInitialized(); return m_ThemesDirExists; } + XBool themesDirExists() { checkInitialized(); return m_ThemesDirExists; } const EFI_FILE& getThemesDir() { checkInitialized(); return *m_ThemesDir; } }; diff --git a/rEFIt_UEFI/Settings/SelfOem.cpp b/rEFIt_UEFI/Settings/SelfOem.cpp index e34cbaa57..223de549a 100644 --- a/rEFIt_UEFI/Settings/SelfOem.cpp +++ b/rEFIt_UEFI/Settings/SelfOem.cpp @@ -30,7 +30,7 @@ constexpr const LStringW KEXTS_DIRNAME = L"Kexts"_XSW; SelfOem selfOem; -//EFI_STATUS SelfOem::_openDir(const XStringW& path, bool* b, EFI_FILE** efiDir) +//EFI_STATUS SelfOem::_openDir(const XStringW& path, XBool* b, EFI_FILE** efiDir) //{ // EFI_STATUS Status; // Status = self.getCloverDir().Open(&self.getCloverDir(), efiDir, path.wc_str(), EFI_FILE_MODE_READ, 0); @@ -45,7 +45,7 @@ SelfOem selfOem; //} -bool SelfOem::_checkOEMPath() +XBool SelfOem::_checkOEMPath() { EFI_STATUS Status; @@ -74,7 +74,7 @@ bool SelfOem::_checkOEMPath() return true; } -bool SelfOem::_setOemPathRelToSelfDir(bool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, const XObjArray& lanCardArray) +XBool SelfOem::_setOemPathRelToSelfDir(XBool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, const XObjArray& lanCardArray) { for ( size_t idx = 0 ; idx < lanCardArray.size() ; ++idx ) { m_OemPathRelToSelfDir.SWPrintf("OEM\\%s--%02X-%02X-%02X-%02X-%02X-%02X", OEMProduct.c_str(), lanCardArray[idx].MacAddress[0], lanCardArray[idx].MacAddress[1], lanCardArray[idx].MacAddress[2], lanCardArray[idx].MacAddress[3], lanCardArray[idx].MacAddress[4], lanCardArray[idx].MacAddress[5]); @@ -170,7 +170,7 @@ EFI_STATUS SelfOem::_initialize() return EFI_SUCCESS; } -EFI_STATUS SelfOem::initialize(const XString8& confName, bool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, const XObjArray& lanCardArray) +EFI_STATUS SelfOem::initialize(const XString8& confName, XBool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, const XObjArray& lanCardArray) { if ( m_ConfName.notEmpty() ) { log_technical_bug("%s : cannot be called twice. Use reinitialize.", __PRETTY_FUNCTION__); diff --git a/rEFIt_UEFI/Settings/SelfOem.h b/rEFIt_UEFI/Settings/SelfOem.h index 71da0c953..b8c4b07aa 100644 --- a/rEFIt_UEFI/Settings/SelfOem.h +++ b/rEFIt_UEFI/Settings/SelfOem.h @@ -16,7 +16,7 @@ class SelfOem protected: XString8 m_ConfName = NullXString8; // Initialisation required by -Weffc++. Couldn't use default ctor. -// bool m_OemDirExists; +// XBool m_OemDirExists; EFI_FILE* m_OemDir = NULL; XStringW m_OemPathRelToSelfDir = NullXStringW; XStringW m_OemFulPath = NullXStringW; @@ -29,9 +29,9 @@ protected: XStringW m_KextsPathRelToSelfDir = NullXStringW; XStringW m_KextsFullPath = NullXStringW; -// EFI_STATUS _openDir(const XStringW& path, bool* b, EFI_FILE** efiDir); - bool _checkOEMPath(); - bool _setOemPathRelToSelfDir(bool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, const XObjArray& lanCardArray); +// EFI_STATUS _openDir(const XStringW& path, XBool* b, EFI_FILE** efiDir); + XBool _checkOEMPath(); + XBool _setOemPathRelToSelfDir(XBool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, const XObjArray& lanCardArray); EFI_STATUS _initialize(); public: @@ -41,16 +41,16 @@ public: ~SelfOem () {}; - EFI_STATUS initialize(const XString8& confName, bool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, const XObjArray& lanCardArray); + EFI_STATUS initialize(const XString8& confName, XBool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, const XObjArray& lanCardArray); void unInitialize(); EFI_STATUS reInitialize(); void closeHandle(); - bool isInitialized() const { return m_ConfName.notEmpty(); } + XBool isInitialized() const { return m_ConfName.notEmpty(); } const XString8& getConfName() { return m_ConfName; } - bool oemDirExists() { return m_OemPathRelToSelfDir.notEmpty(); } + XBool oemDirExists() { return m_OemPathRelToSelfDir.notEmpty(); } const EFI_FILE& getOemDir() { assert(m_OemDir != NULL); return *m_OemDir; } const XStringW& getOemPathRelToSelfDir() { assert(m_OemPathRelToSelfDir.notEmpty()); return m_OemPathRelToSelfDir; } const XStringW& getOemFullPath() { assert(m_OemFulPath.notEmpty()); return m_OemFulPath; } @@ -61,7 +61,7 @@ public: const XStringW& getConfigDirFullPath() { if ( m_OemDir != NULL ) return getOemFullPath(); return self.getCloverDirFullPath(); } - bool isKextsDirFound() { return m_KextsDir != NULL; } + XBool isKextsDirFound() { return m_KextsDir != NULL; } const EFI_FILE& getKextsDir() { assert(m_KextsDir != NULL); return *m_KextsDir; } const XStringW& getKextsDirPathRelToSelfDir() { assert(m_KextsPathRelToSelfDir.notEmpty()); return m_KextsPathRelToSelfDir; } const XStringW& getKextsFullPath() { assert(m_KextsFullPath.notEmpty()); return m_KextsFullPath; } diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h b/rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h index 814bd38e4..d2979efe9 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h @@ -42,10 +42,10 @@ class XmlArray : public XmlAbstractType, public XObjArray const ValueType& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return *this; } // const ValueType& v() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return *this; } - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("array"); } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("array"); } + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; // Validate remove invalid elements, but doesn't invalidate the whole array. So this is always returning true. - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override; + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override; }; @@ -54,7 +54,7 @@ const typename XmlArray::ValueType XmlArray::nullValue; template -bool XmlArray::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlArray::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; RETURN_IF_FALSE ( xmlLiteParser->consumeOpeningTag("array") ); @@ -94,7 +94,7 @@ bool XmlArray::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& } template -bool XmlArray::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, bool generateErrors) +XBool XmlArray::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, XBool generateErrors) { for ( size_t idx = 0 ; idx < super2::size() ; ) { if ( !super2::ElementAt(idx).validate(xmlLiteParser, xmlPath, pos, generateErrors) ) { @@ -119,18 +119,18 @@ class XmlString8Array : public XmlArray const ValueType& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return array; } virtual void reset() override { super::reset(); array.setEmpty(); }; - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override { - bool b = super::parseFromXmlLite(xmlLiteParser, xmlPath, generateErrors); + XBool b = super::parseFromXmlLite(xmlLiteParser, xmlPath, generateErrors); for ( size_t idx = 0 ; idx < super::size() ; idx++ ) { array.AddReference(&super::ElementAt(idx).value(), false); } return b; } // Validate can remove invalid element. So we have to regenerate 'array'. There is no object copy, so it's very quick - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { - bool b = super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors); + XBool b = super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors); array.setEmpty(); for ( size_t idx = 0 ; idx < super::size() ; idx++ ) { array.AddReference(&super::ElementAt(idx).value(), false); @@ -155,23 +155,23 @@ class XmlStringWArray : public XmlArray const ValueType& value() const { if ( !isDefined() ) log_technical_bug("%s : value is not defined", __PRETTY_FUNCTION__); return array; } virtual void reset() override { super::reset(); array.setEmpty(); }; - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override { #ifdef JIEF_DEBUG if (xmlPath == "/DisableDrivers"_XS8) { NOP; } #endif - bool b = super::parseFromXmlLite(xmlLiteParser, xmlPath, generateErrors); + XBool b = super::parseFromXmlLite(xmlLiteParser, xmlPath, generateErrors); array.setEmpty(); for ( size_t idx = 0 ; idx < super::size() ; idx++ ) { array.AddReference(&super::ElementAt(idx).value(), false); } return b; } - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { - bool b = super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors); + XBool b = super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors); // Validate can remove invalid element. So we have to regenerate 'array'. There is no object copy, so it's very quick array.setEmpty(); for ( size_t idx = 0 ; idx < super::size() ; idx++ ) { diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.cpp b/rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.cpp index e0074965f..0e3ce50c4 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.cpp +++ b/rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.cpp @@ -24,7 +24,7 @@ // } //} // -//bool XmlComposite::isTheNextTag(XmlLiteParser* xmlLiteParser) +//XBool XmlComposite::isTheNextTag(XmlLiteParser* xmlLiteParser) //{ // XmlCompositeField* fields; // size_t nb; @@ -39,7 +39,7 @@ // return false; //} // -//bool XmlComposite::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +//XBool XmlComposite::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) //{ // XmlCompositeField* fields; // size_t nb; @@ -65,7 +65,7 @@ //} // // -//bool XmlComposite::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, bool generateErrors) +//XBool XmlComposite::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, XBool generateErrors) //{ // XmlCompositeField* fields; // size_t nb; diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.h b/rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.h index 514e613cd..8c11c8c14 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteCompositeTypes.h @@ -55,9 +55,9 @@ // // virtual void reset() override; // -// virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override; -// virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; -// virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override; +// virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override; +// virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; +// virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override; //}; // // @@ -77,7 +77,7 @@ // virtual void getFields(XmlCompositeField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; // // // Super class parseFromXmlLite would be fine, execpt for the calculation of xmlPath -// virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override +// virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override // { // if ( !xmlKey.parseFromXmlLite(xmlLiteParser, xmlPath, generateErrors) ) return false; // if ( !xmlValue.parseFromXmlLite(xmlLiteParser, S8Printf("%s/%s", xmlPath.c_str(), xmlKey.xstring8.c_str()), generateErrors) ) return false; diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.cpp b/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.cpp index dfa237b5d..bf857b674 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.cpp +++ b/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.cpp @@ -29,7 +29,7 @@ void XmlDict::reset() /* * Try to parse the tag following a key in a dict */ -XmlAbstractType& XmlDict::parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, bool* keyFound) +XmlAbstractType& XmlDict::parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, XBool* keyFound) { XmlDictField* fields; size_t nb; @@ -88,7 +88,7 @@ if ( strcmp(fieldName, "AutoMerge") == 0 ) { return nullXmlType; } -XmlAbstractType& XmlDict::parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const char** keyValuePtr, +XmlAbstractType& XmlDict::parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const char** keyValuePtr, size_t* keyValueLengthPtr) { const char*& keyValue = *keyValuePtr; @@ -114,7 +114,7 @@ size_t* keyValueLengthPtr) //XmlParserPosition valuePos = xmlLiteParser->getPosition(); //#endif - bool keyFound; + XBool keyFound; XmlAbstractType& xmlAbstractType = parseValueFromXmlLite(xmlLiteParser, xmlSubPath, generateErrors, keyPos, keyValue, keyValueLength, &keyFound); if ( !keyFound ) { @@ -137,7 +137,7 @@ size_t* keyValueLengthPtr) return xmlAbstractType; } -bool XmlDict::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlDict::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; @@ -158,7 +158,7 @@ bool XmlDict::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xml XmlParserPosition valuePos = xmlLiteParser->getPosition(); (void)valuePos; #endif -// bool keyFound; +// XBool keyFound; // XmlAbstractType& xmlAbstractType = parseValueFromXmlLite(xmlLiteParser, xmlSubPath, generateErrors, keyPos, keyValue, keyValueLength, &keyFound); XmlParserPosition keyPos = xmlLiteParser->getPosition(); @@ -177,7 +177,7 @@ XmlParserPosition valuePos = xmlLiteParser->getPosition(); if ( xmlAbstractType.isDefined() ) { XString8 xmlSubPath = xmlPath.lastChar() == '/' ? S8Printf("%s%.*s", xmlPath.c_str(), (int)keyValueLength, keyValue) : S8Printf("%s/%.*s", xmlPath.c_str(), (int)keyValueLength, keyValue); - bool validated = xmlAbstractType.validate(xmlLiteParser, xmlSubPath, keyPos, generateErrors); + XBool validated = xmlAbstractType.validate(xmlLiteParser, xmlSubPath, keyPos, generateErrors); if ( !validated ) xmlAbstractType.reset(); }else{ if ( xmlLiteParser->getPosition() == beforePos ) { @@ -198,7 +198,7 @@ XmlParserPosition valuePos = xmlLiteParser->getPosition(); return true; } -bool XmlDict::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, bool generateErrors) +XBool XmlDict::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, XBool generateErrors) { (void)xmlLiteParser; (void)xmlPath; diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h b/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h index e6e83aaf0..3e01ec72e 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h @@ -38,13 +38,13 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) { *fields = NULL; *nb = 0; }; - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("dict"); } + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("dict"); } - virtual XmlAbstractType& parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, bool* keyFound); - virtual XmlAbstractType& parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const char** keyValuePtr, size_t* keyValueLengthPtr); - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XmlAbstractType& parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, XBool* keyFound); + virtual XmlAbstractType& parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const char** keyValuePtr, size_t* keyValueLengthPtr); + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override; + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override; }; @@ -93,7 +93,7 @@ protected: XmlKeyType keyTmp = XmlKeyType(); ValueArrayType m_valueArray = ValueArrayType(); public: - bool ignoreCommented = true; + XBool ignoreCommented = true; _XmlRepeatingDict() : super() {}; ~_XmlRepeatingDict() {}; @@ -109,18 +109,18 @@ public: virtual void getFields(XmlDictField** fields, size_t* nb) { panic("BUG : repeating dict don't use getFields()"); }; - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("dict"); } + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("dict"); } -// virtual XmlAbstractType& parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, bool* keyFound); - virtual XmlValueType* parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors); - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; +// virtual XmlAbstractType& parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, XBool* keyFound); + virtual XmlValueType* parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors); + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; -// virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override; +// virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override; }; template -XmlValueType* _XmlRepeatingDict::parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XmlValueType* _XmlRepeatingDict::parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { keyTmp.reset(); if ( keyTmp.parseFromXmlLite(xmlLiteParser, xmlPath, generateErrors) ) { @@ -150,7 +150,7 @@ XmlValueType* _XmlRepeatingDict::parseKeyAn } template -bool _XmlRepeatingDict::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool _XmlRepeatingDict::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; @@ -179,7 +179,7 @@ if ( xmlPath.startWithOrEqualToIC("/Devices/Properties"_XS8) ) { XmlParserPosition valuePos = xmlLiteParser->getPosition(); (void)valuePos; #endif -// bool keyFound; +// XBool keyFound; // XmlAbstractType& xmlAbstractType = parseValueFromXmlLite(xmlLiteParser, xmlSubPath, generateErrors, keyPos, keyValue, keyValueLength, &keyFound); XmlParserPosition keyPos = xmlLiteParser->getPosition(); @@ -199,7 +199,7 @@ XmlParserPosition valuePos = xmlLiteParser->getPosition(); if ( xmlValueType != NULL ) { if ( !xmlValueType->isDefined() ) panic("BUG: parseKeyAndValueFromXmlLite must not return an undefined item"); - bool validated = xmlValueType->validate(xmlLiteParser, S8Printf("%s/%s", xmlPath.c_str(), keyTmp.value().c_str()), keyPos, generateErrors); + XBool validated = xmlValueType->validate(xmlLiteParser, S8Printf("%s/%s", xmlPath.c_str(), keyTmp.value().c_str()), keyPos, generateErrors); if ( validated ) { xmlValueType->setKey(keyTmp); addValue(xmlValueType); @@ -349,9 +349,9 @@ class XmlRepeatingDict> : public _XmlRepeati // const typename XmlClass::ValueType& value() const { return super::value(); } // //// template -//// bool operator ==(const OtherXStringArrayClass &aXStrings) const { return super::operator ==(aXStrings); } +//// XBool operator ==(const OtherXStringArrayClass &aXStrings) const { return super::operator ==(aXStrings); } //// template -//// bool operator !=(const OtherXStringArrayClass &aXStrings) const { return super::operator !=(aXStrings); } +//// XBool operator !=(const OtherXStringArrayClass &aXStrings) const { return super::operator !=(aXStrings); } // //}; // diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp b/rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp index fcb0a65ec..51a619c0c 100755 --- a/rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp +++ b/rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp @@ -19,25 +19,25 @@ #endif -bool strnnIsEqual(const char* key, size_t keyLength, const char* value, size_t valueLength) +XBool strnnIsEqual(const char* key, size_t keyLength, const char* value, size_t valueLength) { if ( keyLength != valueLength ) return false; return strncmp(key, value, keyLength) == 0; } -bool strnIsEqual(const char* key, size_t keyLength, const char* value) +XBool strnIsEqual(const char* key, size_t keyLength, const char* value) { return strnnIsEqual(key, keyLength, value, strlen(value)); } -bool strnnIsEqualIC(const char* key, size_t keyLength, const char* value, size_t valueLength) +XBool strnnIsEqualIC(const char* key, size_t keyLength, const char* value, size_t valueLength) { if ( keyLength != valueLength ) return false; return strncasecmp(key, value, keyLength) == 0; } -bool strnIsEqualIC(const char* key, size_t keyLength, const char* value) +XBool strnIsEqualIC(const char* key, size_t keyLength, const char* value) { return strnnIsEqualIC(key, keyLength, value, strlen(value)); } @@ -182,7 +182,7 @@ void XmlLiteParser::skipHeader() #define IS_TAGCHAR(x) ( ( x >= 'a' && x <='z' ) || ( x >= 'A' && x <='Z' ) || ( x >= '0' && x <= '9' ) ) -bool XmlLiteParser::getNextTag(const char** tag, size_t* length, bool* isOpeningTag, bool* isClosingTag, bool generateErrors) +XBool XmlLiteParser::getNextTag(const char** tag, size_t* length, XBool* isOpeningTag, XBool* isClosingTag, XBool generateErrors) { if (tag == NULL) panic("tag == NULL"); @@ -297,11 +297,11 @@ void XmlLiteParser::getString(const char** string, size_t* length) moveForwardUntil('<'); } -#define RETURN_IF_FALSE(Expression) do { bool b = Expression; if ( !b ) return false; } while (0); +#define RETURN_IF_FALSE(Expression) do { XBool b = Expression; if ( !b ) return false; } while (0); -bool XmlLiteParser::getSimpleTag(const char** tag, size_t* tagLength, const char** value, size_t* valueLength, const char* expectedTag/*, bool valueCanBeEmpty*/, bool generateErrors) +XBool XmlLiteParser::getSimpleTag(const char** tag, size_t* tagLength, const char** value, size_t* valueLength, const char* expectedTag/*, XBool valueCanBeEmpty*/, XBool generateErrors) { - bool isOpeningTag, isClosingTag; + XBool isOpeningTag, isClosingTag; XmlParserPosition pos = getPosition(); RETURN_IF_FALSE( getNextTag(tag, tagLength, &isOpeningTag, &isClosingTag, generateErrors) ); @@ -347,11 +347,11 @@ bool XmlLiteParser::getSimpleTag(const char** tag, size_t* tagLength, const char /* * The opening tag has been read. Skip until the closing tag */ -bool XmlLiteParser::skipUntilClosingTag(const char* tagToSkip, size_t tagToSkipLength, bool generateErrors) +XBool XmlLiteParser::skipUntilClosingTag(const char* tagToSkip, size_t tagToSkipLength, XBool generateErrors) { const char* value; size_t valueLength; - bool b; + XBool b; getString(&value, &valueLength); @@ -363,7 +363,7 @@ while ( valueLength > 0 && (*value == ' ' || *value == '\t' || *value == '\r const char* tag; size_t tagLength; - bool isOpeningTag, isClosingTag; + XBool isOpeningTag, isClosingTag; XmlParserPosition pos = getPosition(); b = getNextTag(&tag, &tagLength, &isOpeningTag, &isClosingTag, generateErrors); @@ -396,12 +396,12 @@ while ( valueLength > 0 && (*value == ' ' || *value == '\t' || *value == '\r return true; } -bool XmlLiteParser::skipNextTag(bool generateErrors) +XBool XmlLiteParser::skipNextTag(XBool generateErrors) { const char* tag; size_t tagLength; - bool isOpeningTag, isClosingTag; - bool b; + XBool isOpeningTag, isClosingTag; + XBool b; XmlParserPosition pos = getPosition(); b = getNextTag(&tag, &tagLength, &isOpeningTag, &isClosingTag, generateErrors); @@ -414,13 +414,13 @@ bool XmlLiteParser::skipNextTag(bool generateErrors) return skipUntilClosingTag(tag, tagLength, generateErrors); } -bool XmlLiteParser::getSimpleTagValue(const char* expectedTag, size_t expectedTagLength, const char** value, size_t* valueLength, XmlParserPosition* xmlParserPosition, bool generateErrors) +XBool XmlLiteParser::getSimpleTagValue(const char* expectedTag, size_t expectedTagLength, const char** value, size_t* valueLength, XmlParserPosition* xmlParserPosition, XBool generateErrors) { const char* tag; size_t tagLength; *xmlParserPosition = getPosition(); - bool b = getSimpleTag(&tag, &tagLength, value, valueLength, expectedTag, generateErrors); + XBool b = getSimpleTag(&tag, &tagLength, value, valueLength, expectedTag, generateErrors); if ( !b ) return false; if ( !strnnIsEqualIC(tag, tagLength, expectedTag, expectedTagLength) ) { addXmlError(generateErrors, S8Printf("Expecting a <%s> at line %d col %d", expectedTag, (*xmlParserPosition).line, (*xmlParserPosition).col)); @@ -439,7 +439,7 @@ bool XmlLiteParser::getSimpleTagValue(const char* expectedTag, size_t expectedTa } -bool XmlLiteParser::getKeyTagValue(const char** value, size_t* valueLength, XmlParserPosition* xmlParserPosition, bool generateErrors) +XBool XmlLiteParser::getKeyTagValue(const char** value, size_t* valueLength, XmlParserPosition* xmlParserPosition, XBool generateErrors) { const char* tag; size_t tagLength; @@ -447,7 +447,7 @@ bool XmlLiteParser::getKeyTagValue(const char** value, size_t* valueLength, XmlP #endif moveForwardUntilSignificant(); // to get the position more accurate *xmlParserPosition = getPosition(); - bool b = getSimpleTag(&tag, &tagLength, value, valueLength, "key", generateErrors); + XBool b = getSimpleTag(&tag, &tagLength, value, valueLength, "key", generateErrors); if ( !b ) { currentPos = *xmlParserPosition; return false; @@ -478,11 +478,11 @@ printf("\n"); } -bool XmlLiteParser::consumeOpeningTag(const char* expectedTag, bool generateErrors) +XBool XmlLiteParser::consumeOpeningTag(const char* expectedTag, XBool generateErrors) { const char* tag; size_t length; - bool isOpeningTag, isClosingTag; + XBool isOpeningTag, isClosingTag; auto pos = currentPos; @@ -501,11 +501,11 @@ bool XmlLiteParser::consumeOpeningTag(const char* expectedTag, bool generateErro return true; } -bool XmlLiteParser::consumeClosingTag(const char* expectedTag, bool generateErrors) +XBool XmlLiteParser::consumeClosingTag(const char* expectedTag, XBool generateErrors) { const char* tag; size_t length; - bool isOpeningTag, isClosingTag; + XBool isOpeningTag, isClosingTag; auto pos = currentPos; @@ -522,11 +522,11 @@ bool XmlLiteParser::consumeClosingTag(const char* expectedTag, bool generateErro return true; } -bool XmlLiteParser::nextTagIsOpeningTag(const char* expectedTag) +XBool XmlLiteParser::nextTagIsOpeningTag(const char* expectedTag) { const char* tag; size_t length; - bool isOpeningTag, isClosingTag; + XBool isOpeningTag, isClosingTag; XmlParserPosition pos = getPosition(); RETURN_IF_FALSE ( getNextTag(&tag, &length, &isOpeningTag, &isClosingTag, false) ); @@ -537,11 +537,11 @@ bool XmlLiteParser::nextTagIsOpeningTag(const char* expectedTag) return true; } -bool XmlLiteParser::nextTagIsClosingTag(const char* expectedTag) +XBool XmlLiteParser::nextTagIsClosingTag(const char* expectedTag) { const char* tag; size_t length; - bool isOpeningTag, isClosingTag; + XBool isOpeningTag, isClosingTag; XmlParserPosition pos = getPosition(); RETURN_IF_FALSE ( getNextTag(&tag, &length, &isOpeningTag, &isClosingTag, false) ); diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteParser.h b/rEFIt_UEFI/cpp_lib/XmlLiteParser.h index 0a7a59ca7..930445ec1 100755 --- a/rEFIt_UEFI/cpp_lib/XmlLiteParser.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteParser.h @@ -8,6 +8,7 @@ #ifndef __XML_LITE_H__ #define __XML_LITE_H__ +#include "../cpp_foundation/XBool.h" #include "../cpp_foundation/XStringArray.h" #include "../cpp_lib/XmlLiteSimpleTypes.h" #include "../cpp_lib/XmlLiteParser.h" @@ -17,17 +18,17 @@ #define __PRETTY_FUNCTION__ __FUNCSIG__ #endif -bool strnnIsEqual(const char* key, size_t keyLength, const char* value, size_t valueLength); -bool strnIsEqual(const char* key, size_t keyLength, const char* value); -bool strnnIsEqualIC(const char* key, size_t keyLength, const char* value, size_t valueLength); -bool strnIsEqualIC(const char* key, size_t keyLength, const char* value); +XBool strnnIsEqual(const char* key, size_t keyLength, const char* value, size_t valueLength); +XBool strnIsEqual(const char* key, size_t keyLength, const char* value); +XBool strnnIsEqualIC(const char* key, size_t keyLength, const char* value, size_t valueLength); +XBool strnIsEqualIC(const char* key, size_t keyLength, const char* value); class XmlParserMessage { public: - bool isError = true; + XBool isError = true; XString8 msg; - XmlParserMessage(bool _isError, const XString8& _msg) : isError(_isError), msg(_msg) {}; + XmlParserMessage(XBool _isError, const XString8& _msg) : isError(_isError), msg(_msg) {}; }; class XmlLiteParser; @@ -49,7 +50,7 @@ public: int getLine() const { return line; } int getCol() const { return col; } - bool operator == (const XmlParserPosition& other) const { + XBool operator == (const XmlParserPosition& other) const { return p == other.p; } }; @@ -63,13 +64,13 @@ class XmlLiteParser XmlParserPosition currentPos = XmlParserPosition(); XObjArray errorsAndWarnings = XObjArray(); - bool AddErrorOrWarning(XmlParserMessage* msg) { + XBool AddErrorOrWarning(XmlParserMessage* msg) { if ( errorsAndWarnings.size() < 500 ) errorsAndWarnings.AddReference(msg, true); if ( errorsAndWarnings.size() == 500 ) errorsAndWarnings.AddReference(new XmlParserMessage(true, "Too many error. Stopping"_XS8), true); return false; } public: - bool xmlParsingError = false; + XBool xmlParsingError = false; XmlLiteParser() {}; XmlLiteParser(char* _p) : p_start(_p) @@ -86,10 +87,10 @@ public: int getCol() { return currentPos.col; } XObjArray& getErrorsAndWarnings() { return errorsAndWarnings; } // Add warning, error and xml error always return false so you can return addWarning(...) from validate function - bool addWarning(bool generateErrors, const XString8& warning) { if ( generateErrors ) AddErrorOrWarning(new XmlParserMessage(false, warning)); return false; } - bool addError(bool generateErrors, const XString8& warning) { if ( generateErrors ) AddErrorOrWarning(new XmlParserMessage(true, warning)); return false; } + XBool addWarning(XBool generateErrors, const XString8& warning) { if ( generateErrors ) AddErrorOrWarning(new XmlParserMessage(false, warning)); return false; } + XBool addError(XBool generateErrors, const XString8& warning) { if ( generateErrors ) AddErrorOrWarning(new XmlParserMessage(true, warning)); return false; } // Xml stuctural error. Parsing should probably stop. - bool addXmlError(bool generateErrors, const XString8& warning) { + XBool addXmlError(XBool generateErrors, const XString8& warning) { if ( generateErrors ) {xmlParsingError = true; AddErrorOrWarning(new XmlParserMessage(true, warning));} return false; } @@ -102,7 +103,7 @@ public: XmlParserPosition getPosition(); void restorePosition(XmlParserPosition& xml_position); - bool isEof() const { return currentPos.p >= p_end; } + XBool isEof() const { return currentPos.p >= p_end; } char getchar(); char* getcharPtr() { return currentPos.p; }; @@ -120,8 +121,8 @@ public: /* * The opening tag has been read. Skip until the closing tag */ - bool skipUntilClosingTag(const char* tagToSkip, size_t tagToSkipLength, bool generateErrors); - bool skipNextTag(bool generateErrors); + XBool skipUntilClosingTag(const char* tagToSkip, size_t tagToSkipLength, XBool generateErrors); + XBool skipNextTag(XBool generateErrors); @@ -139,45 +140,45 @@ public: * Get the next tag, either opening or closing tag. * For empty tag (), first call return that it's an opening tag. Second call return that it's a closing tag. */ - bool getNextTag(const char** tag, size_t* length, bool* isOpeningTag, bool* isClosingTag, bool generateErrors); - bool getSimpleTag(const char** tag, size_t* tagLength, const char** value, size_t* valueLength, const char* expectedTag/*, bool valueCanBeEmpty*/, bool generateErrors); + XBool getNextTag(const char** tag, size_t* length, XBool* isOpeningTag, XBool* isClosingTag, XBool generateErrors); + XBool getSimpleTag(const char** tag, size_t* tagLength, const char** value, size_t* valueLength, const char* expectedTag/*, XBool valueCanBeEmpty*/, XBool generateErrors); - bool getSimpleTagValue(const char* tag, size_t tagLength, const char** value, size_t* valueLength, XmlParserPosition* xmlParserPosition, bool generateErrors); + XBool getSimpleTagValue(const char* tag, size_t tagLength, const char** value, size_t* valueLength, XmlParserPosition* xmlParserPosition, XBool generateErrors); /* * Get the next tag, check it's a key, get the value and consume the closing tag (""). */ - bool getKeyTagValue(const char** value, size_t* valueLength, XmlParserPosition* xmlParserPosition, bool generateErrors); + XBool getKeyTagValue(const char** value, size_t* valueLength, XmlParserPosition* xmlParserPosition, XBool generateErrors); /* * Check and consume the tag * Returns true if it's the expected opening tag * Returns false, add error in error list and don't change position if it's not */ - bool consumeOpeningTag(const char* expectedTag, bool generateErrors = true); + XBool consumeOpeningTag(const char* expectedTag, XBool generateErrors = true); /* * Check and consume the tag * Returns true if it's the expected closing tag * Returns false, add error in error list and don't change position if it's not */ - bool consumeClosingTag(const char* expectedTag, bool generateErrors); + XBool consumeClosingTag(const char* expectedTag, XBool generateErrors); /* * Check but do NOT consume the tag * Returns true if it's the expected opening tag * Returns false, DO NOT add error in error list and don't change position if it's not */ - bool nextTagIsOpeningTag(const char* expectedTag); - bool nextTagIsClosingTag(const char* expectedTag); + XBool nextTagIsOpeningTag(const char* expectedTag); + XBool nextTagIsClosingTag(const char* expectedTag); -// bool getTagBool(XmlBool* XmlBoolean); +// XBool getTagBool(XmlBool* XmlBoolean); }; -#define RETURN_IF_FALSE(Expression) do { bool b = Expression; if ( !b ) return false; } while (0); +#define RETURN_IF_FALSE(Expression) do { XBool b = Expression; if ( !b ) return false; } while (0); diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.cpp b/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.cpp index 9f1b9e9d0..22491425b 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.cpp +++ b/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.cpp @@ -12,11 +12,11 @@ NullXmlType nullXmlType; -#define RETURN_IF_FALSE(Expression) do { bool b = Expression; if ( !b ) return false; } while (0); +#define RETURN_IF_FALSE(Expression) do { XBool b = Expression; if ( !b ) return false; } while (0); const XmlStrictBool::ValueType XmlStrictBool::nullValue = XmlStrictBool::ValueType(); -bool XmlStrictBool::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlStrictBool::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; @@ -52,18 +52,18 @@ if ( xmlPath == "/Boot/XMPDetection"_XS8 ) { return false; } -bool XmlBool::isTheNextTag(XmlLiteParser* xmlLiteParser) +XBool XmlBool::isTheNextTag(XmlLiteParser* xmlLiteParser) { XmlParserPosition pos = xmlLiteParser->getPosition(); - // Because we currently accept string tag as boolean, we have to parse to see if it can be a bool. We can't just check the next tag. + // Because we currently accept string tag as boolean, we have to parse to see if it can be a XBool. We can't just check the next tag. // Use a temporary variable. TODO improve by separating parsing and storage (ie Do not call setBoolValue in parseFromXmlLite(). XmlBool xmlBool; - bool b = xmlBool.parseFromXmlLite(xmlLiteParser, NullXString8, false); + XBool b = xmlBool.parseFromXmlLite(xmlLiteParser, NullXString8, false); xmlLiteParser->restorePosition(pos); return b; } -bool XmlBool::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlBool::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; @@ -119,18 +119,18 @@ if ( xmlPath.containsIC("/Debug"_XS8) ) { } -bool XmlBoolYesNo::isTheNextTag(XmlLiteParser* xmlLiteParser) +XBool XmlBoolYesNo::isTheNextTag(XmlLiteParser* xmlLiteParser) { XmlParserPosition pos = xmlLiteParser->getPosition(); - // Because we currently accept string tag as boolean, we have to parse to see if it can be a bool. We can't just check the next tag. + // Because we currently accept string tag as boolean, we have to parse to see if it can be a XBool. We can't just check the next tag. // Use a temporary variable. TODO improve by separating parsing and storage (ie Do not call setBoolValue in parseFromXmlLite(). XmlBoolYesNo xmlBool; - bool b = xmlBool.parseFromXmlLite(xmlLiteParser, NullXString8, false); + XBool b = xmlBool.parseFromXmlLite(xmlLiteParser, NullXString8, false); xmlLiteParser->restorePosition(pos); return b; } -bool XmlBoolYesNo::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlBoolYesNo::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; @@ -183,7 +183,7 @@ if ( xmlPath.containsIC("/Debug"_XS8) ) { -bool XmlString8::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlString8::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; @@ -230,7 +230,7 @@ if ( out && strcmp(out, "/SMBIOs") == 0 ) { } const XmlString8::ValueType XmlString8::nullValue = XmlString8::ValueType(); -bool XmlStringW::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlStringW::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; @@ -262,7 +262,7 @@ const XmlStringW::ValueType XmlStringW::nullValue = XmlString8::ValueType(); const XmlKey::ValueType XmlKey::nullValue = XmlKey::ValueType(); // TODO only difference with XmlString8::parseFromXmlLite is paramter "key" instead of "string" -bool XmlKey::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const char** keyValuePtr, size_t* keyValueLengthPtr) +XBool XmlKey::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const char** keyValuePtr, size_t* keyValueLengthPtr) { WARNING_IF_DEFINED; @@ -298,7 +298,7 @@ printf("\n"); return false; } -bool XmlKey::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlKey::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { const char* _value; size_t _valueLength; @@ -309,7 +309,7 @@ bool XmlKey::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlP const XmlData::ValueType XmlData::nullValue = XmlData::ValueType(); -bool XmlData::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlData::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { WARNING_IF_DEFINED; @@ -342,7 +342,7 @@ bool XmlData::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xml } -bool XmlIntegerAbstract::isTheNextTag(XmlLiteParser* xmlLiteParser) +XBool XmlIntegerAbstract::isTheNextTag(XmlLiteParser* xmlLiteParser) { if ( xmlLiteParser->nextTagIsOpeningTag("integer") ) return true; @@ -351,8 +351,8 @@ bool XmlIntegerAbstract::isTheNextTag(XmlLiteParser* xmlLiteParser) // Use a temporary variable. TODO improve by separating parsing and storage (ie Do not call setBoolValue in parseFromXmlLite(). UINTN result; - bool negative; - bool b = parseXmlInteger(xmlLiteParser, NullXString8, &result, &negative, INT64_MIN, UINT64_MAX, false); + XBool negative; + XBool b = parseXmlInteger(xmlLiteParser, NullXString8, &result, &negative, INT64_MIN, UINT64_MAX, false); xmlLiteParser->restorePosition(pos); return b; } @@ -362,7 +362,7 @@ bool XmlIntegerAbstract::isTheNextTag(XmlLiteParser* xmlLiteParser) * Minimum can be a positive integer. It's possible to pass minimum=10 and maximum=15. * Maximum can't be a negative integer. */ -bool XmlIntegerAbstract::parseXmlInteger(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, UINTN* resultPtr, bool* negativePtr, INTN minimum, UINTN maximum, bool generateErrors) +XBool XmlIntegerAbstract::parseXmlInteger(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, UINTN* resultPtr, XBool* negativePtr, INTN minimum, UINTN maximum, XBool generateErrors) { WARNING_IF_DEFINED; @@ -375,8 +375,8 @@ bool XmlIntegerAbstract::parseXmlInteger(XmlLiteParser* xmlLiteParser, const XSt RETURN_IF_FALSE( xmlLiteParser->getSimpleTag(&tag, &tagLength, &value, &valueLength, NULL, generateErrors) ); UINTN& result = *resultPtr; - bool& negative = *negativePtr; - bool atLeastOneDigit = false; + XBool& negative = *negativePtr; + XBool atLeastOneDigit = false; #ifdef JIEF_DEBUG if ( xmlPath.contains("CsrActiveConfig") ) { @@ -502,66 +502,66 @@ if ( xmlPath.contains("CsrActiveConfig") ) { } -bool XmlUInt8::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlUInt8::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { UINTN value; - bool sign; + XBool sign; RETURN_IF_FALSE( parseXmlInteger(xmlLiteParser, xmlPath, &value, &sign, 0, UINT8_MAX, generateErrors) ); return setUInt8Value((uint8_t)value, sign); // safe cast because parseXmlInteger minimum/maximum parameter } -bool XmlUInt16::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlUInt16::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { UINTN value; - bool sign; + XBool sign; RETURN_IF_FALSE( parseXmlInteger(xmlLiteParser, xmlPath, &value, &sign, 0, UINT16_MAX, generateErrors) ); return setUInt16Value((uint16_t)value, sign); // safe cast because parseXmlInteger minimum/maximum parameter } -bool XmlUInt32::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlUInt32::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { UINTN value; - bool sign; + XBool sign; RETURN_IF_FALSE( parseXmlInteger(xmlLiteParser, xmlPath, &value, &sign, 0, UINT32_MAX, generateErrors) ); return setUInt32Value((uint32_t)value, sign); // safe cast because parseXmlInteger minimum/maximum parameter } -bool XmlUInt64::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlUInt64::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { UINTN value; - bool sign; + XBool sign; RETURN_IF_FALSE( parseXmlInteger(xmlLiteParser, xmlPath, &value, &sign, 0, UINT64_MAX, generateErrors) ); return setUInt64Value((uint64_t)value, sign); // safe cast because parseXmlInteger minimum/maximum parameter } -bool XmlInt8::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlInt8::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { UINTN value; - bool sign; + XBool sign; RETURN_IF_FALSE( parseXmlInteger(xmlLiteParser, xmlPath, &value, &sign, INT8_MIN, INT8_MAX, generateErrors) ); return setInt8Value((int8_t)value, sign); // safe cast because parseXmlInteger minimum/maximum parameter } -bool XmlInt16::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlInt16::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { UINTN value; - bool sign; + XBool sign; RETURN_IF_FALSE( parseXmlInteger(xmlLiteParser, xmlPath, &value, &sign, INT16_MIN, INT16_MAX, generateErrors) ); return setInt16Value((int16_t)value, sign); // safe cast because parseXmlInteger minimum/maximum parameter } -bool XmlInt32::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlInt32::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { UINTN value; - bool sign; + XBool sign; RETURN_IF_FALSE( parseXmlInteger(xmlLiteParser, xmlPath, &value, &sign, INT32_MIN, INT32_MAX, generateErrors) ); return setInt32Value((int32_t)value, sign); // safe cast because parseXmlInteger minimum/maximum parameter } -bool XmlInt64::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlInt64::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { UINTN value; - bool sign; + XBool sign; RETURN_IF_FALSE( parseXmlInteger(xmlLiteParser, xmlPath, &value, &sign, INT64_MIN, INT64_MAX, generateErrors) ); return setInt64Value((int8_t)value, sign); // safe cast because parseXmlInteger minimum/maximum parameter } diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h b/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h index bf22aa53b..1294a1a64 100755 --- a/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h @@ -40,7 +40,7 @@ static inline void WARNING_IF_DEFINED_breakpoint() class XmlAbstractType { private: - bool m_isDefined; + XBool m_isDefined; public: constexpr XmlAbstractType() : m_isDefined(false) {}; @@ -53,15 +53,15 @@ public: } m_isDefined = true; }; - virtual bool isDefined() const { return m_isDefined; }; + virtual XBool isDefined() const { return m_isDefined; }; virtual void reset() { m_isDefined = false; }; - virtual bool isKey() const { return false; } + virtual XBool isKey() const { return false; } virtual const XString8& getKey() const { return NullXString8; } // virtual void setKey(const char* keyValue, size_t keyValueLength) {}; - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) = 0; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) = 0; /* * Parse just get the tag and value and translate it to the underlying representation. * Return false if there is a parsing problem. @@ -70,21 +70,21 @@ public: * In that case, ignoring the tag and trying to continue is possible. * It MUST NOT call validate. */ - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) = 0; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) = 0; /* * Validate the value. Intended for subclasser. * Return false if value is not accepted. */ - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) { (void)xmlLiteParser; (void)xmlPath; (void)keyPos; (void)generateErrors; return true; }; + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) { (void)xmlLiteParser; (void)xmlPath; (void)keyPos; (void)generateErrors; return true; }; }; class NullXmlType : public XmlAbstractType { virtual const char* getDescription() override { return "null"; }; - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override { (void)xmlLiteParser; (void)xmlPath; (void)generateErrors; panic("NullXmlType : can't call parseFromXmlLite"); }; - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { (void)xmlLiteParser; return false; }; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override { (void)xmlLiteParser; (void)xmlPath; (void)generateErrors; panic("NullXmlType : can't call parseFromXmlLite"); }; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { (void)xmlLiteParser; return false; }; }; extern NullXmlType nullXmlType; @@ -93,31 +93,31 @@ class XmlStrictBool : public XmlAbstractType { using super = XmlAbstractType; public: - using ValueType = bool; + using ValueType = XBool; static const ValueType nullValue; protected: - bool booll = false; + XBool booll; public: - constexpr XmlStrictBool() : super() {}; + constexpr XmlStrictBool() : booll(false) {}; constexpr XmlStrictBool(bool b) : booll(b) { /*if (b) b = 1;*/ } - virtual void reset() override { super::reset(); booll = 0; }; + virtual void reset() override { super::reset(); booll = false; }; virtual const char* getDescription() override { return "boolean"; }; - const bool& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return booll; } + const XBool& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return booll; } - bool setBoolValue(bool b) { setDefined(); booll = b; return true; } + XBool setBoolValue(XBool b) { setDefined(); booll = b; return true; } - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("true") || xmlLiteParser->nextTagIsOpeningTag("false"); }; - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("true") || xmlLiteParser->nextTagIsOpeningTag("false"); }; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlBool : public XmlStrictBool { using super = XmlStrictBool; public: - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override; }; @@ -125,8 +125,8 @@ class XmlBoolYesNo : public XmlStrictBool { using super = XmlBoolYesNo; public: - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override; }; @@ -139,12 +139,12 @@ public: static const ValueType nullValue; protected: - bool canBeEmpty = false; + XBool canBeEmpty = false; ValueType xstring8 = ValueType(); public: XmlString8() : super() {}; - XmlString8(bool _canBeEmpty) : super(), canBeEmpty(_canBeEmpty) {}; + XmlString8(XBool _canBeEmpty) : super(), canBeEmpty(_canBeEmpty) {}; virtual ~XmlString8() {}; virtual const char* getDescription() override { return "string"; }; @@ -154,14 +154,14 @@ public: virtual const ValueType& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return xstring8; } - virtual bool setStringValue(const ValueType& _value) { setDefined(); xstring8 = _value; return true; } - virtual bool setStringValue(const char* s, size_t size) { setDefined(); xstring8.strsicpy(s, size); return true; } - virtual bool stealStringValue(char* s, size_t size) { setDefined(); xstring8.stealValueFrom(s, size); return true; } + virtual XBool setStringValue(const ValueType& _value) { setDefined(); xstring8 = _value; return true; } + virtual XBool setStringValue(const char* s, size_t size) { setDefined(); xstring8.strsicpy(s, size); return true; } + virtual XBool stealStringValue(char* s, size_t size) { setDefined(); xstring8.stealValueFrom(s, size); return true; } - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("string"); } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("string"); } + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; // TODO validate !_canBeEmpty - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { #ifdef JIEF_DEBUG if (xmlPath.containsIC("BoardSerialNumber"_XS8) ) { NOP; @@ -186,24 +186,24 @@ public: static const ValueType nullValue; protected: - bool canBeEmpty = false; + XBool canBeEmpty = false; XStringW xstringW = ValueType(); public: XmlStringW() : super() {}; - XmlStringW(bool _canBeEmpty) : super(), canBeEmpty(_canBeEmpty) {}; + XmlStringW(XBool _canBeEmpty) : super(), canBeEmpty(_canBeEmpty) {}; virtual ~XmlStringW() {}; virtual const char* getDescription() override { return "string"; }; virtual void reset() override { super::reset(); xstringW.setEmpty(); }; virtual const ValueType& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return xstringW; } - virtual bool setStringValue(const char* s, size_t size) { setDefined(); xstringW.strsicpy(s, size); return true; } + virtual XBool setStringValue(const char* s, size_t size) { setDefined(); xstringW.strsicpy(s, size); return true; } - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("string"); } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("string"); } + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; // TODO validate !_canBeEmpty - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !canBeEmpty && xstringW.isEmpty() ) { xmlLiteParser->addWarning(generateErrors, S8Printf("String cannot be empty for tag '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); @@ -227,8 +227,8 @@ class XmlString8Trimed : public XmlString8 using super = XmlString8; public: XmlString8Trimed() : super(false) {}; - XmlString8Trimed(bool allowEmpty) : super(allowEmpty) {}; - virtual bool setStringValue(const char* s, size_t size) override { setDefined(); xstring8.strsicpy(s, size); xstring8.trim(); return true; } + XmlString8Trimed(XBool allowEmpty) : super(allowEmpty) {}; + virtual XBool setStringValue(const char* s, size_t size) override { setDefined(); xstring8.strsicpy(s, size); xstring8.trim(); return true; } }; class XmlKey : public XmlAbstractType @@ -247,17 +247,17 @@ public: virtual const char* getDescription() override { return "key"; }; virtual void reset() override { super::reset(); xstring8.setEmpty(); }; - virtual bool isKey() const override { return true; } + virtual XBool isKey() const override { return true; } virtual const XString8& getKey() const override { return value(); } const ValueType& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return xstring8; } - virtual bool setStringValue(const char* s, size_t size) { setDefined(); xstring8.strsicpy(s, size); return true; } + virtual XBool setStringValue(const char* s, size_t size) { setDefined(); xstring8.strsicpy(s, size); return true; } - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("key"); } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors, const char** keyValuePtr, size_t* keyValueLengthPtr); - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("key"); } + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const char** keyValuePtr, size_t* keyValueLengthPtr); + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( xstring8.isEmpty() ) return false; return true; @@ -270,7 +270,7 @@ class XmlKeyDisablable : public XmlKey { using super = XmlKey; protected: - bool Disabled = false; + XBool Disabled = false; public: XmlKeyDisablable() {}; ~XmlKeyDisablable() {}; @@ -279,11 +279,11 @@ public: virtual const char* getDescription() override { return "key(dis)"; }; - bool isDisabled() const { return Disabled; } - bool isEnabled() const { return !Disabled; } + XBool isDisabled() const { return Disabled; } + XBool isEnabled() const { return !Disabled; } const ValueType& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return xstring8; } - virtual bool setStringValue(const char* s, size_t size) override { + virtual XBool setStringValue(const char* s, size_t size) override { setDefined(); if ( size > 0 && s[0] == '!' ) { xstring8.strsicpy(s+1, size-1); @@ -294,8 +294,8 @@ public: return true; } -// virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { +// virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( xstring8.isEqual("!") ) return false; // it's an empty disabled key return true; @@ -325,20 +325,20 @@ public: const ValueType& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return m_value; } - bool setDataValue(const uint8_t* s, size_t size) { setDefined(); m_value.ncpy(s, size); return true; } - bool stealDataValue(uint8_t* s, size_t size) { setDefined(); m_value.stealValueFrom(s, size); return true; } - bool stealDataValue(uint8_t* s, size_t size, size_t allocatedSize) { setDefined(); m_value.stealValueFrom(s, size, allocatedSize); return true; } + XBool setDataValue(const uint8_t* s, size_t size) { setDefined(); m_value.ncpy(s, size); return true; } + XBool stealDataValue(uint8_t* s, size_t size) { setDefined(); m_value.stealValueFrom(s, size); return true; } + XBool stealDataValue(uint8_t* s, size_t size, size_t allocatedSize) { setDefined(); m_value.stealValueFrom(s, size, allocatedSize); return true; } void setSize(size_t size, uint8_t elementToCopy) { m_value.setSize(size, elementToCopy); } - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("string") || xmlLiteParser->nextTagIsOpeningTag("data"); } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("string") || xmlLiteParser->nextTagIsOpeningTag("data"); } + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlIntegerAbstract : public XmlAbstractType { public: - bool isTheNextTag(XmlLiteParser* xmlLiteParser) override; - bool parseXmlInteger(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, uint64_t* result, bool* negative, int64_t minimum, uint64_t maximum, bool generateErrors); + XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override; + XBool parseXmlInteger(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, uint64_t* result, XBool* negative, int64_t minimum, uint64_t maximum, XBool generateErrors); }; template @@ -362,7 +362,7 @@ class XmlInteger : public XmlIntegerAbstract const ValueType& value() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return m_value; } -// bool parseXmlInteger(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, UINTN* result, bool* negative, INTN minimum, UINTN maximum, bool generateErrors); +// XBool parseXmlInteger(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, UINTN* result, XBool* negative, INTN minimum, UINTN maximum, XBool generateErrors); }; template const typename XmlInteger::ValueType XmlInteger::nullValue = typename XmlInteger::ValueType(); @@ -375,18 +375,18 @@ public: virtual const char* getDescription() override { return "uint8"; }; - bool setUInt8Value(ValueType ui8) { setDefined(); m_value = ui8; return true; } - bool setUInt8Value(ValueType value, bool sign) { + XBool setUInt8Value(ValueType ui8) { setDefined(); m_value = ui8; return true; } + XBool setUInt8Value(ValueType value, XBool sign) { if ( sign ) { log_technical_bug("XmlUInt8 sign=true"); setUInt8Value(0); return false; } setUInt8Value(value); return true; } -// bool setUInt8Value(uint8_t value, bool sign, XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, bool generateErrors) { +// XBool setUInt8Value(uint8_t value, XBool sign, XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, XBool generateErrors) { // setUInt8Value(value, sign); // return validate(xmlLiteParser, xmlPath, pos, generateErrors); // } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlInt8 : public XmlInteger @@ -397,10 +397,10 @@ public: virtual const char* getDescription() override { return "int8"; }; - bool setInt8Value(ValueType i8) { setDefined(); m_value = i8; return true; } - bool setInt8Value(ValueType value, bool sign) { if ( sign ) return setInt8Value(-value); else setInt8Value(value); return true; } + XBool setInt8Value(ValueType i8) { setDefined(); m_value = i8; return true; } + XBool setInt8Value(ValueType value, XBool sign) { if ( sign ) return setInt8Value(-value); else setInt8Value(value); return true; } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlUInt16 : public XmlInteger @@ -411,14 +411,14 @@ public: virtual const char* getDescription() override { return "uint16"; }; - bool setUInt16Value(ValueType ui16) { setDefined(); m_value = ui16; return true; } - bool setUInt16Value(ValueType value, bool sign) { + XBool setUInt16Value(ValueType ui16) { setDefined(); m_value = ui16; return true; } + XBool setUInt16Value(ValueType value, XBool sign) { if ( sign ) { log_technical_bug("XmlUInt16 sign=true"); setUInt16Value(0); return false; } setUInt16Value(value); return true; } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlInt16 : public XmlInteger @@ -429,10 +429,10 @@ public: virtual const char* getDescription() override { return "unt16"; }; - bool setInt16Value(ValueType ui16) { setDefined(); m_value = ui16; return true; } - bool setInt16Value(ValueType value, bool sign) { if ( sign ) return setInt16Value(-value); else setInt16Value(value); return true; } + XBool setInt16Value(ValueType ui16) { setDefined(); m_value = ui16; return true; } + XBool setInt16Value(ValueType value, XBool sign) { if ( sign ) return setInt16Value(-value); else setInt16Value(value); return true; } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlUInt32 : public XmlInteger @@ -443,14 +443,14 @@ public: virtual const char* getDescription() override { return "uint32"; }; - bool setUInt32Value(ValueType ui32) { setDefined(); m_value = ui32; return true; } - bool setUInt32Value(ValueType value, bool sign) { + XBool setUInt32Value(ValueType ui32) { setDefined(); m_value = ui32; return true; } + XBool setUInt32Value(ValueType value, XBool sign) { if ( sign ) { log_technical_bug("XmlUInt32 sign=true"); setUInt32Value(0); return false; } setUInt32Value(value); return true; } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlInt32 : public XmlInteger @@ -461,10 +461,10 @@ public: virtual const char* getDescription() override { return "int32"; }; - bool setInt32Value(ValueType i32) { setDefined(); m_value = i32; return true; } - bool setInt32Value(ValueType value, bool sign) { if ( sign ) return setInt32Value(-value); else setInt32Value(value); return true; } + XBool setInt32Value(ValueType i32) { setDefined(); m_value = i32; return true; } + XBool setInt32Value(ValueType value, XBool sign) { if ( sign ) return setInt32Value(-value); else setInt32Value(value); return true; } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlUInt64 : public XmlInteger @@ -475,14 +475,14 @@ public: virtual const char* getDescription() override { return "uint64"; }; - bool setUInt64Value(ValueType ui64) { setDefined(); m_value = ui64; return true; } - bool setUInt64Value(ValueType value, bool sign) { + XBool setUInt64Value(ValueType ui64) { setDefined(); m_value = ui64; return true; } + XBool setUInt64Value(ValueType value, XBool sign) { if ( sign ) { log_technical_bug("XmlUInt64 sign=true"); setUInt64Value(0); return false; } setUInt64Value(value); return true; } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; class XmlInt64 : public XmlInteger @@ -493,10 +493,10 @@ public: virtual const char* getDescription() override { return "int64"; }; - bool setInt64Value(ValueType i64) { setDefined(); m_value = i64; return true; } - bool setInt64Value(ValueType value, bool sign) { if ( sign ) return setInt64Value(-value); else setInt64Value(value); return true; } + XBool setInt64Value(ValueType i64) { setDefined(); m_value = i64; return true; } + XBool setInt64Value(ValueType value, XBool sign) { if ( sign ) return setInt64Value(-value); else setInt64Value(value); return true; } - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; }; diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.cpp b/rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.cpp index db951defe..b3b29c8a4 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.cpp +++ b/rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.cpp @@ -22,7 +22,7 @@ void XmlUnion::reset() } } -bool XmlUnion::isTheNextTag(XmlLiteParser* xmlLiteParser) +XBool XmlUnion::isTheNextTag(XmlLiteParser* xmlLiteParser) { XmlUnionField* fields; size_t nb; @@ -37,7 +37,7 @@ bool XmlUnion::isTheNextTag(XmlLiteParser* xmlLiteParser) return false; } -bool XmlUnion::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) +XBool XmlUnion::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) { XmlParserPosition pos = xmlLiteParser->getPosition(); #ifdef JIEF_DEBUG @@ -67,7 +67,7 @@ if ( xmlPath == "/Boot/XMPDetection"_XS8 ) { return false; } -bool XmlUnion::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, bool generateErrors) +XBool XmlUnion::validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& pos, XBool generateErrors) { XmlUnionField* fields; size_t nb; diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.h b/rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.h index 5454ce8b0..11e4e567a 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteUnionTypes.h @@ -51,9 +51,9 @@ public: virtual void reset() override; - virtual bool isTheNextTag(XmlLiteParser* xmlLiteParser) override; - virtual bool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, bool generateErrors) override; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override; + virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override; + virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override; + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override; }; @@ -67,7 +67,7 @@ class XmlBoolOrString : public XmlUnion public: XmlBool xmlBool = XmlBool(); XmlString8 xmlString8 = XmlString8(); - virtual const char* getDescription() override { return "bool or string"; }; + virtual const char* getDescription() override { return "XBool or string"; }; XmlUnionField m_fields[2] = { xmlBool, xmlString8 }; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; }; @@ -79,7 +79,7 @@ class XmlInt8OrBool : public XmlUnion public: XmlInt8 xmlInt8 = XmlInt8(); XmlBool xmlBool = XmlBool(); - virtual const char* getDescription() override { return "int8 or bool"; }; + virtual const char* getDescription() override { return "int8 or XBool"; }; XmlUnionField m_fields[2] = { xmlInt8, xmlBool }; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; }; @@ -90,7 +90,7 @@ class XmlInt64OrBool : public XmlUnion public: XmlInt64 xmlInt64 = XmlInt64(); XmlBool xmlBool = XmlBool(); - virtual const char* getDescription() override { return "int64 or bool"; }; + virtual const char* getDescription() override { return "int64 or XBool"; }; XmlUnionField m_fields[2] = { xmlInt64, xmlBool }; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; }; @@ -104,7 +104,7 @@ public: XmlString8 xmlString8 = XmlString8(); XmlData xmlData = XmlData(); - virtual const char* getDescription() override { return "bool|string|data"; }; + virtual const char* getDescription() override { return "XBool|string|data"; }; XmlUnionField m_fields[3] = { xmlBool, xmlString8, xmlData }; virtual void getFields(XmlUnionField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; }; diff --git a/rEFIt_UEFI/cpp_lib/undefinable.h b/rEFIt_UEFI/cpp_lib/undefinable.h index 8800e8da8..be0025e1a 100644 --- a/rEFIt_UEFI/cpp_lib/undefinable.h +++ b/rEFIt_UEFI/cpp_lib/undefinable.h @@ -12,12 +12,12 @@ template class undefinable { protected: - bool m_defined = false; + XBool m_defined = false; T m_value = T(); public: - bool isDefined() const { return m_defined; } - void setDefined(bool b) { m_defined = b; } + XBool isDefined() const { return m_defined; } + void setDefined(XBool b) { m_defined = b; } // T& value() { return m_value; } // never allow to return a modifiable value. Breaks encapsulation. const T& value() const { @@ -38,13 +38,13 @@ public: return *this; } - bool operator ==(const undefinable& other) const + XBool operator ==(const undefinable& other) const { if ( !(m_defined == other.m_defined ) ) return false; if ( m_defined && !(m_value == other.m_value ) ) return false; // we don't test value if this is not defined. return true; } - bool operator !=(const undefinable& other) const { return !(*this == other); } + XBool operator !=(const undefinable& other) const { return !(*this == other); } }; class undefinable_bool : public undefinable @@ -56,6 +56,15 @@ public: undefinable_bool& operator = (bool newValue) { super::operator=(newValue); return *this; } }; +class undefinable_xbool : public undefinable +{ + using super = undefinable; +public: + undefinable_xbool() { } + explicit undefinable_xbool(XBool newValue) { super::operator=(newValue); } + undefinable_xbool& operator = (XBool newValue) { super::operator=(newValue); return *this; } +}; + class undefinable_uint8 : public undefinable { using super = undefinable; diff --git a/rEFIt_UEFI/cpp_unit_test/config-test.cpp b/rEFIt_UEFI/cpp_unit_test/config-test.cpp index c97041fb9..3643d1220 100755 --- a/rEFIt_UEFI/cpp_unit_test/config-test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/config-test.cpp @@ -889,7 +889,9 @@ static const char* config_test = R"V0G0N( +#ifndef RETURN_IF_FALSE #define RETURN_IF_FALSE(Expression) do { bool b = Expression; if ( !b ) return false; } while (0); +#endif static int breakpoint(int i) { diff --git a/rEFIt_UEFI/cpp_unit_test/xml_lite-reapeatingdict-test.cpp b/rEFIt_UEFI/cpp_unit_test/xml_lite-reapeatingdict-test.cpp index 54f5e155a..c9f21f576 100755 --- a/rEFIt_UEFI/cpp_unit_test/xml_lite-reapeatingdict-test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/xml_lite-reapeatingdict-test.cpp @@ -122,7 +122,7 @@ int repeatingdict_test2() gXmlLiteParser.printfErrorsAndWarnings(); for ( size_t idx = 0 ; idx < dict.valueArray().size() ; idx++ ) { auto item = dict.valueArray()[idx]; - printf("%s %d %s\n", dict.valueArray()[idx].key().c_str(), dict.valueArray()[idx].xmlBool.value(), dict.valueArray()[idx].xmlString.value().c_str()); + printf("%s %d %s\n", dict.valueArray()[idx].key().c_str(), (bool)dict.valueArray()[idx].xmlBool.value(), dict.valueArray()[idx].xmlString.value().c_str()); } if ( !b ) return breakpoint(1); if ( gXmlLiteParser.getErrorsAndWarnings().size() != 0 ) return breakpoint(1); diff --git a/rEFIt_UEFI/cpp_unit_test/xml_lite-test.cpp b/rEFIt_UEFI/cpp_unit_test/xml_lite-test.cpp index 852035bf4..d1d2489b8 100755 --- a/rEFIt_UEFI/cpp_unit_test/xml_lite-test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/xml_lite-test.cpp @@ -39,8 +39,8 @@ int getNextTag_tests() { const char* tag; size_t tagLength; - bool isOpeningTag, isClosingTag; - bool b; + XBool isOpeningTag, isClosingTag; + XBool b; gXmlLiteParserTest.init(""); b = gXmlLiteParserTest.getNextTag(&tag, &tagLength, &isOpeningTag, &isClosingTag, true); @@ -132,7 +132,7 @@ int getSimpleTag_tests() size_t tagLength; const char* value; size_t valueLength; - bool b; + XBool b; gXmlLiteParserTest.init("kv"); b = gXmlLiteParserTest.getSimpleTag(&tag, &tagLength, &value, &valueLength, "key", true); @@ -208,7 +208,7 @@ int getKey_tests() { const char* tag; size_t length; - bool b; + XBool b; XmlParserPosition xmlParserPosition; gXmlLiteParserTest.init("v"); @@ -251,7 +251,7 @@ int getKey_tests() int skip_tests() { - bool b; + XBool b; gXmlLiteParserTest.init("kv"); b = gXmlLiteParserTest.skipUntilClosingTag("key", strlen("key"), true); @@ -310,9 +310,9 @@ auto msg = gXmlLiteParserTest.getErrorsAndWarnings()[0].msg; int xml_integer_tests() { // XmlAbstractType xml_int8; -// bool b; +// XBool b; // UINTN result; -// bool negative; +// XBool negative; // XString8 s; // // xmlLiteParser.init("10"); @@ -377,7 +377,7 @@ int xml_integer_tests() int validate_dict_tests() { - bool b; + XBool b; class Dict1_Class : public XmlDict { @@ -385,7 +385,7 @@ int validate_dict_tests() class Test1Bool: public XmlBool { public: - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( XmlBool::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); xmlLiteParser->addWarning(generateErrors, S8Printf("Test1Bool tag '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); return false; // parsing can continue. @@ -403,7 +403,7 @@ int validate_dict_tests() public: Dict1_Class dict1 = Dict1_Class(); - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( XmlDict::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); xmlLiteParser->addWarning(generateErrors, S8Printf("dict1 tag '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); return false; // parsing can continue. @@ -448,14 +448,14 @@ int validate_dict_tests() int validate_array_tests() { - bool b; + XBool b; class Main2Dict_Class : public XmlDict { public: XmlArray array = XmlArray(); - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { RETURN_IF_FALSE( XmlDict::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ); xmlLiteParser->addWarning(generateErrors, S8Printf("dict2 tag '%s:%d'.", xmlPath.c_str(), keyPos.getLine())); return false; // parsing can continue. @@ -501,7 +501,7 @@ int validate_array_tests() int documentation_test1() { - bool b; + XBool b; class MyDictClass : public XmlDict { @@ -543,7 +543,7 @@ gXmlLiteParserTest.printfErrorsAndWarnings(); int documentation_test2() { - bool b; + XBool b; class MyInsideDictClass : public XmlDict { @@ -595,7 +595,7 @@ gXmlLiteParserTest.printfErrorsAndWarnings(); int documentation_test3() { - bool b; + XBool b; class MyPlist : public ConfigPlistAbstractClass { @@ -605,7 +605,7 @@ int documentation_test3() class CountClass : public XmlInt64 { using super = XmlInt64; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( value() < -2 ) { xmlLiteParser->addWarning(generateErrors, S8Printf("Count cannot be negative. It must a number between -2 and 18 inclusive at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -647,11 +647,11 @@ gXmlLiteParserTest.printfErrorsAndWarnings(); int documentation_test4() { - bool b; + XBool b; class MyXmlType : public XmlUInt8 { using super = XmlUInt8; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( value() < 1 || value() > 2 ) { xmlLiteParser->addWarning(generateErrors, S8Printf("Type must be 1 or 2 at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -664,7 +664,7 @@ int documentation_test4() class MyXmlSubType : public XmlUInt8 { using super = XmlUInt8; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( value() < 11 || value() > 12 ) { xmlLiteParser->addWarning(generateErrors, S8Printf("SubType must be 11 or 22 at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -688,7 +688,7 @@ int documentation_test4() }; virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !type.isDefined() ) { xmlLiteParser->addWarning(generateErrors, S8Printf("Type must befined at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -732,7 +732,7 @@ gXmlLiteParserTest.printfErrorsAndWarnings(); int documentation_test5() { - bool b; + XBool b; class MyPlist : public ConfigPlistAbstractClass { using super = XmlDict; @@ -747,7 +747,7 @@ int documentation_test5() }; virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - virtual bool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, bool generateErrors) override { + virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override { if ( !super::validate(xmlLiteParser, xmlPath, keyPos, generateErrors) ) return false; if ( !type.isDefined() ) { xmlLiteParser->addWarning(generateErrors, S8Printf("Type must befined at '%s:%d'", xmlPath.c_str(), keyPos.getLine())); @@ -801,7 +801,7 @@ gXmlLiteParserTest.printfErrorsAndWarnings(); int documentation_test6() { - bool b; + XBool b; class MyDictClass : public ConfigPlistAbstractClass { @@ -839,7 +839,7 @@ gXmlLiteParserTest.printfErrorsAndWarnings(); int documentation_test7() { - bool b; + XBool b; class MyDictClass : public ConfigPlistAbstractClass { diff --git a/rEFIt_UEFI/entry_scan/common.cpp b/rEFIt_UEFI/entry_scan/common.cpp index fa6200bd7..518416880 100644 --- a/rEFIt_UEFI/entry_scan/common.cpp +++ b/rEFIt_UEFI/entry_scan/common.cpp @@ -346,7 +346,7 @@ STATIC REFIT_MENU_SCREEN YesNoMessageMenu(0, XStringW(), XStringW(), &YesMessag // Display a yes/no prompt XBool YesNoMessage(IN XStringW& Title, IN CONST XStringW& Message) { - XBool Result = false; + XBool Result = false; UINTN MenuExit; CreateInfoLines(Message, &YesNoMessageMenu.InfoLines); YesNoMessageMenu.Title = Title; @@ -389,7 +389,7 @@ XBool AskUserForFilePathFromVolumes(const CHAR16 *Title OPTIONAL, OUT EFI_DEVICE { REFIT_MENU_SCREEN Menu(0, L"Please Select File..."_XSW, XStringW()); UINTN Index = 0, /*Count = 0,*/ MenuExit; - XBool Responded = false; + XBool Responded = false; if (Result == NULL) { return false; } diff --git a/rEFIt_UEFI/entry_scan/entry_scan.h b/rEFIt_UEFI/entry_scan/entry_scan.h index 2e17c9b84..eb132b0fa 100644 --- a/rEFIt_UEFI/entry_scan/entry_scan.h +++ b/rEFIt_UEFI/entry_scan/entry_scan.h @@ -103,7 +103,7 @@ EFI_STATUS VerifySecureBootImage(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath); UINTN QuerySecureBootUser(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath); EFI_STATUS EnrollSecureBootKeys(IN void *AuthorizedDatabase, IN UINTN AuthorizedDatabaseSize, - IN XBool WantDefaultKeys); + IN XBool WantDefaultKeys); EFI_STATUS ClearSecureBootKeys(void); // secure boot database @@ -123,7 +123,7 @@ EFI_STATUS ClearAuthorizedDatabase(void); void *GetImageSignatureDatabase(IN void *FileBuffer, IN UINT64 FileSize, IN UINTN *DatabaseSize, - IN XBool HashIfNoDatabase); + IN XBool HashIfNoDatabase); EFI_STATUS AppendImageDatabaseToAuthorizedDatabase(IN void *Database, IN UINTN DatabaseSize); EFI_STATUS RemoveImageDatabaseFromAuthorizedDatabase(IN void *Database, diff --git a/rEFIt_UEFI/entry_scan/legacy.cpp b/rEFIt_UEFI/entry_scan/legacy.cpp index 8e6868a30..b8dcac98e 100755 --- a/rEFIt_UEFI/entry_scan/legacy.cpp +++ b/rEFIt_UEFI/entry_scan/legacy.cpp @@ -207,7 +207,7 @@ DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str()); void ScanLegacy(void) { UINTN VolumeIndex, VolumeIndex2; - XBool ShowVolume, HideIfOthersFound; + XBool ShowVolume, HideIfOthersFound; REFIT_VOLUME *Volume; DBG("Scanning legacy ...\n"); @@ -289,7 +289,7 @@ void ScanLegacy(void) void AddCustomLegacy(void) { UINTN VolumeIndex, VolumeIndex2; - XBool ShowVolume, HideIfOthersFound; + XBool ShowVolume, HideIfOthersFound; REFIT_VOLUME *Volume; XIcon MainIcon; XIcon DriveIcon; diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index b57b92258..62f0a34aa 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -1233,9 +1233,9 @@ void LOADER_ENTRY::AddDefaultMenu() LOADER_ENTRY *SubEntry; // REFIT_MENU_SCREEN *SubScreen; // REFIT_VOLUME *Volume; - UINT64 VolumeSize; + UINT64 VolumeSize; EFI_GUID *Guid = NULL; - XBool KernelIs64BitOnly; + XBool KernelIs64BitOnly; // UINT64 os_version = AsciiOSVersionToUint64(OSVersion); constexpr LString8 quietLitteral = "quiet"_XS8; @@ -2188,7 +2188,7 @@ void ScanLoader(void) } } - bool hasMovedSomething; + XBool hasMovedSomething; // Re-order preboot partition do { @@ -2466,7 +2466,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex, REFIT_DIR_ITER *Iter = &SIter; CHAR16 PartUUID[40]; XStringW CustomPath = _CustomPath; - XBool FindCustomPath = (CustomPath.isEmpty()); + XBool FindCustomPath = (CustomPath.isEmpty()); if ( SubMenu != NULL ) panic("Call AddCustomSubEntry instead"); @@ -2557,7 +2557,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex, if (Custom.settings.Volume.notEmpty()) { if ((StrStr(Volume->DevicePathString.wc_str(), Custom.settings.Volume.wc_str()) == NULL) && ((Volume->VolName.isEmpty()) || (StrStr(Volume->VolName.wc_str(), Custom.settings.Volume.wc_str()) == NULL))) { - bool CustomEntryFound = false; + XBool CustomEntryFound = false; //..\VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,E97E25EA28F4DF46AAD44CC3F12E28D3) EFI_DEVICE_PATH *MediaPath = Clover_FindDevicePathNodeWithType(Volume->DevicePath, MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP); if (MediaPath) { @@ -2667,7 +2667,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex, // Check to make sure that this entry is not hidden or disabled by another custom entry if (true) { - XBool BetterMatch = false; + XBool BetterMatch = false; for (size_t i = 0 ; i < GlobalConfig.CustomEntries.size() ; ++i ) { CUSTOM_LOADER_ENTRY& CustomEntry = GlobalConfig.CustomEntries[i]; if ( CustomEntry.settings.Disabled ) continue; // before, disabled entries settings weren't loaded. diff --git a/rEFIt_UEFI/entry_scan/lockedgraphics.cpp b/rEFIt_UEFI/entry_scan/lockedgraphics.cpp index 71202c726..0c22c13c1 100644 --- a/rEFIt_UEFI/entry_scan/lockedgraphics.cpp +++ b/rEFIt_UEFI/entry_scan/lockedgraphics.cpp @@ -72,7 +72,7 @@ static EFI_BOOT_SERVICES OldBootServices; // The locked graphics collection static LOCKED_GRAPHICS *LockedGraphics; // The screen lock -static XBool ScreenIsLocked; +static XBool ScreenIsLocked; static EFI_STATUS EFIAPI LockedGOPBlt(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN Delta OPTIONAL) { @@ -102,7 +102,7 @@ static EFI_STATUS EFIAPI LockedGOPQueryMode(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *Thi static EFI_STATUS AddLockedGraphicsGOP(IN EFI_HANDLE Handle, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle, IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GOPInterface) { - XBool Modify = true; + XBool Modify = true; LOCKED_GRAPHICS *Ptr = LockedGraphics; if ((Handle == NULL) || (AgentHandle == NULL) || @@ -296,7 +296,7 @@ static EFI_STATUS RemoveLockedGraphicsUGA(IN EFI_HANDLE Handle, IN EFI_HANDLE Ag static EFI_STATUS AddLockedGraphicsUGA(IN EFI_HANDLE Handle, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle, IN EFI_UGA_DRAW_PROTOCOL *UGAInterface) { - XBool Modify = true; + XBool Modify = true; LOCKED_GRAPHICS *Ptr = LockedGraphics; if ((Handle == NULL) || (AgentHandle == NULL) || diff --git a/rEFIt_UEFI/entry_scan/secureboot.cpp b/rEFIt_UEFI/entry_scan/secureboot.cpp index 1a953aeba..f10c63d48 100644 --- a/rEFIt_UEFI/entry_scan/secureboot.cpp +++ b/rEFIt_UEFI/entry_scan/secureboot.cpp @@ -65,7 +65,7 @@ extern "C" { void EnableSecureBoot(void) { EFI_STATUS Status = EFI_NOT_FOUND; - XBool WantDefaultKeys; + XBool WantDefaultKeys; CONST CHAR16 *ErrorString = NULL; UINTN CloverSignatureSize = 0; void *CloverSignature = NULL; @@ -375,7 +375,7 @@ Internal2FileAuthentication(IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN void *FileBuffer, IN UINTN FileSize, - IN XBool BootPolicy) + IN XBool BootPolicy) { EFI_STATUS Status = EFI_SECURITY_VIOLATION; // Check secure boot policy diff --git a/rEFIt_UEFI/entry_scan/securehash.cpp b/rEFIt_UEFI/entry_scan/securehash.cpp index 4d61f2ae1..d989f97c1 100644 --- a/rEFIt_UEFI/entry_scan/securehash.cpp +++ b/rEFIt_UEFI/entry_scan/securehash.cpp @@ -745,7 +745,7 @@ Failed: void *GetImageSignatureDatabase(IN void *FileBuffer, IN UINT64 FileSize, IN UINTN *DatabaseSize, - IN XBool HashIfNoDatabase) + IN XBool HashIfNoDatabase) { UINTN Size = 0; void *Database = NULL; diff --git a/rEFIt_UEFI/entry_scan/securevars.cpp b/rEFIt_UEFI/entry_scan/securevars.cpp index c23413141..5d18686ef 100644 --- a/rEFIt_UEFI/entry_scan/securevars.cpp +++ b/rEFIt_UEFI/entry_scan/securevars.cpp @@ -76,7 +76,7 @@ EFI_STATUS ClearSecureBootKeys(void) // Enroll the secure boot keys EFI_STATUS EnrollSecureBootKeys(IN void *AuthorizedDatabase, IN UINTN AuthorizedDatabaseSize, - IN XBool WantDefaultKeys) + IN XBool WantDefaultKeys) { EFI_STATUS Status; diff --git a/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp b/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp index 5acb28a51..c763294aa 100644 --- a/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp +++ b/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp @@ -120,7 +120,7 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuLabel(IN CONST XStringW& Text, IN INTN X INTN X = XPos - (TextWidth >> 1) - (BadgeDim + 16); INTN Y = YPos - ((BadgeDim - ThemeX.TextHeight) >> 1); Back.CopyRect(ThemeX.Background, X, Y); - bool free = false; + XBool free = false; XImage *CurrSel = Entries[ScrollState.CurrentSelection].Image.GetBest(!Daylight, &free); Back.Compose(0, 0, *CurrSel, false, BadgeDim/128.f); Back.DrawOnBack(X, Y, Back); @@ -238,7 +238,7 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, } // const XImage& MainImage = (!ThemeX.Daylight && !MainIcon.ImageNight.isEmpty())? MainIcon.ImageNight : MainIcon.Image; - bool free = false; + XBool free = false; XImage *MainImage = MainIcon.GetBest(!Daylight, &free); INTN CompWidth = (Entry->Row == 0) ? ThemeX.row0TileSize : ThemeX.row1TileSize; diff --git a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp index 3182cf171..712507f7a 100644 --- a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp +++ b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp @@ -406,7 +406,7 @@ void REFIT_MENU_SCREEN::AddMenuInfoLine_f(CONST char *format, ...) InfoLines.AddReference(s, true); } -void REFIT_MENU_SCREEN::AddMenuEntry(IN REFIT_ABSTRACT_MENU_ENTRY *Entry, bool freeIt) +void REFIT_MENU_SCREEN::AddMenuEntry(IN REFIT_ABSTRACT_MENU_ENTRY *Entry, XBool freeIt) { if ( !Entry ) return; Entries.AddReference(Entry, freeIt); @@ -701,7 +701,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI EFI_INPUT_KEY key; // UINTN Index; INTN ShortcutEntry; - XBool HaveTimeout = false; + XBool HaveTimeout = false; INTN TimeoutCountdown = 0; UINTN MenuExit; @@ -1601,7 +1601,7 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa if (!TitleImage.isEmpty()) { INTN FilmXPos = (INTN)(EntriesPosX - (TitleImage.Image.GetWidth() + (int)(TITLEICON_SPACING * ThemeX.Scale))); INTN FilmYPos = (INTN)EntriesPosY; - bool free; + XBool free; XImage *tImage = TitleImage.GetBest(!Daylight, &free); // TitleImage.Image.Draw(FilmXPos, FilmYPos); //TODO - account night and svg @@ -1903,7 +1903,7 @@ EFI_STATUS REFIT_MENU_SCREEN::CheckMouseEvent() EFI_STATUS Status = EFI_TIMEOUT; mAction = ActionNone; MOUSE_EVENT Event = mPointer.GetEvent(); - bool Move = false; + XBool Move = false; if (!IsDragging && Event == MouseMove) Event = NoEvents; diff --git a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.h b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.h index 00950a390..2121b8a62 100644 --- a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.h +++ b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.h @@ -121,7 +121,7 @@ typedef void (REFIT_MENU_SCREEN::*MENU_STYLE_FUNC)(IN UINTN Function, IN CONST C class EntryArray : public XObjArray { public: - bool includeHidden = false; + XBool includeHidden = false; size_t sizeIncludingHidden() const { return XObjArray::size(); } @@ -328,20 +328,20 @@ public: EntryArray Entries = EntryArray(); INTN TimeoutSeconds = 0; - bool Daylight = true; + XBool Daylight = true; XStringW TimeoutText = XStringW(); XStringW ThemeName = XStringW(); //? EG_RECT OldTextBufferRect = EG_RECT(); XImage OldTextBufferImage = XImage(); - XBool isBootScreen = false; - FILM *FilmC = 0; + XBool isBootScreen = false; + FILM *FilmC = 0; ACTION mAction = ActionNone; UINTN mItemID = 0; SCROLL_STATE ScrollState = {0,0,0,0,0,0,0,0,false,false,false}; - XBool ScrollEnabled = false; + XBool ScrollEnabled = false; INTN TextStyle = 0; - XBool IsDragging = false; + XBool IsDragging = false; //TODO scroll positions should depends on REFIT_SCREEN? // Or it just currently calculated to be global variables? @@ -418,7 +418,7 @@ public: void AddMenuItem_(REFIT_MENU_ENTRY_ITEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Title, XBool Cursor); void AddMenuInfo_f(CONST char *format, ...) __attribute__((format(printf, 2, 3))); void AddMenuInfoLine_f(CONST char *format, ...) __attribute__((format(printf, 2, 3))); - void AddMenuEntry(IN REFIT_ABSTRACT_MENU_ENTRY *Entry, bool freeIt); + void AddMenuEntry(IN REFIT_ABSTRACT_MENU_ENTRY *Entry, XBool freeIt); void AddMenuItemSwitch(INTN Inx, CONST CHAR8 *Title, XBool Cursor); void AddMenuCheck(CONST CHAR8 *Text, UINTN Bit, INTN ItemNum); void AddMenuItemInput(INTN Inx, CONST CHAR8 *Title, XBool Cursor); diff --git a/rEFIt_UEFI/gui/menu_items/menu_items.h b/rEFIt_UEFI/gui/menu_items/menu_items.h index fba8c47ed..cd45a3a7b 100644 --- a/rEFIt_UEFI/gui/menu_items/menu_items.h +++ b/rEFIt_UEFI/gui/menu_items/menu_items.h @@ -105,7 +105,7 @@ class REFIT_ABSTRACT_MENU_ENTRY { public: XStringW Title = XStringW(); - bool Hidden = 0; + XBool Hidden = false; UINTN Row = 0; CHAR16 ShortcutDigit = 0; char32_t ShortcutLetter = 0; @@ -372,11 +372,11 @@ class REFIT_ABSTRACT_MENU_ENTRY UINT32 NamesTable; INT32 SegVAddr; INT32 shift; - XBool PatcherInited; - XBool gSNBEAICPUFixRequire; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not - XBool gBDWEIOPCIFixRequire; // Broadwell-E IOPCIFamily fix require or not - XBool isKernelcache; - XBool is64BitKernel; + XBool PatcherInited; + XBool gSNBEAICPUFixRequire; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not + XBool gBDWEIOPCIFixRequire; // Broadwell-E IOPCIFamily fix require or not + XBool isKernelcache; + XBool is64BitKernel; UINT32 KernelSlide; UINT32 KernelOffset; // notes: @@ -426,15 +426,15 @@ class REFIT_ABSTRACT_MENU_ENTRY UINT32 searchSectionByNum(UINT8 * Binary, UINT32 Num); // void KernelAndKextsPatcherStart(); // void KernelAndKextPatcherInit(); - XBool KernelUserPatch(); - XBool KernelPatchPm(); - XBool KernelLapicPatch_32(); - XBool KernelLapicPatch_64(); - XBool BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize); + XBool KernelUserPatch(); + XBool KernelPatchPm(); + XBool KernelLapicPatch_32(); + XBool KernelLapicPatch_64(); + XBool BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize); void EFIAPI KernelBooterExtensionsPatch(); - XBool KernelPanicNoKextDump(); + XBool KernelPanicNoKextDump(); void KernelCPUIDPatch(); - XBool PatchCPUID(const UINT8* Location, INT32 LenLoc, + XBool PatchCPUID(const UINT8* Location, INT32 LenLoc, const UINT8* Search4, const UINT8* Search10, const UINT8* ReplaceModel, const UINT8* ReplaceExt, INT32 Len); void KernelPatcher_32(); @@ -471,12 +471,12 @@ class REFIT_ABSTRACT_MENU_ENTRY void DellSMBIOSPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 InfoPlistSize); void SNBE_AICPUPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 InfoPlistSize); void BDWE_IOPCIPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 InfoPlistSize); - XBool SandyBridgeEPM(); - XBool HaswellEXCPM(); - XBool HaswellLowEndXCPM(); - XBool BroadwellEPM(); - XBool KernelIvyBridgeXCPM(); - XBool KernelIvyE5XCPM(); + XBool SandyBridgeEPM(); + XBool HaswellEXCPM(); + XBool HaswellLowEndXCPM(); + XBool BroadwellEPM(); + XBool KernelIvyBridgeXCPM(); + XBool KernelIvyE5XCPM(); void EightApplePatch(UINT8 *Driver, UINT32 DriverSize); void Stall(int Pause) { if ( KernelAndKextPatches.KPDebug ) { gBS->Stall(Pause); } }; diff --git a/rEFIt_UEFI/include/Pci.h b/rEFIt_UEFI/include/Pci.h index 8dcfc67c1..4b80cac87 100644 --- a/rEFIt_UEFI/include/Pci.h +++ b/rEFIt_UEFI/include/Pci.h @@ -64,7 +64,7 @@ typedef struct pci_dt_t { struct pci_dt_t *parent = NULL; struct pci_dt_t *children = NULL; struct pci_dt_t *next = NULL; - XBool used = false; + XBool used = false; } pci_dt_t; diff --git a/rEFIt_UEFI/libeg/BmLib.cpp b/rEFIt_UEFI/libeg/BmLib.cpp index ef67851c4..54fa42849 100644 --- a/rEFIt_UEFI/libeg/BmLib.cpp +++ b/rEFIt_UEFI/libeg/BmLib.cpp @@ -317,20 +317,20 @@ TimeCompare ( ) { if (FirstTime->Year != SecondTime->Year) { - return (XBool) (FirstTime->Year < SecondTime->Year); + return (FirstTime->Year < SecondTime->Year); } else if (FirstTime->Month != SecondTime->Month) { - return (XBool) (FirstTime->Month < SecondTime->Month); + return (FirstTime->Month < SecondTime->Month); } else if (FirstTime->Day != SecondTime->Day) { - return (XBool) (FirstTime->Day < SecondTime->Day); + return (FirstTime->Day < SecondTime->Day); } else if (FirstTime->Hour != SecondTime->Hour) { - return (XBool) (FirstTime->Hour < SecondTime->Hour); + return (FirstTime->Hour < SecondTime->Hour); } else if (FirstTime->Minute != SecondTime->Minute) { - return (XBool) (FirstTime->Minute < SecondTime->Minute); + return (FirstTime->Minute < SecondTime->Minute); } else if (FirstTime->Second != SecondTime->Second) { - return (XBool) (FirstTime->Second < SecondTime->Second); + return (FirstTime->Second < SecondTime->Second); } - return (XBool) (FirstTime->Nanosecond <= SecondTime->Nanosecond); + return (FirstTime->Nanosecond <= SecondTime->Nanosecond); } /* diff --git a/rEFIt_UEFI/libeg/EfiFileLib.h b/rEFIt_UEFI/libeg/EfiFileLib.h index ca6b08944..cc2918077 100644 --- a/rEFIt_UEFI/libeg/EfiFileLib.h +++ b/rEFIt_UEFI/libeg/EfiFileLib.h @@ -105,8 +105,8 @@ typedef struct { EFI_LOAD_FILE_PROTOCOL *LoadFile; // Information valid for l#: EFI_IP_ADDRESS ServerIp; // Information valid for t: - XBool IsDirty; - XBool IsBufferValid; + XBool IsDirty; + XBool IsBufferValid; } EFI_OPEN_FILE; diff --git a/rEFIt_UEFI/libeg/XCinema.cpp b/rEFIt_UEFI/libeg/XCinema.cpp index 7d395b6ba..a78c647d1 100644 --- a/rEFIt_UEFI/libeg/XCinema.cpp +++ b/rEFIt_UEFI/libeg/XCinema.cpp @@ -58,7 +58,7 @@ const XImage& FILM::GetImage(INTN Index) const return NullImage; } -const XImage& FILM::GetImage(bool *free) const +const XImage& FILM::GetImage(XBool *free) const { /* * for SVG anime we have to generate new XImage using CurrentFrame as an argument diff --git a/rEFIt_UEFI/libeg/XCinema.h b/rEFIt_UEFI/libeg/XCinema.h index fe7721a18..ec28d4906 100644 --- a/rEFIt_UEFI/libeg/XCinema.h +++ b/rEFIt_UEFI/libeg/XCinema.h @@ -26,7 +26,7 @@ protected: INTN Id; //ScreenID, enumeration value but keep it to be int for extensibility public: //I see no reason to make they protected - XBool RunOnce; + XBool RunOnce; INTN NumFrames; //set by user in Theme.plist or in Theme.svg INTN FrameTime; //usually 50, 100, 200 ms INTN FilmX, FilmY; //relative @@ -34,7 +34,7 @@ public: INTN ScreenEdgeVertical; INTN NudgeX, NudgeY; XStringW Path; //user defined name for folder and files Path/Path_002.png etc - XBool AnimeRun; + XBool AnimeRun; UINT64 LastDraw; protected: @@ -58,11 +58,11 @@ public: void SetIndex(INTN Index) { Id = Index; } const XImage& GetImage(INTN Index) const; - const XImage& GetImage(bool *free = nullptr) const; + const XImage& GetImage(XBool *free = nullptr) const; void AddFrame(XImage* Frame, INTN Index); //IndexedImage will be created size_t Size() { return Frames.size(); } INTN LastFrameID() { return LastIndex; } - bool Finished() { return CurrentFrame == 0; } + XBool Finished() { return CurrentFrame == 0; } void GetFrames(XTheme& TheTheme/*, const XStringW& Path*/); //read image sequence from Theme/Path/ void SetPlace(const EG_RECT& Rect) { FilmPlace = Rect; } void Advance() { ++CurrentFrame %= (LastIndex + 1); } diff --git a/rEFIt_UEFI/libeg/XIcon.cpp b/rEFIt_UEFI/libeg/XIcon.cpp index 3b62dd778..e50e84c3f 100644 --- a/rEFIt_UEFI/libeg/XIcon.cpp +++ b/rEFIt_UEFI/libeg/XIcon.cpp @@ -105,8 +105,8 @@ XIcon::~XIcon() // memory leak : we can't free (yet?) ImageSVG and ImageSVGnight because operator might have copied it } -XIcon::XIcon(INTN Index, bool TakeEmbedded) : Id(Index), Name(), Image(), ImageNight(), Native(false), - ImageSVG(nullptr), ImageSVGnight(nullptr), Empty(0) +XIcon::XIcon(INTN Index, XBool TakeEmbedded) : Id(Index), Name(), Image(), ImageNight(), Native(false), + ImageSVG(nullptr), ImageSVGnight(nullptr), Empty(false) { // Id = Index; // Name.setEmpty(); @@ -248,7 +248,7 @@ EFI_STATUS XIcon::LoadXImage(const EFI_FILE *BaseDir, const XStringW& IconName) return Status; } -XImage* XIcon::GetBest(bool night, bool *free) +XImage* XIcon::GetBest(XBool night, XBool *free) { #if 1 if (ImageSVG) { diff --git a/rEFIt_UEFI/libeg/XIcon.h b/rEFIt_UEFI/libeg/XIcon.h index dfcaebc7d..e01c90f49 100644 --- a/rEFIt_UEFI/libeg/XIcon.h +++ b/rEFIt_UEFI/libeg/XIcon.h @@ -16,20 +16,20 @@ public: XString8 Name; //for example "os_moja", "vol_internal" XImage Image; XImage ImageNight; - bool Native; + XBool Native; void *ImageSVG; //NSVGimage* void *ImageSVGnight; protected: - bool Empty; + XBool Empty; public: XIcon(): Id(0), Name(), Image(), ImageNight(), Native(false), ImageSVG(nullptr), ImageSVGnight(nullptr), Empty(true) {}; - XIcon(INTN Id, bool Embedded = false); + XIcon(INTN Id, XBool Embedded = false); // Initialisation of ImageSVG(other.ImageSVG), ImageSVGnight(other.ImageSVGnight) is wrong because we just copy the pointer XIcon(const XIcon& other) : Id(other.Id), Name(other.Name), Image(other.Image), ImageNight(other.ImageNight), Native(other.Native), ImageSVG(other.ImageSVG), ImageSVGnight(other.ImageSVGnight), Empty(other.Empty) {} ; ~XIcon(); - bool isEmpty() const { return Empty; } + XBool isEmpty() const { return Empty; } void setFilled() { Empty = false; } void setEmpty() { Empty = true; } @@ -41,7 +41,7 @@ public: // Default are not valid, as usual. We delete them. If needed, proper ones can be created // Icon(const Icon&) = delete; XIcon& operator=(const XIcon&); // = delete; - XImage* GetBest(bool night, bool *free = nullptr); + XImage* GetBest(XBool night, XBool *free = nullptr); }; diff --git a/rEFIt_UEFI/libeg/XImage.cpp b/rEFIt_UEFI/libeg/XImage.cpp index 14a5b89e4..b84b14649 100644 --- a/rEFIt_UEFI/libeg/XImage.cpp +++ b/rEFIt_UEFI/libeg/XImage.cpp @@ -268,7 +268,7 @@ void XImage::CopyRect(const XImage& Image, const EG_RECT& OwnPlace, const EG_REC } } -void XImage::Compose(INTN PosX, INTN PosY, const XImage& TopImage, bool Lowest, float topScale) +void XImage::Compose(INTN PosX, INTN PosY, const XImage& TopImage, XBool Lowest, float topScale) { EG_RECT OutPlace; OutPlace.XPos = PosX; @@ -285,13 +285,13 @@ void XImage::Compose(INTN PosX, INTN PosY, const XImage& TopImage, bool Lowest, } // TopScale is for scaling TopImage. = 0.f means no scale or = 1.f // InPlace is a place in TopImage before scaling -void XImage::Compose(const EG_RECT& OutPlace, const EG_RECT& InPlace, const XImage& TopImage, bool Lowest, float TopScale) +void XImage::Compose(const EG_RECT& OutPlace, const EG_RECT& InPlace, const XImage& TopImage, XBool Lowest, float TopScale) { INTN PosX = InPlace.XPos; INTN PosY = InPlace.YPos; INTN WArea = InPlace.Width; INTN HArea = InPlace.Height; - bool gray = false; + XBool gray = false; if (TopScale < 0) { gray = true; TopScale = -TopScale; @@ -365,7 +365,7 @@ void XImage::Compose(const EG_RECT& OutPlace, const EG_RECT& InPlace, const XIma * But pixels will be moved anyway so it's impossible without double copy * */ -//void XImage::ComposeOnBack(INTN PosX, INTN PosY, const XImage& BackImage, bool Lowest) +//void XImage::ComposeOnBack(INTN PosX, INTN PosY, const XImage& BackImage, XBool Lowest) void XImage::FlipRB() @@ -580,7 +580,7 @@ void XImage::Draw(INTN x, INTN y, float scale) Draw(x, y, scale, true); } -void XImage::Draw(INTN x, INTN y, float scale, bool Opaque) +void XImage::Draw(INTN x, INTN y, float scale, XBool Opaque) { //prepare images if (isEmpty()) { diff --git a/rEFIt_UEFI/libeg/XImage.h b/rEFIt_UEFI/libeg/XImage.h index 01f6fc37d..2e1d19be3 100644 --- a/rEFIt_UEFI/libeg/XImage.h +++ b/rEFIt_UEFI/libeg/XImage.h @@ -72,7 +72,7 @@ public: void setZero() { SetMem( (void*)GetPixelPtr(0, 0), GetSizeInBytes(), 0); } void setEmpty() { Width=0; Height=0; PixelData.setEmpty(); } - bool isEmpty() const { return PixelData.size() == 0; } + XBool isEmpty() const { return PixelData.size() == 0; } void Fill(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Color = { 0, 0, 0, 0 }); @@ -84,8 +84,8 @@ public: void CopyScaled(const XImage& Image, float scale = 0.f); void CopyRect(const XImage& Image, INTN X, INTN Y); void CopyRect(const XImage& Image, const EG_RECT& OwnPlace, const EG_RECT& InputRect); - void Compose(const EG_RECT& OwnPlace, const EG_RECT& InputRect, const XImage& TopImage, bool Lowest, float TopScale = 0.f); - void Compose(INTN PosX, INTN PosY, const XImage& TopImage, bool Lowest, float topScale = 0); //instead of compose we often can Back.Draw(...) + Top.Draw(...) + void Compose(const EG_RECT& OwnPlace, const EG_RECT& InputRect, const XImage& TopImage, XBool Lowest, float TopScale = 0.f); + void Compose(INTN PosX, INTN PosY, const XImage& TopImage, XBool Lowest, float topScale = 0); //instead of compose we often can Back.Draw(...) + Top.Draw(...) void FlipRB(); EFI_STATUS FromPNG(const UINT8 * Data, UINTN Lenght); EFI_STATUS ToPNG(UINT8** Data, UINTN& OutSize); @@ -94,7 +94,7 @@ public: void GetArea(const EG_RECT& Rect); void GetArea(INTN x, INTN y, UINTN W, UINTN H); - void Draw(INTN x, INTN y, float scale, bool Opaque); + void Draw(INTN x, INTN y, float scale, XBool Opaque); void Draw(INTN x, INTN y, float scale); //can accept 0 scale as 1.f void Draw(INTN x, INTN y); void DrawWithoutCompose(INTN x, INTN y, UINTN width = 0, UINTN height = 0); diff --git a/rEFIt_UEFI/libeg/XPointer.cpp b/rEFIt_UEFI/libeg/XPointer.cpp index 7b37823a2..7adcf5900 100644 --- a/rEFIt_UEFI/libeg/XPointer.cpp +++ b/rEFIt_UEFI/libeg/XPointer.cpp @@ -33,7 +33,7 @@ void XPointer::Hide() } } -bool XPointer::isAlive() +XBool XPointer::isAlive() { return Alive; } @@ -124,7 +124,7 @@ void XPointer::KillMouse() SimplePointerProtocol = NULL; } -void XPointer::UpdatePointer(bool isDaylight) // cannot be called daylight because of a global var on macOS +void XPointer::UpdatePointer(XBool isDaylight) // cannot be called daylight because of a global var on macOS { UINT64 Now; EFI_STATUS Status; @@ -193,7 +193,7 @@ MOUSE_EVENT XPointer::GetEvent() return MouseEvent; } -bool XPointer::MouseInRect(EG_RECT *Place) +XBool XPointer::MouseInRect(EG_RECT *Place) { return ((newPlace.XPos >= Place->XPos) && (newPlace.XPos < (Place->XPos + (INTN)Place->Width)) && diff --git a/rEFIt_UEFI/libeg/XPointer.h b/rEFIt_UEFI/libeg/XPointer.h index 14bbe17fd..6e6082057 100644 --- a/rEFIt_UEFI/libeg/XPointer.h +++ b/rEFIt_UEFI/libeg/XPointer.h @@ -22,8 +22,8 @@ protected: UINT64 LastClickTime; //not EFI_TIME EFI_SIMPLE_POINTER_STATE State; MOUSE_EVENT MouseEvent; - bool Alive; - bool night; + XBool Alive; + XBool night; public: XPointer() : SimplePointerProtocol(NULL), PointerImage(NULL), @@ -39,13 +39,13 @@ public: void Hide(); - bool isAlive(); + XBool isAlive(); EFI_STATUS MouseBirth(); void KillMouse(); - void UpdatePointer(bool daylight); - bool MouseInRect(EG_RECT *Place); + void UpdatePointer(XBool daylight); + XBool MouseInRect(EG_RECT *Place); - bool isEmpty() const { return PointerImage->isEmpty(); } + XBool isEmpty() const { return PointerImage->isEmpty(); } void ClearEvent() { MouseEvent = NoEvents; } MOUSE_EVENT GetEvent(); EG_RECT& GetPlace() { return newPlace; } diff --git a/rEFIt_UEFI/libeg/XTheme.cpp b/rEFIt_UEFI/libeg/XTheme.cpp index a2f338e27..c4ac98612 100644 --- a/rEFIt_UEFI/libeg/XTheme.cpp +++ b/rEFIt_UEFI/libeg/XTheme.cpp @@ -807,7 +807,7 @@ XIcon* XTheme::GetIconP(const XString8& Name) return &NullIcon; //if name is not found } -bool XTheme::CheckNative(INTN Id) +XBool XTheme::CheckNative(INTN Id) { for (size_t i = 0; i < Icons.size(); i++) { diff --git a/rEFIt_UEFI/libeg/XTheme.h b/rEFIt_UEFI/libeg/XTheme.h index 2f266fa83..9f7206621 100644 --- a/rEFIt_UEFI/libeg/XTheme.h +++ b/rEFIt_UEFI/libeg/XTheme.h @@ -48,7 +48,7 @@ public: const EFI_FILE& getThemeDir() { return *ThemeDir; } - bool IsEmbeddedTheme(void) + XBool IsEmbeddedTheme(void) { if (embedded) { ThemeDir = NULL; @@ -61,7 +61,7 @@ public: // UINTN DisableFlags; UINTN HideBadges; UINTN HideUIFlags; -// XBool TextOnly; +// XBool TextOnly; FONT_TYPE Font; INTN CharWidth; UINTN SelectionColor; @@ -75,10 +75,10 @@ public: XStringW BackgroundName; SCALING BackgroundScale; INTN BackgroundSharp; - XBool BackgroundDark; -// XBool CustomIcons; - XBool SelectionOnTop; - XBool BootCampStyle; + XBool BackgroundDark; +// XBool CustomIcons; + XBool SelectionOnTop; + XBool BootCampStyle; INTN BadgeOffsetX; INTN BadgeOffsetY; INTN BadgeScale; @@ -90,17 +90,17 @@ public: INTN BannerEdgeVertical; INTN BannerNudgeX; INTN BannerNudgeY; - XBool VerticalLayout; - XBool NonSelectedGrey; + XBool VerticalLayout; + XBool NonSelectedGrey; INTN MainEntriesSize; INTN TileXSpace; INTN TileYSpace; // INTN IconFormat; - XBool Proportional; -// XBool ShowOptimus; - XBool embedded; - XBool DarkEmbedded; - XBool TypeSVG; + XBool Proportional; +// XBool ShowOptimus; + XBool embedded; + XBool DarkEmbedded; + XBool TypeSVG; // INTN Codepage; //no! it is global settings // INTN CodepageSize; float Scale; @@ -123,7 +123,7 @@ public: INTN FontHeight; INTN TextHeight; - XBool Daylight; + XBool Daylight; XImage Background; //Background and Banner will not be in array as they live own life XImage BigBack; //it size is not equal to screen size will be scaled or cropped @@ -165,7 +165,7 @@ public: XIcon& GetIconAlt(INTN Id, INTN Alt); //if id not found const XIcon& LoadOSIcon(const CHAR16* OSIconName); //TODO make XString provider const XIcon& LoadOSIcon(const XString8& Full); - bool CheckNative(INTN Id); + XBool CheckNative(INTN Id); //fonts void LoadFontImage(IN XBool UseEmbedded, IN INTN Rows, IN INTN Cols); diff --git a/rEFIt_UEFI/libeg/image.cpp b/rEFIt_UEFI/libeg/image.cpp index aa6f7615c..9f6846400 100644 --- a/rEFIt_UEFI/libeg/image.cpp +++ b/rEFIt_UEFI/libeg/image.cpp @@ -152,7 +152,7 @@ EFI_STATUS egSaveFile(const EFI_FILE* BaseDir OPTIONAL, IN CONST CHAR16 *FileNam EFI_STATUS Status; EFI_FILE* FileHandle; UINTN BufferSize; - XBool CreateNew = true; + XBool CreateNew = true; CONST CHAR16 *p = FileName + StrLen(FileName); CHAR16 DirName[256]; UINTN dirNameLen; diff --git a/rEFIt_UEFI/libeg/libeg.h b/rEFIt_UEFI/libeg/libeg.h index 453a94943..d4d3b325d 100755 --- a/rEFIt_UEFI/libeg/libeg.h +++ b/rEFIt_UEFI/libeg/libeg.h @@ -123,7 +123,7 @@ public: XStringW SValue = XStringW(); UINTN LineShift = 0; - bool operator == (const INPUT_ITEM& other) const + XBool operator == (const INPUT_ITEM& other) const { if ( !(ItemType == other.ItemType ) ) return false; if ( !(Valid == other.Valid ) ) return false; @@ -133,7 +133,7 @@ public: if ( !(LineShift == other.LineShift ) ) return false; return true; } - bool operator != (const INPUT_ITEM& other) const { return !(*this == other); } + XBool operator != (const INPUT_ITEM& other) const { return !(*this == other); } }; typedef struct { @@ -198,8 +198,8 @@ public: EG_RECT(INTN x, INTN y, INTN w, INTN h) : XPos(x), YPos(y), Width(w), Height(h) { } EG_RECT(const EG_RECT& other) : XPos(other.XPos), YPos(other.YPos), Width(other.Width), Height(other.Height) { } const EG_RECT& operator = (const EG_RECT& other) { XPos = other.XPos; YPos = other.YPos; Width = other.Width; Height = other.Height; return *this; } - bool operator == (const EG_RECT& other) { return XPos == other.XPos && YPos == other.YPos && Width == other.Width && Height == other.Height; } - bool operator != (const EG_RECT& other) { return !(*this == other); } + XBool operator == (const EG_RECT& other) { return XPos == other.XPos && YPos == other.YPos && Width == other.Width && Height == other.Height; } + XBool operator != (const EG_RECT& other) { return !(*this == other); } }; #else typedef struct EG_RECT { diff --git a/rEFIt_UEFI/libeg/text.cpp b/rEFIt_UEFI/libeg/text.cpp index e71998655..19059d956 100644 --- a/rEFIt_UEFI/libeg/text.cpp +++ b/rEFIt_UEFI/libeg/text.cpp @@ -94,7 +94,7 @@ void XTheme::LoadFontImage(IN XBool UseEmbedded, IN INTN Rows, IN INTN Cols) EFI_GRAPHICS_OUTPUT_BLT_PIXEL *PixelPtr; EFI_GRAPHICS_OUTPUT_BLT_PIXEL *FontPtr; EFI_GRAPHICS_OUTPUT_BLT_PIXEL FirstPixel; - XBool isKorean = (gSettings.GUI.languageCode == korean); + XBool isKorean = (gSettings.GUI.languageCode == korean); XStringW fontFilePath; const XStringW& commonFontDir = L"font"_XSW; @@ -208,7 +208,7 @@ void XTheme::PrepareFont() } //search pixel similar to first -inline bool SamePix(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Ptr, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& FirstPixel) +inline XBool SamePix(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Ptr, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& FirstPixel) { //compare with first pixel of the array top-left point [0][0] return ((Ptr.Red >= FirstPixel.Red - (FirstPixel.Red >> 2)) && diff --git a/rEFIt_UEFI/refit/lib.cpp b/rEFIt_UEFI/refit/lib.cpp index b1e40b8bd..7ce0b10eb 100644 --- a/rEFIt_UEFI/refit/lib.cpp +++ b/rEFIt_UEFI/refit/lib.cpp @@ -68,8 +68,8 @@ //XStringW ThemePath; -//XBool gBootArgsChanged = false; -XBool gThemeOptionsChanged = false; +//XBool gBootArgsChanged = false; +XBool gThemeOptionsChanged = false; // @@ -220,7 +220,7 @@ EFI_STATUS ExtractLegacyLoaderPaths(EFI_DEVICE_PATH **PathList, UINTN MaxPaths, UINTN PathIndex; EFI_LOADED_IMAGE *LoadedImage; EFI_DEVICE_PATH *DevicePath; - XBool Seen; + XBool Seen; MaxPaths--; // leave space for the terminating NULL pointer @@ -283,15 +283,15 @@ EFI_STATUS ExtractLegacyLoaderPaths(EFI_DEVICE_PATH **PathList, UINTN MaxPaths, static void ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT XBool *Bootable) { EFI_STATUS Status; - UINT8 *SectorBuffer; + UINT8 *SectorBuffer; UINTN i; - //MBR_PARTITION_INFO *MbrTable; + //MBR_PARTITION_INFO *MbrTable; //XBool MbrTableFound; - UINTN BlockSize = 0; - CHAR16 volumeName[255]; - CHAR8 tmp[64]; - UINT32 VCrc32; - // CHAR16 *kind = NULL; + UINTN BlockSize = 0; + CHAR16 volumeName[255]; + CHAR8 tmp[64]; + UINT32 VCrc32; + //CHAR16 *kind = NULL; Volume->HasBootCode = false; Volume->LegacyOS->IconName.setEmpty(); @@ -576,7 +576,7 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume) // UINTN BufferSize = 255; EFI_FILE_SYSTEM_INFO *FileSystemInfoPtr; EFI_FILE_INFO *RootInfo = NULL; - XBool Bootable; + XBool Bootable; // EFI_INPUT_KEY Key; // get device path @@ -900,13 +900,13 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume) static void ScanExtendedPartition(REFIT_VOLUME *WholeDiskVolume, MBR_PARTITION_INFO *MbrEntry) { EFI_STATUS Status; - REFIT_VOLUME *Volume; + REFIT_VOLUME *Volume; UINT32 ExtBase, ExtCurrent, NextExtCurrent; UINTN i; UINTN LogicalPartitionIndex = 4; - UINT8 *SectorBuffer; - XBool Bootable; - MBR_PARTITION_INFO *EMbrTable; + UINT8 *SectorBuffer; + XBool Bootable; + MBR_PARTITION_INFO *EMbrTable; ExtBase = MbrEntry->StartLBA; SectorBuffer = (__typeof__(SectorBuffer))AllocateAlignedPages (EFI_SIZE_TO_PAGES (512), WholeDiskVolume->BlockIO->Media->IoAlign); diff --git a/rEFIt_UEFI/refit/lib.h b/rEFIt_UEFI/refit/lib.h index 7521cf8f7..b71bd64be 100644 --- a/rEFIt_UEFI/refit/lib.h +++ b/rEFIt_UEFI/refit/lib.h @@ -221,8 +221,8 @@ typedef enum { -//extern XBool gBootArgsChanged; -extern XBool gThemeOptionsChanged; +//extern XBool gBootArgsChanged; +extern XBool gThemeOptionsChanged; //extern POINTERS gPointer; //extern EFI_GUID gEfiAppleBootGuid; diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index 35f791f2d..e22cba42c 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -118,9 +118,9 @@ // variables -XBool gGuiIsReady = false; -XBool gThemeNeedInit = true; -XBool DoHibernateWake = false; +XBool gGuiIsReady = false; +XBool gThemeNeedInit = true; +XBool DoHibernateWake = false; EFI_HANDLE ConsoleInHandle; @@ -1122,7 +1122,7 @@ void LOADER_ENTRY::StartLoader() } #if 1 //CFBundleExecutable - XBool NoContents = false; + XBool NoContents = false; XStringW infoPlistPath = getKextPlist(dirPath, KextEntry, &NoContents); //it will be fullPath, including dir TagDict* dict = getInfoPlist(infoPlistPath); // XBool inject = checkOSBundleRequired(dict); @@ -1793,7 +1793,7 @@ static void ScanDriverDir(IN CONST CHAR16 *Path, OUT EFI_HANDLE **DriversToConne UINTN DriversArrSize; UINTN DriversArrNum; EFI_HANDLE *DriversArr; - XBool Skip; + XBool Skip; UINT8 AptioBlessed; STATIC CHAR16 CONST * CONST AptioNames[] = { L"AptioMemoryFix", @@ -1960,7 +1960,7 @@ void DisconnectInvalidDiskIoChildDrivers(void) EFI_BLOCK_IO_PROTOCOL *BlockIo; EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo; UINTN OpenInfoCount; - XBool Found; + XBool Found; DBG("Searching for invalid DiskIo BY_DRIVER connects:"); @@ -2215,7 +2215,7 @@ static void LoadDrivers(void) UINTN DriversToConnectNum = 0; UINT8 *Edid; UINTN VarSize = 0; - XBool VBiosPatchNeeded; + XBool VBiosPatchNeeded; DbgHeader("LoadDrivers"); @@ -2296,7 +2296,7 @@ INTN FindDefaultEntry(void) { INTN Index = -1; REFIT_VOLUME *Volume; - XBool SearchForLoader; + XBool SearchForLoader; // DBG("FindDefaultEntry ...\n"); //DbgHeader("FindDefaultEntry"); @@ -2709,9 +2709,9 @@ RefitMain (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) { EFI_STATUS Status; - XBool MainLoopRunning = true; - XBool ReinitDesktop = true; - XBool AfterTool = false; + XBool MainLoopRunning = true; + XBool ReinitDesktop = true; + XBool AfterTool = false; REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry = NULL; REFIT_ABSTRACT_MENU_ENTRY *DefaultEntry = NULL; REFIT_ABSTRACT_MENU_ENTRY *OptionEntry = NULL; @@ -2723,9 +2723,9 @@ RefitMain (IN EFI_HANDLE ImageHandle, // LOADER_ENTRY *LoaderEntry; // XStringW ConfName; // TagDict* smbiosTags = NULL; -// XBool UniteConfigs = false; +// XBool UniteConfigs = false; EFI_TIME Now; - XBool HaveDefaultVolume; + XBool HaveDefaultVolume; REFIT_MENU_SCREEN BootScreen; BootScreen.isBootScreen = true; //other screens will be constructed as false // CHAR16 *InputBuffer; //, *Y; diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index 0788ea6d0..e586a561f 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -509,15 +509,15 @@ void ApplyInputs(void) } i++; //4 if (InputItems[i].Valid) { - GlobalConfig.DropSSDT = InputItems[i].BValue; + GlobalConfig.DropSSDT = InputItems[i].BValue != 0; } i++; //5 if (InputItems[i].Valid) { - gSettings.ACPI.SSDT.Generate.GeneratePStates = InputItems[i].BValue; + gSettings.ACPI.SSDT.Generate.GeneratePStates = InputItems[i].BValue != 0; } i++; //6 if (InputItems[i].Valid) { - gSettings.ACPI.SlpSmiEnable = InputItems[i].BValue; + gSettings.ACPI.SlpSmiEnable = InputItems[i].BValue != 0; } i++; //7 if (InputItems[i].Valid) { @@ -532,23 +532,23 @@ void ApplyInputs(void) } i++; //9 if (InputItems[i].Valid) { - gSettings.ACPI.SSDT.Generate.GenerateCStates = InputItems[i].BValue; + gSettings.ACPI.SSDT.Generate.GenerateCStates = InputItems[i].BValue != 0; } i++; //10 if (InputItems[i].Valid) { - GlobalConfig.EnableC2 = InputItems[i].BValue; + GlobalConfig.EnableC2 = InputItems[i].BValue != 0; } i++; //11 if (InputItems[i].Valid) { - GlobalConfig.EnableC4 = InputItems[i].BValue; + GlobalConfig.EnableC4 = InputItems[i].BValue != 0; } i++; //12 if (InputItems[i].Valid) { - GlobalConfig.EnableC6 = InputItems[i].BValue; + GlobalConfig.EnableC6 = InputItems[i].BValue != 0; } i++; //13 if (InputItems[i].Valid) { - gSettings.ACPI.SSDT.EnableISS = InputItems[i].BValue; + gSettings.ACPI.SSDT.EnableISS = InputItems[i].BValue != 0; } i++; //14 if (InputItems[i].Valid) { @@ -557,11 +557,11 @@ void ApplyInputs(void) } i++; //15 if (InputItems[i].Valid) { - gSettings.ACPI.PatchNMI = InputItems[i].BValue; + gSettings.ACPI.PatchNMI = InputItems[i].BValue != 0; } i++; //16 if (InputItems[i].Valid) { - gSettings.Graphics.PatchVBios = InputItems[i].BValue; + gSettings.Graphics.PatchVBios = InputItems[i].BValue != 0; } i++; //17 if (InputItems[i].Valid) { @@ -588,11 +588,11 @@ void ApplyInputs(void) i++; //21 if (InputItems[i].Valid) { if (gConf.GfxPropertiesArrayNonConst[j].Vendor == Ati) { - gSettings.Graphics.InjectAsDict.InjectATI = InputItems[i].BValue; + gSettings.Graphics.InjectAsDict.InjectATI = InputItems[i].BValue != 0; } else if (gConf.GfxPropertiesArrayNonConst[j].Vendor == Nvidia) { - gSettings.Graphics.InjectAsDict.InjectNVidia = InputItems[i].BValue; + gSettings.Graphics.InjectAsDict.InjectNVidia = InputItems[i].BValue != 0; } else if (gConf.GfxPropertiesArrayNonConst[j].Vendor == Intel) { - gSettings.Graphics.InjectAsDict.InjectIntel = InputItems[i].BValue; + gSettings.Graphics.InjectAsDict.InjectIntel = InputItems[i].BValue != 0; } } i++; //22 @@ -630,7 +630,7 @@ void ApplyInputs(void) } i++; //25 if (InputItems[i].Valid) { - gConf.GfxPropertiesArrayNonConst[j].LoadVBios = InputItems[i].BValue; + gConf.GfxPropertiesArrayNonConst[j].LoadVBios = InputItems[i].BValue != 0; } } //end of Graphics Cards // next number == 42 @@ -642,27 +642,27 @@ void ApplyInputs(void) } i++; //45 if (InputItems[i].Valid) { - gSettings.KernelAndKextPatches.EightApple = InputItems[i].BValue; + gSettings.KernelAndKextPatches.EightApple = InputItems[i].BValue != 0; GlobalConfig.gBootChanged = true; } i++; //46 if (InputItems[i].Valid) { - GlobalConfig.KPAppleIntelCPUPM = InputItems[i].BValue; + GlobalConfig.KPAppleIntelCPUPM = InputItems[i].BValue != 0; GlobalConfig.gBootChanged = true; } i++; //47 if (InputItems[i].Valid) { - gSettings.KernelAndKextPatches.KPAppleRTC = InputItems[i].BValue; + gSettings.KernelAndKextPatches.KPAppleRTC = InputItems[i].BValue != 0; GlobalConfig.gBootChanged = true; } i++; //48 if (InputItems[i].Valid) { - GlobalConfig.KPKernelPm = InputItems[i].BValue; + GlobalConfig.KPKernelPm = InputItems[i].BValue != 0; GlobalConfig.gBootChanged = true; } i++; //49 if (InputItems[i].Valid) { - gSettings.ACPI.FixMCFG = InputItems[i].BValue; + gSettings.ACPI.FixMCFG = InputItems[i].BValue != 0; } i++; //50 @@ -677,7 +677,7 @@ void ApplyInputs(void) i++; //52 if (InputItems[i].Valid) { - gSettings.Graphics.EDID.InjectEDID = InputItems[i].BValue; + gSettings.Graphics.EDID.InjectEDID = InputItems[i].BValue != 0; } i++; //53 if (InputItems[i].Valid) { @@ -688,25 +688,25 @@ void ApplyInputs(void) gSettings.Graphics.EDID.ProductEDID = (UINT16)StrHexToUint64(InputItems[i].SValue.wc_str()); } i++; //55 - // ErmaC: NvidiaGeneric bool(Y/N) + // ErmaC: NvidiaGeneric XBool(Y/N) if (InputItems[i].Valid) { - gSettings.Graphics.NvidiaGeneric = InputItems[i].BValue; + gSettings.Graphics.NvidiaGeneric = InputItems[i].BValue != 0; } i++; //56 if (InputItems[i].Valid) { - gSettings.SystemParameters.NvidiaWeb = InputItems[i].BValue; + gSettings.SystemParameters.NvidiaWeb = InputItems[i].BValue != 0; } i++; //57 if (InputItems[i].Valid) { - gSettings.Devices.Audio.ResetHDA = InputItems[i].BValue; + gSettings.Devices.Audio.ResetHDA = InputItems[i].BValue != 0; } i++; //58 if (InputItems[i].Valid) { - gSettings.Devices.Audio.AFGLowPowerState = InputItems[i].BValue; + gSettings.Devices.Audio.AFGLowPowerState = InputItems[i].BValue != 0; } i++; //59 if (InputItems[i].Valid) { - gSettings.Devices.Audio.HDAInjection = InputItems[i].BValue; + gSettings.Devices.Audio.HDAInjection = InputItems[i].BValue != 0; } i++; //60 if (InputItems[i].Valid) { @@ -714,7 +714,7 @@ void ApplyInputs(void) } i++; //61 if (InputItems[i].Valid) { - gSettings.KernelAndKextPatches.KPDELLSMBIOS = InputItems[i].BValue; + gSettings.KernelAndKextPatches.KPDELLSMBIOS = InputItems[i].BValue != 0; // // yes, we do need to change gRemapSmBiosIsRequire here as well // gRemapSmBiosIsRequire = InputItems[i].BValue; GlobalConfig.gBootChanged = true; @@ -731,7 +731,7 @@ void ApplyInputs(void) } i++; //64 if (InputItems[i].Valid) { - gSettings.KernelAndKextPatches.KPDebug = InputItems[i].BValue; + gSettings.KernelAndKextPatches.KPDebug = InputItems[i].BValue != 0; // GlobalConfig.gBootChanged = true; } @@ -778,13 +778,13 @@ void ApplyInputs(void) } i++; //72 if (InputItems[i].Valid) { - gSettings.GUI.Mouse.PointerMirror = InputItems[i].BValue; + gSettings.GUI.Mouse.PointerMirror = InputItems[i].BValue != 0; } i = 74; if (InputItems[i].Valid) { - gSettings.Devices.USB.USBFixOwnership = InputItems[i].BValue; + gSettings.Devices.USB.USBFixOwnership = InputItems[i].BValue != 0; } i++; //75 if (InputItems[i].Valid) { @@ -850,11 +850,11 @@ void ApplyInputs(void) i++; //88 if (InputItems[i].Valid) { - gSettings.ACPI.SSDT.DoubleFirstState = InputItems[i].BValue; + gSettings.ACPI.SSDT.DoubleFirstState = InputItems[i].BValue != 0; } i++; //89 if (InputItems[i].Valid) { - gSettings.ACPI.SSDT.EnableC7 = InputItems[i].BValue; + gSettings.ACPI.SSDT.EnableC7 = InputItems[i].BValue != 0; } i++; //90 @@ -874,16 +874,16 @@ void ApplyInputs(void) } i++; //91 if (InputItems[i].Valid) { - gSettings.KernelAndKextPatches.KPKernelLapic = InputItems[i].BValue; + gSettings.KernelAndKextPatches.KPKernelLapic = InputItems[i].BValue != 0; GlobalConfig.gBootChanged = true; } i++; //92 if (InputItems[i].Valid) { - gSettings.Devices.USB.USBInjection = InputItems[i].BValue; + gSettings.Devices.USB.USBInjection = InputItems[i].BValue != 0; } i++; //93 if (InputItems[i].Valid) { - gSettings.Devices.USB.InjectClockID = InputItems[i].BValue; + gSettings.Devices.USB.InjectClockID = InputItems[i].BValue != 0; } i++; //94 if (InputItems[i].Valid) { @@ -938,7 +938,7 @@ void ApplyInputs(void) } i++; //102 if (InputItems[i].Valid) { - gSettings.ACPI.DSDT.DebugDSDT = InputItems[i].BValue; + gSettings.ACPI.DSDT.DebugDSDT = InputItems[i].BValue != 0; } i++; //103 if (InputItems[i].Valid) { @@ -954,19 +954,19 @@ void ApplyInputs(void) i++; //105 if (InputItems[i].Valid) { - gSettings.KernelAndKextPatches.KPKernelXCPM = InputItems[i].BValue; + gSettings.KernelAndKextPatches.KPKernelXCPM = InputItems[i].BValue != 0; DBG("applied KernelXCPM\n"); GlobalConfig.gBootChanged = true; } i++; //106 if (InputItems[i].Valid) { - gSettings.Devices.StringInjector = InputItems[i].BValue; + gSettings.Devices.StringInjector = InputItems[i].BValue != 0; } i++; //107 if (InputItems[i].Valid) { - gSettings.Devices.NoDefaultProperties = InputItems[i].BValue; + gSettings.Devices.NoDefaultProperties = InputItems[i].BValue != 0; } i++; //108 @@ -983,12 +983,12 @@ void ApplyInputs(void) i++; //110 if (InputItems[i].Valid) { - gSettings.Graphics.NvidiaNoEFI = InputItems[i].BValue; + gSettings.Graphics.NvidiaNoEFI = InputItems[i].BValue != 0; } i++; //111 if (InputItems[i].Valid) { - gSettings.Graphics.NvidiaSingle = InputItems[i].BValue; + gSettings.Graphics.NvidiaSingle = InputItems[i].BValue != 0; } i++; //112 if (InputItems[i].Valid) { @@ -996,15 +996,15 @@ void ApplyInputs(void) } i++; //113 if (InputItems[i].Valid) { - gSettings.ACPI.AutoMerge = InputItems[i].BValue; + gSettings.ACPI.AutoMerge = InputItems[i].BValue != 0; } i++; //114 if (InputItems[i].Valid) { - gSettings.Graphics.RadeonDeInit = InputItems[i].BValue; + gSettings.Graphics.RadeonDeInit = InputItems[i].BValue != 0; } i++; //115 if (InputItems[i].Valid) { - gSettings.SystemParameters.NoCaches = InputItems[i].BValue; + gSettings.SystemParameters.NoCaches = InputItems[i].BValue != 0; } i++; //116 if (InputItems[i].Valid) { @@ -1061,7 +1061,7 @@ void ApplyInputs(void) } i++; //121 if (InputItems[i].Valid) { - gSettings.KernelAndKextPatches.KPPanicNoKextDump = InputItems[i].BValue; + gSettings.KernelAndKextPatches.KPPanicNoKextDump = InputItems[i].BValue != 0; GlobalConfig.gBootChanged = true; } i++; //122 @@ -1071,12 +1071,12 @@ void ApplyInputs(void) } i++; //123 if (InputItems[i].Valid) { - gSettings.GUI.ProvideConsoleGop = InputItems[i].BValue; + gSettings.GUI.ProvideConsoleGop = InputItems[i].BValue != 0; DBG("applied ConsoleGopEnable=%s\n", gSettings.GUI.ProvideConsoleGop ? "Y" : "N" ); } i++; //124 if (InputItems[i].Valid) { - gSettings.ACPI.FixHeaders = InputItems[i].BValue; + gSettings.ACPI.FixHeaders = InputItems[i].BValue != 0; DBG("applied gSettings.ACPI.FixHeaders=%s\n", gSettings.ACPI.FixHeaders ? "Y" : "N" ); } i++; //125 @@ -2612,7 +2612,7 @@ void OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry) INTN SubEntryIndex = -1; //value -1 means old position to remember INTN NextEntryIndex = -1; - XBool OldFontStyle = ThemeX.Proportional; + XBool OldFontStyle = ThemeX.Proportional; ThemeX.Proportional = false; //temporary disable proportional // if (AllowGraphicsMode) { diff --git a/rEFIt_UEFI/refit/menu.h b/rEFIt_UEFI/refit/menu.h index 9cbcc8b9a..904df9d55 100644 --- a/rEFIt_UEFI/refit/menu.h +++ b/rEFIt_UEFI/refit/menu.h @@ -8,7 +8,7 @@ class REFIT_MAINMENU_SCREEN; //void AddMenuInfoLine(IN REFIT_MENU_SCREEN *Screen, IN CONST CHAR16 *InfoLine); //void AddMenuInfo(IN REFIT_MENU_SCREEN *SubScreen, IN CONST CHAR16 *Line); -//void AddMenuEntry(IN REFIT_MENU_SCREEN *Screen, IN REFIT_MENU_ENTRY *Entry, bool freeIt); +//void AddMenuEntry(IN REFIT_MENU_SCREEN *Screen, IN REFIT_MENU_ENTRY *Entry, XBool freeIt); //void AddMenuCheck(REFIT_MENU_SCREEN *SubScreen, CONST CHAR8 *Text, UINTN Bit, INTN ItemNum); //void FreeMenu(IN REFIT_MENU_SCREEN *Screen); //UINTN RunMenu(IN REFIT_MENU_SCREEN *Screen, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);