From ad33a3b16aca7cca2f21324154afe97df7bf4904 Mon Sep 17 00:00:00 2001 From: Jief L Date: Fri, 24 Apr 2020 09:36:29 +0300 Subject: [PATCH] Replace XToolsCommon by XToolsConf in include. Improved panic(). --- .../CloverX64.xcodeproj/project.pbxproj | 100 +++++++++--------- .../cpp_tests.xcodeproj/project.pbxproj | 25 ++++- Xcode/cpp_tests/src/Platform.h | 13 ++- .../cpp_tests/src/XToolsConf.h | 19 ---- rEFIt_UEFI/Platform/Posix/abort.cpp | 69 +++++++++--- .../panic.h => Platform/Posix/abort.h} | 7 +- rEFIt_UEFI/Platform/Posix/posix.h | 1 + rEFIt_UEFI/Platform/Posix/stdio.cpp | 13 ++- rEFIt_UEFI/Platform/Posix/stdio.h | 1 + rEFIt_UEFI/cpp_foundation/XArray.h | 6 +- rEFIt_UEFI/cpp_foundation/XObjArray.h | 15 ++- rEFIt_UEFI/cpp_foundation/XString.cpp | 1 - rEFIt_UEFI/cpp_foundation/XString.h | 2 +- rEFIt_UEFI/cpp_foundation/XStringAbstract.h | 9 +- rEFIt_UEFI/cpp_foundation/XStringArray.cpp | 1 - rEFIt_UEFI/cpp_foundation/XStringArray.h | 2 +- rEFIt_UEFI/cpp_foundation/XStringWArray.cpp | 1 - rEFIt_UEFI/cpp_foundation/XStringWArray.h | 2 +- rEFIt_UEFI/cpp_foundation/XToolsCommon.cpp | 3 - rEFIt_UEFI/cpp_unit_test/XString_test.cpp | 4 +- rEFIt_UEFI/gui/shared_with_menu.cpp | 8 +- rEFIt_UEFI/include/XToolsConf.h | 25 +++++ rEFIt_UEFI/libeg/XCinema.h | 1 - rEFIt_UEFI/libeg/XImage.h | 1 - rEFIt_UEFI/libeg/XTheme.h | 1 - rEFIt_UEFI/libeg/lodepng.cpp | 2 +- rEFIt_UEFI/libeg/lodepng.h | 1 - 27 files changed, 201 insertions(+), 132 deletions(-) rename rEFIt_UEFI/cpp_foundation/XToolsCommon.h => Xcode/cpp_tests/src/XToolsConf.h (54%) rename rEFIt_UEFI/{cpp_util/panic.h => Platform/Posix/abort.h} (69%) delete mode 100644 rEFIt_UEFI/cpp_foundation/XToolsCommon.cpp create mode 100755 rEFIt_UEFI/include/XToolsConf.h diff --git a/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj b/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj index 31e0f826f..30789e069 100644 --- a/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj +++ b/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj @@ -277,21 +277,18 @@ 9AC7808524176C04005CDD5C /* operatorNewDelete.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA324176C04005CDD5C /* operatorNewDelete.h */; }; 9AC7808624176C04005CDD5C /* globals_ctor.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA424176C04005CDD5C /* globals_ctor.h */; }; 9AC7808724176C04005CDD5C /* globals_ctor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FA524176C04005CDD5C /* globals_ctor.cpp */; }; - 9AC7808824176C04005CDD5C /* panic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FA624176C04005CDD5C /* panic.cpp */; }; 9AC7808924176C04005CDD5C /* operatorNewDelete.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FA724176C04005CDD5C /* operatorNewDelete.cpp */; }; 9AC7808A24176C04005CDD5C /* memory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA824176C04005CDD5C /* memory.h */; }; - 9AC7808B24176C04005CDD5C /* panic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA924176C04005CDD5C /* panic.h */; }; + 9AC7808B24176C04005CDD5C /* abort.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA924176C04005CDD5C /* abort.h */; }; 9AC7808C24176C04005CDD5C /* remove_ref.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FAA24176C04005CDD5C /* remove_ref.h */; }; 9AC7808D24176C04005CDD5C /* XStringWArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FAC24176C04005CDD5C /* XStringWArray.h */; }; - 9AC7808E24176C04005CDD5C /* XToolsCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FAD24176C04005CDD5C /* XToolsCommon.h */; }; 9AC7809024176C04005CDD5C /* XStringWArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FAF24176C04005CDD5C /* XStringWArray.cpp */; }; - 9AC7809524176C04005CDD5C /* XToolsCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FB424176C04005CDD5C /* XToolsCommon.cpp */; }; 9AC7809724176C04005CDD5C /* XArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FB624176C04005CDD5C /* XArray.h */; }; 9AC7809824176C04005CDD5C /* XObjArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FB724176C04005CDD5C /* XObjArray.h */; }; 9AC7809A24178F02005CDD5C /* menu_items.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7809924178F02005CDD5C /* menu_items.cpp */; }; 9AC780B32417EE4B005CDD5C /* global_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC780B22417EE4A005CDD5C /* global_test.cpp */; }; 9AC780B52417EE53005CDD5C /* global_test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC780B42417EE53005CDD5C /* global_test.h */; }; - 9ACFE64E24309AF80071CC93 /* panic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA924176C04005CDD5C /* panic.h */; }; + 9ACFE64E24309AF80071CC93 /* abort.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA924176C04005CDD5C /* abort.h */; }; 9ACFE64F24309AF80071CC93 /* MSKEK.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8524176C04005CDD5C /* MSKEK.h */; }; 9ACFE65024309AF80071CC93 /* menu_items.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8E24176C04005CDD5C /* menu_items.h */; }; 9ACFE65124309AF80071CC93 /* XTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E326302428F4EE002240E8 /* XTheme.h */; }; @@ -342,7 +339,6 @@ 9ACFE68924309AF80071CC93 /* all_tests.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77ED724176C04005CDD5C /* all_tests.h */; }; 9ACFE68A24309AF80071CC93 /* strncmp_test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A28CD30241BC0DF00F3D247 /* strncmp_test.h */; }; 9ACFE68B24309AF80071CC93 /* XPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F6324176C04005CDD5C /* XPointer.h */; }; - 9ACFE68C24309AF80071CC93 /* XToolsCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FAD24176C04005CDD5C /* XToolsCommon.h */; }; 9ACFE68E24309AF80071CC93 /* bootscreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8724176C04005CDD5C /* bootscreen.h */; }; 9ACFE69024309AF80071CC93 /* Settings.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F2524176C04005CDD5C /* Settings.h */; }; 9ACFE69324309AF80071CC93 /* ati_reg.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F4F24176C04005CDD5C /* ati_reg.h */; }; @@ -391,7 +387,6 @@ 9ACFE6C424309AF80071CC93 /* Events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4D24176C04005CDD5C /* Events.cpp */; }; 9ACFE6C524309AF80071CC93 /* libscreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F7424176C04005CDD5C /* libscreen.cpp */; }; 9ACFE6C624309AF80071CC93 /* strlen_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A28CD2B241BC0DF00F3D247 /* strlen_test.cpp */; }; - 9ACFE6C724309AF80071CC93 /* panic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FA624176C04005CDD5C /* panic.cpp */; }; 9ACFE6CA24309AF80071CC93 /* tool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F8924176C04005CDD5C /* tool.cpp */; }; 9ACFE6CB24309AF80071CC93 /* BasicIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF4173D242F15CC00D2644C /* BasicIO.cpp */; }; 9ACFE6CC24309AF80071CC93 /* lib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F9624176C04005CDD5C /* lib.cpp */; }; @@ -455,7 +450,6 @@ 9ACFE70D24309AF80071CC93 /* plist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4424176C04005CDD5C /* plist.cpp */; }; 9ACFE70E24309AF80071CC93 /* kernel_patcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3C24176C04005CDD5C /* kernel_patcher.cpp */; }; 9ACFE70F24309AF80071CC93 /* nanosvg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F6C24176C04005CDD5C /* nanosvg.cpp */; }; - 9ACFE71024309AF80071CC93 /* XToolsCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FB424176C04005CDD5C /* XToolsCommon.cpp */; }; 9ACFE71124309AF80071CC93 /* ati.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4324176C04005CDD5C /* ati.cpp */; }; 9ACFE71224309AF80071CC93 /* Net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3E24176C04005CDD5C /* Net.cpp */; }; 9ACFE71324309AF80071CC93 /* kext_inject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3024176C04005CDD5C /* kext_inject.cpp */; }; @@ -470,13 +464,21 @@ 9ACFE72024309AF80071CC93 /* egemb_icons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F6224176C04005CDD5C /* egemb_icons.cpp */; }; 9ACFE72124309AF80071CC93 /* Edid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F2824176C04005CDD5C /* Edid.cpp */; }; 9ACFE72224309AF80071CC93 /* smbios.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F5124176C04005CDD5C /* smbios.cpp */; }; + 9AD469502452B5A600D6D0DB /* Efi.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD4694C2452B5A600D6D0DB /* Efi.h */; }; + 9AD469512452B5A600D6D0DB /* Devices.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD4694D2452B5A600D6D0DB /* Devices.h */; }; + 9AD469522452B5A600D6D0DB /* Pci.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD4694E2452B5A600D6D0DB /* Pci.h */; }; + 9AD469532452B5A600D6D0DB /* OneLinerMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD4694F2452B5A600D6D0DB /* OneLinerMacros.h */; }; + 9AD469552452B63300D6D0DB /* XToolsConf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD469542452B63300D6D0DB /* XToolsConf.h */; }; + 9AD469562452B63800D6D0DB /* XToolsConf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD469542452B63300D6D0DB /* XToolsConf.h */; }; + 9AD469572452B63800D6D0DB /* XToolsConf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD469542452B63300D6D0DB /* XToolsConf.h */; }; + 9AD469582452B63900D6D0DB /* XToolsConf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD469542452B63300D6D0DB /* XToolsConf.h */; }; 9AF4155D242B8FA400D2644C /* poolprint-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF4155B242B8FA300D2644C /* poolprint-test.h */; }; 9AF4155E242B8FA400D2644C /* poolprint-test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF4155C242B8FA300D2644C /* poolprint-test.cpp */; }; 9AF41562242BABC700D2644C /* printlib-test-cpp_conf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF4155F242BABC700D2644C /* printlib-test-cpp_conf.h */; }; 9AF41563242BABC700D2644C /* printlib-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF41560242BABC700D2644C /* printlib-test.h */; }; 9AF41566242BAD5600D2644C /* printf_lite-test-cpp_conf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF41565242BAD5600D2644C /* printf_lite-test-cpp_conf.h */; }; 9AF41568242BAD7D00D2644C /* poolprint-test-cpp_conf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF41567242BAD7D00D2644C /* poolprint-test-cpp_conf.h */; }; - 9AF41584242CD75C00D2644C /* panic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA924176C04005CDD5C /* panic.h */; }; + 9AF41584242CD75C00D2644C /* abort.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA924176C04005CDD5C /* abort.h */; }; 9AF41585242CD75C00D2644C /* MSKEK.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8524176C04005CDD5C /* MSKEK.h */; }; 9AF41586242CD75C00D2644C /* menu_items.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8E24176C04005CDD5C /* menu_items.h */; }; 9AF41587242CD75C00D2644C /* XTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E326302428F4EE002240E8 /* XTheme.h */; }; @@ -525,7 +527,6 @@ 9AF415BF242CD75C00D2644C /* all_tests.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77ED724176C04005CDD5C /* all_tests.h */; }; 9AF415C0242CD75C00D2644C /* strncmp_test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A28CD30241BC0DF00F3D247 /* strncmp_test.h */; }; 9AF415C1242CD75C00D2644C /* XPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F6324176C04005CDD5C /* XPointer.h */; }; - 9AF415C2242CD75C00D2644C /* XToolsCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FAD24176C04005CDD5C /* XToolsCommon.h */; }; 9AF415C4242CD75C00D2644C /* bootscreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8724176C04005CDD5C /* bootscreen.h */; }; 9AF415C6242CD75C00D2644C /* Settings.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F2524176C04005CDD5C /* Settings.h */; }; 9AF415C9242CD75C00D2644C /* ati_reg.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F4F24176C04005CDD5C /* ati_reg.h */; }; @@ -574,7 +575,6 @@ 9AF415FA242CD75C00D2644C /* Events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4D24176C04005CDD5C /* Events.cpp */; }; 9AF415FB242CD75C00D2644C /* libscreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F7424176C04005CDD5C /* libscreen.cpp */; }; 9AF415FC242CD75C00D2644C /* strlen_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A28CD2B241BC0DF00F3D247 /* strlen_test.cpp */; }; - 9AF415FD242CD75C00D2644C /* panic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FA624176C04005CDD5C /* panic.cpp */; }; 9AF41600242CD75C00D2644C /* tool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F8924176C04005CDD5C /* tool.cpp */; }; 9AF41601242CD75C00D2644C /* lib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F9624176C04005CDD5C /* lib.cpp */; }; 9AF41602242CD75C00D2644C /* Injectors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3524176C04005CDD5C /* Injectors.cpp */; }; @@ -636,7 +636,6 @@ 9AF41643242CD75C00D2644C /* plist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4424176C04005CDD5C /* plist.cpp */; }; 9AF41644242CD75C00D2644C /* kernel_patcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3C24176C04005CDD5C /* kernel_patcher.cpp */; }; 9AF41645242CD75C00D2644C /* nanosvg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F6C24176C04005CDD5C /* nanosvg.cpp */; }; - 9AF41646242CD75C00D2644C /* XToolsCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FB424176C04005CDD5C /* XToolsCommon.cpp */; }; 9AF41647242CD75C00D2644C /* ati.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4324176C04005CDD5C /* ati.cpp */; }; 9AF41648242CD75C00D2644C /* Net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3E24176C04005CDD5C /* Net.cpp */; }; 9AF41649242CD75C00D2644C /* kext_inject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3024176C04005CDD5C /* kext_inject.cpp */; }; @@ -651,7 +650,7 @@ 9AF41656242CD75C00D2644C /* egemb_icons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F6224176C04005CDD5C /* egemb_icons.cpp */; }; 9AF41657242CD75C00D2644C /* Edid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F2824176C04005CDD5C /* Edid.cpp */; }; 9AF41658242CD75C00D2644C /* smbios.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F5124176C04005CDD5C /* smbios.cpp */; }; - 9AF41661242CDA5800D2644C /* panic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA924176C04005CDD5C /* panic.h */; }; + 9AF41661242CDA5800D2644C /* abort.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FA924176C04005CDD5C /* abort.h */; }; 9AF41662242CDA5800D2644C /* MSKEK.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8524176C04005CDD5C /* MSKEK.h */; }; 9AF41663242CDA5800D2644C /* menu_items.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8E24176C04005CDD5C /* menu_items.h */; }; 9AF41664242CDA5800D2644C /* XTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E326302428F4EE002240E8 /* XTheme.h */; }; @@ -700,7 +699,6 @@ 9AF4169C242CDA5800D2644C /* all_tests.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77ED724176C04005CDD5C /* all_tests.h */; }; 9AF4169D242CDA5800D2644C /* strncmp_test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A28CD30241BC0DF00F3D247 /* strncmp_test.h */; }; 9AF4169E242CDA5800D2644C /* XPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F6324176C04005CDD5C /* XPointer.h */; }; - 9AF4169F242CDA5800D2644C /* XToolsCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77FAD24176C04005CDD5C /* XToolsCommon.h */; }; 9AF416A1242CDA5800D2644C /* bootscreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F8724176C04005CDD5C /* bootscreen.h */; }; 9AF416A3242CDA5800D2644C /* Settings.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F2524176C04005CDD5C /* Settings.h */; }; 9AF416A6242CDA5800D2644C /* ati_reg.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC77F4F24176C04005CDD5C /* ati_reg.h */; }; @@ -749,7 +747,6 @@ 9AF416D7242CDA5800D2644C /* Events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4D24176C04005CDD5C /* Events.cpp */; }; 9AF416D8242CDA5800D2644C /* libscreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F7424176C04005CDD5C /* libscreen.cpp */; }; 9AF416D9242CDA5800D2644C /* strlen_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A28CD2B241BC0DF00F3D247 /* strlen_test.cpp */; }; - 9AF416DA242CDA5800D2644C /* panic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FA624176C04005CDD5C /* panic.cpp */; }; 9AF416DD242CDA5800D2644C /* tool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F8924176C04005CDD5C /* tool.cpp */; }; 9AF416DE242CDA5800D2644C /* lib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F9624176C04005CDD5C /* lib.cpp */; }; 9AF416DF242CDA5800D2644C /* Injectors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3524176C04005CDD5C /* Injectors.cpp */; }; @@ -811,7 +808,6 @@ 9AF41720242CDA5800D2644C /* plist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4424176C04005CDD5C /* plist.cpp */; }; 9AF41721242CDA5800D2644C /* kernel_patcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3C24176C04005CDD5C /* kernel_patcher.cpp */; }; 9AF41722242CDA5800D2644C /* nanosvg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F6C24176C04005CDD5C /* nanosvg.cpp */; }; - 9AF41723242CDA5800D2644C /* XToolsCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77FB424176C04005CDD5C /* XToolsCommon.cpp */; }; 9AF41724242CDA5800D2644C /* ati.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F4324176C04005CDD5C /* ati.cpp */; }; 9AF41725242CDA5800D2644C /* Net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3E24176C04005CDD5C /* Net.cpp */; }; 9AF41726242CDA5800D2644C /* kext_inject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC77F3024176C04005CDD5C /* kext_inject.cpp */; }; @@ -1046,18 +1042,21 @@ 9AC77FA624176C04005CDD5C /* panic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = panic.cpp; sourceTree = ""; }; 9AC77FA724176C04005CDD5C /* operatorNewDelete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = operatorNewDelete.cpp; sourceTree = ""; }; 9AC77FA824176C04005CDD5C /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = ""; }; - 9AC77FA924176C04005CDD5C /* panic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = panic.h; sourceTree = ""; }; + 9AC77FA924176C04005CDD5C /* abort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = abort.h; sourceTree = ""; }; 9AC77FAA24176C04005CDD5C /* remove_ref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = remove_ref.h; sourceTree = ""; }; 9AC77FAC24176C04005CDD5C /* XStringWArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XStringWArray.h; sourceTree = ""; }; - 9AC77FAD24176C04005CDD5C /* XToolsCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XToolsCommon.h; sourceTree = ""; }; 9AC77FAF24176C04005CDD5C /* XStringWArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XStringWArray.cpp; sourceTree = ""; }; - 9AC77FB424176C04005CDD5C /* XToolsCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XToolsCommon.cpp; sourceTree = ""; }; 9AC77FB624176C04005CDD5C /* XArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XArray.h; sourceTree = ""; }; 9AC77FB724176C04005CDD5C /* XObjArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XObjArray.h; sourceTree = ""; }; 9AC7809924178F02005CDD5C /* menu_items.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = menu_items.cpp; sourceTree = ""; }; 9AC780B22417EE4A005CDD5C /* global_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = global_test.cpp; sourceTree = ""; }; 9AC780B42417EE53005CDD5C /* global_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = global_test.h; sourceTree = ""; }; 9ACFE72824309AF80071CC93 /* libCloverX64 USE_XTHEME=1.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCloverX64 USE_XTHEME=1.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 9AD4694C2452B5A600D6D0DB /* Efi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Efi.h; sourceTree = ""; }; + 9AD4694D2452B5A600D6D0DB /* Devices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Devices.h; sourceTree = ""; }; + 9AD4694E2452B5A600D6D0DB /* Pci.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pci.h; sourceTree = ""; }; + 9AD4694F2452B5A600D6D0DB /* OneLinerMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OneLinerMacros.h; sourceTree = ""; }; + 9AD469542452B63300D6D0DB /* XToolsConf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XToolsConf.h; sourceTree = ""; }; 9AF4155B242B8FA300D2644C /* poolprint-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "poolprint-test.h"; sourceTree = ""; }; 9AF4155C242B8FA300D2644C /* poolprint-test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "poolprint-test.cpp"; sourceTree = ""; }; 9AF4155F242BABC700D2644C /* printlib-test-cpp_conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "printlib-test-cpp_conf.h"; sourceTree = ""; }; @@ -1109,20 +1108,21 @@ 9A105B4724483AE30006DE06 /* Posix */ = { isa = PBXGroup; children = ( - 9A105B4824483AE30006DE06 /* stdlib.h */, - 9A105B4924483AE30006DE06 /* limits.h */, - 9A105B4A24483AE30006DE06 /* strcmp.cpp */, - 9A105B4B24483AE30006DE06 /* stddef.h */, - 9A105B4C24483AE30006DE06 /* stdio.cpp */, 9A105B4D24483AE30006DE06 /* abort.cpp */, + 9AC77FA924176C04005CDD5C /* abort.h */, + 9A105B4924483AE30006DE06 /* limits.h */, + 9A105B5024483AE30006DE06 /* posix.h */, + 9A105B5324483AE30006DE06 /* stdarg.h */, + 9A105B4B24483AE30006DE06 /* stddef.h */, + 9A105B5424483AE30006DE06 /* stdint.h */, + 9A105B4C24483AE30006DE06 /* stdio.cpp */, + 9A105B5224483AE30006DE06 /* stdio.h */, + 9A105B4824483AE30006DE06 /* stdlib.h */, + 9A105B4A24483AE30006DE06 /* strcmp.cpp */, + 9A105B5524483AE30006DE06 /* string.h */, + 9A105B5124483AE30006DE06 /* strlen.cpp */, 9A105B4E24483AE30006DE06 /* wchar.cpp */, 9A105B4F24483AE30006DE06 /* wchar.h */, - 9A105B5024483AE30006DE06 /* posix.h */, - 9A105B5124483AE30006DE06 /* strlen.cpp */, - 9A105B5224483AE30006DE06 /* stdio.h */, - 9A105B5324483AE30006DE06 /* stdarg.h */, - 9A105B5424483AE30006DE06 /* stdint.h */, - 9A105B5524483AE30006DE06 /* string.h */, ); path = Posix; sourceTree = ""; @@ -1211,6 +1211,11 @@ 9AC77F1324176C04005CDD5C /* include */ = { isa = PBXGroup; children = ( + 9AD469542452B63300D6D0DB /* XToolsConf.h */, + 9AD4694D2452B5A600D6D0DB /* Devices.h */, + 9AD4694C2452B5A600D6D0DB /* Efi.h */, + 9AD4694F2452B5A600D6D0DB /* OneLinerMacros.h */, + 9AD4694E2452B5A600D6D0DB /* Pci.h */, 9AC77F1524176C04005CDD5C /* Handle.h */, 9AC77F1424176C04005CDD5C /* syslinux_mbr.h */, ); @@ -1220,6 +1225,7 @@ 9AC77F1624176C04005CDD5C /* Platform */ = { isa = PBXGroup; children = ( + 9A105B4724483AE30006DE06 /* Posix */, 9A105B80244852D70006DE06 /* VersionString.cpp */, 9A105B7F244852D70006DE06 /* VersionString.h */, 9AC77F2024176C04005CDD5C /* AcpiPatcher.cpp */, @@ -1296,7 +1302,6 @@ 9A105B5924483AE30006DE06 /* PlatformDriverOverride.h */, 9AC77F4424176C04005CDD5C /* plist.cpp */, 9A105B4124483AE00006DE06 /* plist.h */, - 9A105B4724483AE30006DE06 /* Posix */, 9AC77F5924176C04005CDD5C /* Settings.cpp */, 9AC77F2524176C04005CDD5C /* Settings.h */, 9AC77F5124176C04005CDD5C /* smbios.cpp */, @@ -1436,7 +1441,6 @@ 9AC77FA724176C04005CDD5C /* operatorNewDelete.cpp */, 9AC77FA324176C04005CDD5C /* operatorNewDelete.h */, 9AC77FA624176C04005CDD5C /* panic.cpp */, - 9AC77FA924176C04005CDD5C /* panic.h */, 9AC77FAA24176C04005CDD5C /* remove_ref.h */, ); path = cpp_util; @@ -1456,8 +1460,6 @@ 9A9AEB92243F7B5600FBD7D8 /* XStringArray.h */, 9AC77FAF24176C04005CDD5C /* XStringWArray.cpp */, 9AC77FAC24176C04005CDD5C /* XStringWArray.h */, - 9AC77FB424176C04005CDD5C /* XToolsCommon.cpp */, - 9AC77FAD24176C04005CDD5C /* XToolsCommon.h */, ); path = cpp_foundation; sourceTree = ""; @@ -1469,7 +1471,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 9AC7808B24176C04005CDD5C /* panic.h in Headers */, + 9AC7808B24176C04005CDD5C /* abort.h in Headers */, 9AC7806B24176C04005CDD5C /* MSKEK.h in Headers */, 9A105B1E244644C50006DE06 /* XCinema.h in Headers */, 9AC7807224176C04005CDD5C /* menu_items.h in Headers */, @@ -1506,6 +1508,7 @@ 9AF41566242BAD5600D2644C /* printf_lite-test-cpp_conf.h in Headers */, 9A105B7624483AE40006DE06 /* stdint.h in Headers */, 9AC7806124176C04005CDD5C /* CloverDB.h in Headers */, + 9AD469532452B5A600D6D0DB /* OneLinerMacros.h in Headers */, 9AC7803424176C04005CDD5C /* LegacyBiosThunk.h in Headers */, 9AC7806A24176C04005CDD5C /* tool.h in Headers */, 9AC7808324176C04005CDD5C /* globals_dtor.h in Headers */, @@ -1514,6 +1517,7 @@ 9AF41563242BABC700D2644C /* printlib-test.h in Headers */, 9A105B5D24483AE40006DE06 /* FixBiosDsdt.h in Headers */, 9A9AEB96243F7B5600FBD7D8 /* XStringArray.h in Headers */, + 9AD469522452B5A600D6D0DB /* Pci.h in Headers */, 9A105B6624483AE40006DE06 /* LegacyBoot.h in Headers */, 9AC7802224176C04005CDD5C /* DataHubCpu.h in Headers */, 9AC7807A24176C04005CDD5C /* lib.h in Headers */, @@ -1528,6 +1532,7 @@ 9A105B7524483AE40006DE06 /* stdarg.h in Headers */, 9AC7807D24176C04005CDD5C /* IO.h in Headers */, 9A105B6424483AE40006DE06 /* plist.h in Headers */, + 9AD469502452B5A600D6D0DB /* Efi.h in Headers */, 9AC7801724176C04005CDD5C /* device_inject.h in Headers */, 9A105B6124483AE40006DE06 /* MachO-loader.h in Headers */, 9AC7806624176C04005CDD5C /* entry_scan.h in Headers */, @@ -1540,7 +1545,6 @@ 9A105B7124483AE40006DE06 /* wchar.h in Headers */, 9AC7804A24176C04005CDD5C /* XPointer.h in Headers */, 9A35A6182451FE1600CAFF76 /* XStringAbstract.h in Headers */, - 9AC7808E24176C04005CDD5C /* XToolsCommon.h in Headers */, 9AC7806D24176C04005CDD5C /* bootscreen.h in Headers */, 9AC7800E24176C04005CDD5C /* Settings.h in Headers */, 9A105B3924483AD50006DE06 /* image.h in Headers */, @@ -1579,6 +1583,8 @@ 9A105B6724483AE40006DE06 /* AcpiPatcher.h in Headers */, 9AC7802424176C04005CDD5C /* sse3_patcher.h in Headers */, 9AC77FFD24176C04005CDD5C /* Version.h in Headers */, + 9AD469552452B63300D6D0DB /* XToolsConf.h in Headers */, + 9AD469512452B5A600D6D0DB /* Devices.h in Headers */, 9A28CC98241AB34800F3D247 /* XString_test.h in Headers */, 9AC7807424176C04005CDD5C /* REFIT_MENU_SCREEN.h in Headers */, 9A105B7C24483AE40006DE06 /* StartupSound.h in Headers */, @@ -1599,7 +1605,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 9ACFE64E24309AF80071CC93 /* panic.h in Headers */, + 9ACFE64E24309AF80071CC93 /* abort.h in Headers */, 9ACFE64F24309AF80071CC93 /* MSKEK.h in Headers */, 9ACFE65024309AF80071CC93 /* menu_items.h in Headers */, 9ACFE65124309AF80071CC93 /* XTheme.h in Headers */, @@ -1652,7 +1658,6 @@ 9ACFE68924309AF80071CC93 /* all_tests.h in Headers */, 9ACFE68A24309AF80071CC93 /* strncmp_test.h in Headers */, 9ACFE68B24309AF80071CC93 /* XPointer.h in Headers */, - 9ACFE68C24309AF80071CC93 /* XToolsCommon.h in Headers */, 9ACFE68E24309AF80071CC93 /* bootscreen.h in Headers */, 9ACFE69024309AF80071CC93 /* Settings.h in Headers */, 9ACFE69324309AF80071CC93 /* ati_reg.h in Headers */, @@ -1675,6 +1680,7 @@ 9ACFE6A124309AF80071CC93 /* HdaCodecDump.h in Headers */, 9ACFE6A224309AF80071CC93 /* kext_inject.h in Headers */, 9ACFE6A324309AF80071CC93 /* Nvram.h in Headers */, + 9AD469582452B63900D6D0DB /* XToolsConf.h in Headers */, 9ACFE6A424309AF80071CC93 /* poolprint-test-cpp_conf.h in Headers */, 9ACFE6A524309AF80071CC93 /* gma.h in Headers */, 9ACFE6A624309AF80071CC93 /* sse3_patcher.h in Headers */, @@ -1696,7 +1702,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 9AF41584242CD75C00D2644C /* panic.h in Headers */, + 9AF41584242CD75C00D2644C /* abort.h in Headers */, 9AF41585242CD75C00D2644C /* MSKEK.h in Headers */, 9A105B2624464A830006DE06 /* VectorGraphics.h in Headers */, 9AF41586242CD75C00D2644C /* menu_items.h in Headers */, @@ -1737,6 +1743,7 @@ 9AF415B1242CD75C00D2644C /* lib.h in Headers */, 9AF415B2242CD75C00D2644C /* b64cdecode.h in Headers */, 9AF415B3242CD75C00D2644C /* EfiFileLib.h in Headers */, + 9AD469562452B63800D6D0DB /* XToolsConf.h in Headers */, 9AF415B4242CD75C00D2644C /* menu_globals.h in Headers */, 9AF415B5242CD75C00D2644C /* XObjArray.h in Headers */, 9AF415B8242CD75C00D2644C /* sse3_5_patcher.h in Headers */, @@ -1749,7 +1756,6 @@ 9AF415BF242CD75C00D2644C /* all_tests.h in Headers */, 9AF415C0242CD75C00D2644C /* strncmp_test.h in Headers */, 9AF415C1242CD75C00D2644C /* XPointer.h in Headers */, - 9AF415C2242CD75C00D2644C /* XToolsCommon.h in Headers */, 9AF415C4242CD75C00D2644C /* bootscreen.h in Headers */, 9AF415C6242CD75C00D2644C /* Settings.h in Headers */, 9AF415C9242CD75C00D2644C /* ati_reg.h in Headers */, @@ -1791,7 +1797,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 9AF41661242CDA5800D2644C /* panic.h in Headers */, + 9AF41661242CDA5800D2644C /* abort.h in Headers */, 9AF41662242CDA5800D2644C /* MSKEK.h in Headers */, 9A105B2724464A830006DE06 /* VectorGraphics.h in Headers */, 9AF41663242CDA5800D2644C /* menu_items.h in Headers */, @@ -1832,6 +1838,7 @@ 9AF4168E242CDA5800D2644C /* lib.h in Headers */, 9AF4168F242CDA5800D2644C /* b64cdecode.h in Headers */, 9AF41690242CDA5800D2644C /* EfiFileLib.h in Headers */, + 9AD469572452B63800D6D0DB /* XToolsConf.h in Headers */, 9AF41691242CDA5800D2644C /* menu_globals.h in Headers */, 9AF41692242CDA5800D2644C /* XObjArray.h in Headers */, 9AF41695242CDA5800D2644C /* sse3_5_patcher.h in Headers */, @@ -1844,7 +1851,6 @@ 9AF4169C242CDA5800D2644C /* all_tests.h in Headers */, 9AF4169D242CDA5800D2644C /* strncmp_test.h in Headers */, 9AF4169E242CDA5800D2644C /* XPointer.h in Headers */, - 9AF4169F242CDA5800D2644C /* XToolsCommon.h in Headers */, 9AF416A1242CDA5800D2644C /* bootscreen.h in Headers */, 9AF416A3242CDA5800D2644C /* Settings.h in Headers */, 9AF416A6242CDA5800D2644C /* ati_reg.h in Headers */, @@ -2087,7 +2093,6 @@ 9AC7803624176C04005CDD5C /* Events.cpp in Sources */, 9AC7805B24176C04005CDD5C /* libscreen.cpp in Sources */, 9A28CD31241BC0DF00F3D247 /* strlen_test.cpp in Sources */, - 9AC7808824176C04005CDD5C /* panic.cpp in Sources */, 9AC7806F24176C04005CDD5C /* tool.cpp in Sources */, 9AF41740242F15CC00D2644C /* BasicIO.cpp in Sources */, 9AC7807924176C04005CDD5C /* lib.cpp in Sources */, @@ -2158,7 +2163,6 @@ 9AC7802D24176C04005CDD5C /* plist.cpp in Sources */, 9AC7802524176C04005CDD5C /* kernel_patcher.cpp in Sources */, 9AC7805324176C04005CDD5C /* nanosvg.cpp in Sources */, - 9AC7809524176C04005CDD5C /* XToolsCommon.cpp in Sources */, 9AC7802C24176C04005CDD5C /* ati.cpp in Sources */, 9AC7802724176C04005CDD5C /* Net.cpp in Sources */, 9AC7801924176C04005CDD5C /* kext_inject.cpp in Sources */, @@ -2200,7 +2204,6 @@ 9ACFE6C524309AF80071CC93 /* libscreen.cpp in Sources */, 9ACFE6C624309AF80071CC93 /* strlen_test.cpp in Sources */, 9A105B88244852D70006DE06 /* VersionString.cpp in Sources */, - 9ACFE6C724309AF80071CC93 /* panic.cpp in Sources */, 9ACFE6CA24309AF80071CC93 /* tool.cpp in Sources */, 9ACFE6CB24309AF80071CC93 /* BasicIO.cpp in Sources */, 9A4F68582449D4AE004B2F7E /* stdio.cpp in Sources */, @@ -2274,7 +2277,6 @@ 9ACFE70D24309AF80071CC93 /* plist.cpp in Sources */, 9ACFE70E24309AF80071CC93 /* kernel_patcher.cpp in Sources */, 9ACFE70F24309AF80071CC93 /* nanosvg.cpp in Sources */, - 9ACFE71024309AF80071CC93 /* XToolsCommon.cpp in Sources */, 9ACFE71124309AF80071CC93 /* ati.cpp in Sources */, 9ACFE71224309AF80071CC93 /* Net.cpp in Sources */, 9ACFE71324309AF80071CC93 /* kext_inject.cpp in Sources */, @@ -2316,7 +2318,6 @@ 9AF415FB242CD75C00D2644C /* libscreen.cpp in Sources */, 9AF415FC242CD75C00D2644C /* strlen_test.cpp in Sources */, 9A105B86244852D70006DE06 /* VersionString.cpp in Sources */, - 9AF415FD242CD75C00D2644C /* panic.cpp in Sources */, 9AF41600242CD75C00D2644C /* tool.cpp in Sources */, 9AF41742242F15D600D2644C /* BasicIO.cpp in Sources */, 9A4F68562449D4AE004B2F7E /* stdio.cpp in Sources */, @@ -2389,7 +2390,6 @@ 9AF41643242CD75C00D2644C /* plist.cpp in Sources */, 9AF41644242CD75C00D2644C /* kernel_patcher.cpp in Sources */, 9AF41645242CD75C00D2644C /* nanosvg.cpp in Sources */, - 9AF41646242CD75C00D2644C /* XToolsCommon.cpp in Sources */, 9AF41647242CD75C00D2644C /* ati.cpp in Sources */, 9AF41648242CD75C00D2644C /* Net.cpp in Sources */, 9AF41649242CD75C00D2644C /* kext_inject.cpp in Sources */, @@ -2432,7 +2432,6 @@ 9AF416D8242CDA5800D2644C /* libscreen.cpp in Sources */, 9AF416D9242CDA5800D2644C /* strlen_test.cpp in Sources */, 9A105B87244852D70006DE06 /* VersionString.cpp in Sources */, - 9AF416DA242CDA5800D2644C /* panic.cpp in Sources */, 9AF416DD242CDA5800D2644C /* tool.cpp in Sources */, 9AF41743242F15D700D2644C /* BasicIO.cpp in Sources */, 9A4F68572449D4AE004B2F7E /* stdio.cpp in Sources */, @@ -2505,7 +2504,6 @@ 9AF41720242CDA5800D2644C /* plist.cpp in Sources */, 9AF41721242CDA5800D2644C /* kernel_patcher.cpp in Sources */, 9AF41722242CDA5800D2644C /* nanosvg.cpp in Sources */, - 9AF41723242CDA5800D2644C /* XToolsCommon.cpp in Sources */, 9AF41724242CDA5800D2644C /* ati.cpp in Sources */, 9AF41725242CDA5800D2644C /* Net.cpp in Sources */, 9AF41726242CDA5800D2644C /* kext_inject.cpp in Sources */, @@ -2555,6 +2553,7 @@ GCC_WARN_SHADOW = YES; HEADER_SEARCH_PATHS = ( $PROJECT_DIR/../../Build/Clover/DEBUG_XCODE8/X64/rEFIt_UEFI/refit/DEBUG, + $PROJECT_DIR/../../rEFIt_UEFI/include, $PROJECT_DIR/../../rEFIt_UEFI/Platform/Posix, $PROJECT_DIR/../../rEFIt_UEFI/Platform, $PROJECT_DIR/../../rEFIt_UEFI/cpp_unit_test, @@ -2608,6 +2607,7 @@ GCC_WARN_SHADOW = YES; HEADER_SEARCH_PATHS = ( $PROJECT_DIR/../../Build/Clover/DEBUG_XCODE8/X64/rEFIt_UEFI/refit/DEBUG, + $PROJECT_DIR/../../rEFIt_UEFI/include, $PROJECT_DIR/../../rEFIt_UEFI/Platform/Posix, $PROJECT_DIR/../../rEFIt_UEFI/Platform, $PROJECT_DIR/../../rEFIt_UEFI/cpp_unit_test, diff --git a/Xcode/cpp_tests/cpp_tests.xcodeproj/project.pbxproj b/Xcode/cpp_tests/cpp_tests.xcodeproj/project.pbxproj index 2c91626a6..c530f2342 100644 --- a/Xcode/cpp_tests/cpp_tests.xcodeproj/project.pbxproj +++ b/Xcode/cpp_tests/cpp_tests.xcodeproj/project.pbxproj @@ -79,6 +79,9 @@ 9ACAB117242623EE00BDB3CF /* printf_lite.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACAB116242623EE00BDB3CF /* printf_lite.c */; }; 9ACAB1192426255C00BDB3CF /* printf_lite.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACAB116242623EE00BDB3CF /* printf_lite.c */; }; 9ACAB11A2426255C00BDB3CF /* printf_lite.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACAB116242623EE00BDB3CF /* printf_lite.c */; }; + 9AD469492452B33700D6D0DB /* shared_with_menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AD469472452B33700D6D0DB /* shared_with_menu.cpp */; }; + 9AD4694A2452B33700D6D0DB /* shared_with_menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AD469472452B33700D6D0DB /* shared_with_menu.cpp */; }; + 9AD4694B2452B33700D6D0DB /* shared_with_menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AD469472452B33700D6D0DB /* shared_with_menu.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -166,6 +169,10 @@ 9AC780A62417DD2F005CDD5C /* panic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = panic.h; sourceTree = ""; }; 9ACAB116242623EE00BDB3CF /* printf_lite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = printf_lite.c; sourceTree = ""; }; 9ACAB1182426240C00BDB3CF /* printf_lite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = printf_lite.h; path = ../../Include/Library/printf_lite.h; sourceTree = ""; }; + 9AD469472452B33700D6D0DB /* shared_with_menu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shared_with_menu.cpp; sourceTree = ""; }; + 9AD469482452B33700D6D0DB /* shared_with_menu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared_with_menu.h; sourceTree = ""; }; + 9AD469592452B7C000D6D0DB /* XToolsConf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XToolsConf.h; sourceTree = ""; }; + 9AD4695A2452B7C000D6D0DB /* poolprintfloat-test-cpp_conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "poolprintfloat-test-cpp_conf.h"; sourceTree = ""; }; 9AF4156B242CBB5600D2644C /* printf_lite-test-cpp_conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "printf_lite-test-cpp_conf.h"; sourceTree = ""; }; 9AF4156D242CBC4900D2644C /* printf_lite-conf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "printf_lite-conf.h"; path = "../../Include/Library/printf_lite-conf.h"; sourceTree = ""; }; 9AF4156E242CBC6000D2644C /* printf_lite-conf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "printf_lite-conf.h"; sourceTree = ""; }; @@ -297,11 +304,12 @@ 9A9223242402FD1000483CBA = { isa = PBXGroup; children = ( + 9AD469462452B30500D6D0DB /* gui */, 9A1A3FD82424BC22008C89EB /* MemLogLibDefault */, 9A0B08432402FE9300E2B470 /* cpp_foundation */, 9A0B084C2402FE9B00E2B470 /* cpp_unit_test */, - 9A92232F2402FD1000483CBA /* Main */, 9AC7809C2417DD2F005CDD5C /* cpp_util */, + 9A92232F2402FD1000483CBA /* Main */, 9A28CCAC241B816400F3D247 /* Platform */, 9A92232E2402FD1000483CBA /* Products */, ); @@ -320,6 +328,8 @@ 9A92232F2402FD1000483CBA /* Main */ = { isa = PBXGroup; children = ( + 9AD469592452B7C000D6D0DB /* XToolsConf.h */, + 9AD4695A2452B7C000D6D0DB /* poolprintfloat-test-cpp_conf.h */, 9AF41578242CBED700D2644C /* poolprint-test-cpp_conf.h */, 9AF41579242CBED700D2644C /* printlib-test-cpp_conf.h */, 9A9223302402FD1000483CBA /* main.cpp */, @@ -355,6 +365,16 @@ path = ../../rEFIt_UEFI/cpp_util; sourceTree = ""; }; + 9AD469462452B30500D6D0DB /* gui */ = { + isa = PBXGroup; + children = ( + 9AD469472452B33700D6D0DB /* shared_with_menu.cpp */, + 9AD469482452B33700D6D0DB /* shared_with_menu.h */, + ); + name = gui; + path = ../../rEFIt_UEFI/gui; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -464,6 +484,7 @@ 9A9AEB8E243F752C00FBD7D8 /* unicode_conversions.cpp in Sources */, 9A0B087B2403B08400E2B470 /* global_test.cpp in Sources */, 9A0B087C2403B08400E2B470 /* XToolsCommon.cpp in Sources */, + 9AD4694A2452B33700D6D0DB /* shared_with_menu.cpp in Sources */, 9ACAB1192426255C00BDB3CF /* printf_lite.c in Sources */, 9A0B087D2403B08400E2B470 /* XStringWArray_test.cpp in Sources */, 9A28CD11241B9EF800F3D247 /* strcmp.cpp in Sources */, @@ -495,6 +516,7 @@ 9A9AEB8F243F752C00FBD7D8 /* unicode_conversions.cpp in Sources */, 9A57C2232418B9A00029A39F /* global_test.cpp in Sources */, 9A57C2242418B9A00029A39F /* XToolsCommon.cpp in Sources */, + 9AD4694B2452B33700D6D0DB /* shared_with_menu.cpp in Sources */, 9ACAB11A2426255C00BDB3CF /* printf_lite.c in Sources */, 9A57C2252418B9A00029A39F /* XStringWArray_test.cpp in Sources */, 9A28CD12241B9EF800F3D247 /* strcmp.cpp in Sources */, @@ -526,6 +548,7 @@ 9A4185B12439E4D600BEAFB8 /* LoadOptions_test.cpp in Sources */, 9A0B08572402FF7A00E2B470 /* XToolsCommon.cpp in Sources */, 9ACAB117242623EE00BDB3CF /* printf_lite.c in Sources */, + 9AD469492452B33700D6D0DB /* shared_with_menu.cpp in Sources */, 9A0B08582402FF7F00E2B470 /* XStringWArray_test.cpp in Sources */, 9A9AEB8D243F73CE00FBD7D8 /* unicode_conversions.cpp in Sources */, 9A4185C02439F73A00BEAFB8 /* XStringArray.cpp in Sources */, diff --git a/Xcode/cpp_tests/src/Platform.h b/Xcode/cpp_tests/src/Platform.h index 2293036f1..cd142e92d 100755 --- a/Xcode/cpp_tests/src/Platform.h +++ b/Xcode/cpp_tests/src/Platform.h @@ -15,8 +15,11 @@ #include #include #include -#include "../../../rEFIt_UEFI/cpp_foundation/unicode_conversions.h" #include "posix.h" + +#include "../../../rEFIt_UEFI/cpp_foundation/unicode_conversions.h" +#include "../../../rEFIt_UEFI/cpp_foundation/XString.h" + #include "xcode_utf16.h" @@ -55,10 +58,10 @@ typedef UINTN RETURN_STATUS; #define OPTIONAL #define ASSERT(x) - -#ifdef _MSC_VER -#define __typeof__(x) decltype(x) -#endif + +#ifdef _MSC_VER +#define __typeof__(x) decltype(x) +#endif void CpuDeadLoop(void); void DebugLog(INTN DebugMode, const char *FormatString, ...); diff --git a/rEFIt_UEFI/cpp_foundation/XToolsCommon.h b/Xcode/cpp_tests/src/XToolsConf.h similarity index 54% rename from rEFIt_UEFI/cpp_foundation/XToolsCommon.h rename to Xcode/cpp_tests/src/XToolsConf.h index 7e329e39e..357e713a9 100755 --- a/rEFIt_UEFI/cpp_foundation/XToolsCommon.h +++ b/Xcode/cpp_tests/src/XToolsConf.h @@ -19,26 +19,7 @@ extern xsize XBufferGrowByDefault; #include "../cpp_util/panic.h" -#ifdef CLOVER_BUILD - - -extern "C" { -#include -#include // for StrCmp -#include -#include // for CopyMen -} - -#endif - -//#define Xalloc(AllocationSize) AllocatePool(AllocationSize) -//#define Xrealloc(OldSize, NewSize, OldBuffer) ReallocatePool(OldSize, NewSize, OldBuffer) -//#define Xfree(Buffer) FreePool(Buffer) -//#define Xmemmove(dest,source,count) CopyMem(dest, (void*)(source), count) // that has to handle overlapping memory (prefer memmove to memcpy). - -#if !defined(CLOVER_BUILD) #define realloc(ptr, newsize, oldsize) realloc(ptr, newsize) -#endif // Declare here instead of include to avoid circular dependency. diff --git a/rEFIt_UEFI/Platform/Posix/abort.cpp b/rEFIt_UEFI/Platform/Posix/abort.cpp index 63bb1aa06..5817ec90d 100644 --- a/rEFIt_UEFI/Platform/Posix/abort.cpp +++ b/rEFIt_UEFI/Platform/Posix/abort.cpp @@ -1,22 +1,24 @@ -#ifdef CLOVER_BUILD +//#ifdef CLOVER_BUILD #include "../../Platform/BootLog.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#include // for CpuDeadLoop - -#ifdef __cplusplus -} // extern "C" -#endif - -#else - #include -#endif +// +//#ifdef __cplusplus +//extern "C" { +//#endif +// +//#include // for CpuDeadLoop +// +//#ifdef __cplusplus +//} // extern "C" +//#endif +// +//#else +// +//#include +// +//#endif void abort(void) { @@ -25,3 +27,40 @@ void abort(void) CpuDeadLoop(); } } + + +bool stop_at_panic = true; +bool i_have_panicked = false; + +/* + * + * Function panic_ seems useless. It's same as panic(). It's to be able to put a breakpoint in gdb with br panic_(). This is done in gdb_launch script in Qemu + */ +static void panic_(const char* format, VA_LIST va) +{ + if ( format ) { + vprintf(format, va); + } + printf("A fatal error happened. System halted\n"); + while (1) { // this will avoid warning : Function declared 'noreturn' should not return + CpuDeadLoop(); + } +} + +void panic(const char* format, ...) +{ + if ( stop_at_panic ) { + VA_LIST va; + VA_START(va, format); + panic_(format, va); + VA_END(va); + }else{ + i_have_panicked = true; + } +} + + +void panic(void) +{ + panic(nullptr); +} diff --git a/rEFIt_UEFI/cpp_util/panic.h b/rEFIt_UEFI/Platform/Posix/abort.h similarity index 69% rename from rEFIt_UEFI/cpp_util/panic.h rename to rEFIt_UEFI/Platform/Posix/abort.h index 09bb3cb51..99ae92d7b 100644 --- a/rEFIt_UEFI/cpp_util/panic.h +++ b/rEFIt_UEFI/Platform/Posix/abort.h @@ -1,11 +1,16 @@ #ifndef __PANIC_H__ #define __PANIC_H__ +#ifdef _MSC_VER +# define __attribute__(x) +#endif + extern bool stop_at_panic; extern bool i_have_panicked; void panic(void); -void panic(const char* s); +void panic(const char* format, ...) __attribute__((__format__(__printf__, 1, 2))); + class DontStopAtPanic { diff --git a/rEFIt_UEFI/Platform/Posix/posix.h b/rEFIt_UEFI/Platform/Posix/posix.h index c327d4b6a..fd7869b69 100755 --- a/rEFIt_UEFI/Platform/Posix/posix.h +++ b/rEFIt_UEFI/Platform/Posix/posix.h @@ -16,6 +16,7 @@ #include "stdlib.h" #include "string.h" #include "wchar.h" +#include "abort.h" // // Macros that directly map functions to BaseLib, BaseMemoryLib, and DebugLib functions diff --git a/rEFIt_UEFI/Platform/Posix/stdio.cpp b/rEFIt_UEFI/Platform/Posix/stdio.cpp index 9f9afbe81..a8f8679ca 100755 --- a/rEFIt_UEFI/Platform/Posix/stdio.cpp +++ b/rEFIt_UEFI/Platform/Posix/stdio.cpp @@ -24,14 +24,19 @@ extern "C" { static XString stdio_static_buf; static XStringW stdio_static_wbuf; +int vprintf(const char* format, VA_LIST va) +{ + // AsciiPrint seems no to work with utf8 chars. We have to use Print instead + stdio_static_wbuf.vSWPrintf(format, va); + int ret = (int)Print(L"%s", stdio_static_wbuf.wc_str()); + return ret; +} + int printf(const char* format, ...) { va_list va; - - // AsciiPrint seems no to work with utf8 chars. We have to use Print instead va_start (va, format); - stdio_static_wbuf.vSWPrintf(format, va); - int ret = (int)Print(L"%s", stdio_static_wbuf.wc_str()); + int ret = vprintf(format, va); va_end(va); return ret; } diff --git a/rEFIt_UEFI/Platform/Posix/stdio.h b/rEFIt_UEFI/Platform/Posix/stdio.h index 945bb608e..9ed799aed 100644 --- a/rEFIt_UEFI/Platform/Posix/stdio.h +++ b/rEFIt_UEFI/Platform/Posix/stdio.h @@ -9,6 +9,7 @@ extern "C" { #define __attribute__(x) #endif +int vprintf(const char* format, VA_LIST ap); int printf(const char* format, ...) __attribute__((format(printf, 1, 2))); diff --git a/rEFIt_UEFI/cpp_foundation/XArray.h b/rEFIt_UEFI/cpp_foundation/XArray.h index 5038b2257..13a5e19c7 100755 --- a/rEFIt_UEFI/cpp_foundation/XArray.h +++ b/rEFIt_UEFI/cpp_foundation/XArray.h @@ -11,7 +11,7 @@ #if !defined(__XARRAY_H__) #define __XARRAY_H__ -#include "XToolsCommon.h" +#include #if 0 @@ -183,7 +183,7 @@ void XArray::CheckSize(xsize nNewSize, xsize nGrowBy) //XArray_DBG("CheckSize: m_len=%d, m_size=%d, nGrowBy=%d, nNewSize=%d\n", m_len, m_size, nGrowBy, nNewSize); if ( nNewSize > m_allocatedSize ) { nNewSize += nGrowBy; - m_data = (TYPE *)realloc((void *)m_data, nNewSize * sizeof(TYPE), m_allocatedSize * sizeof(TYPE) ); + m_data = (TYPE *)Xrealloc((void *)m_data, nNewSize * sizeof(TYPE), m_allocatedSize * sizeof(TYPE) ); if ( !m_data ) { DebugLog(2, "XArray::CheckSize(nNewSize=%zu, nGrowBy=%zu) : Xrealloc(%zu, %lu, %" PRIuPTR ") returned NULL. System halted\n", nNewSize, nGrowBy, m_allocatedSize, nNewSize*sizeof(TYPE), (uintptr_t)m_data); panic(); @@ -348,7 +348,7 @@ void XArray::RemoveAtIndex(xsize nIndex) template void XArray::RemoveAtIndex(int nIndex) { - #if defined(__XTOOLS_INT_CHECK__) + #if defined(__XTOOLS_CHECK_OVERFLOW__) if ( nIndex < 0 ) { DebugLog(2, "XArray::RemoveAtIndex(int nIndex) : BUG nIndex (%d) is < 0. System halted\n", nIndex); panic(); diff --git a/rEFIt_UEFI/cpp_foundation/XObjArray.h b/rEFIt_UEFI/cpp_foundation/XObjArray.h index a471d962d..8b130da4d 100755 --- a/rEFIt_UEFI/cpp_foundation/XObjArray.h +++ b/rEFIt_UEFI/cpp_foundation/XObjArray.h @@ -11,7 +11,7 @@ #if !defined(__XOBJARRAY_H__) #define __XOBJARRAY_H__ -#include "XToolsCommon.h" +#include #if 1 @@ -181,10 +181,9 @@ void XObjArrayNC::CheckSize(xsize nNewSize, xsize nGrowBy) { if ( m_allocatedSize < nNewSize ) { nNewSize += nGrowBy + 1; - _Data = (XObjArrayEntry *)realloc((void *)_Data, sizeof(XObjArrayEntry) * nNewSize, sizeof(XObjArrayEntry) * m_allocatedSize); + _Data = (XObjArrayEntry *)Xrealloc((void *)_Data, sizeof(XObjArrayEntry) * nNewSize, sizeof(XObjArrayEntry) * m_allocatedSize); if ( !_Data ) { - DebugLog(2, "XObjArrayNC::CheckSize(nNewSize=%zu, nGrowBy=%zu) : Xrealloc(%zu, %zu, %" PRIuPTR ") returned NULL. System halted\n", nNewSize, nGrowBy, m_allocatedSize, sizeof(XObjArrayEntry) * nNewSize, (uintptr_t)_Data); - panic(); + panic("XObjArrayNC::CheckSize(nNewSize=%zu, nGrowBy=%zu) : Xrealloc(%zu, %zu, %" PRIuPTR ") returned NULL. System halted\n", nNewSize, nGrowBy, m_allocatedSize, sizeof(XObjArrayEntry) * nNewSize, (uintptr_t)_Data); } // memset(&_Data[m_allocatedSize], 0, (nNewSize-m_allocatedSize) * sizeof(XObjArrayEntry)); m_allocatedSize = nNewSize; @@ -196,8 +195,7 @@ template TYPE &XObjArrayNC::ElementAt(xsize index) { if ( index >= _Len ) { - DebugLog(2, "XObjArray::ElementAt(xsize) -> operator [] - index (%zu) greater than length (%zu)\n", index, _Len); - panic(); + panic("XObjArray::ElementAt(xsize) -> operator [] - index (%zu) greater than length (%zu)\n", index, _Len); } return *((TYPE *)(_Data[index].Object)); } @@ -207,8 +205,7 @@ template const TYPE &XObjArrayNC::ElementAt(xsize index) const { if ( index >= _Len ) { - DebugLog(2, "XObjArray::ElementAt(xsize) const -> operator [] - index (%zu) greater than length (%zu)\n", index, _Len); - panic(); + panic("XObjArray::ElementAt(xsize) const -> operator [] - index (%zu) greater than length (%zu)\n", index, _Len); } return *((TYPE *)(_Data[index].Object)); } @@ -468,7 +465,7 @@ void XObjArrayNC::RemoveWithoutFreeing(xsize nIndex) template void XObjArrayNC::RemoveAtIndex(int nIndex) { - #if defined(__XTOOLS_INT_CHECK__) + #if defined(__XTOOLS_CHECK_OVERFLOW__) if ( nIndex < 0 ) { DebugLog(2, "XArray::RemoveAtIndex(int nIndex) : BUG nIndex (%d) is < 0. System halted\n", nIndex); panic(); diff --git a/rEFIt_UEFI/cpp_foundation/XString.cpp b/rEFIt_UEFI/cpp_foundation/XString.cpp index e786c88f7..285d1ae8d 100755 --- a/rEFIt_UEFI/cpp_foundation/XString.cpp +++ b/rEFIt_UEFI/cpp_foundation/XString.cpp @@ -15,7 +15,6 @@ #define DBG(...) #endif -#include "XToolsCommon.h" #include "XString.h" #include "../../Include/Library/printf_lite.h" diff --git a/rEFIt_UEFI/cpp_foundation/XString.h b/rEFIt_UEFI/cpp_foundation/XString.h index a93bdcc1f..b557c6f5f 100755 --- a/rEFIt_UEFI/cpp_foundation/XString.h +++ b/rEFIt_UEFI/cpp_foundation/XString.h @@ -12,7 +12,7 @@ #if !defined(__XString_H__) #define __XString_H__ -#include "XToolsCommon.h" +#include #include "XStringAbstract.h" #include "../../Include/Library/printf_lite.h" diff --git a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h index 98e644f7a..50465c551 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h +++ b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h @@ -9,7 +9,7 @@ #if !defined(__XSTRINGABSTRACT_H__) #define __XSTRINGABSTRACT_H__ -#include "XToolsCommon.h" +#include #include "unicode_conversions.h" #ifndef DEBUG_ALL @@ -252,7 +252,7 @@ protected: CheckSize(aSize, 0); } public: - T *CheckSize(size_t nNewSize, size_t nGrowBy = 16) // nNewSize is in number of chars, NOT bytes + T *CheckSize(size_t nNewSize, size_t nGrowBy = XStringGrowByDefault) // nNewSize is in number of chars, NOT bytes { //DBG_XSTRING("CheckSize: m_size=%d, nNewSize=%d\n", m_size, nNewSize); @@ -260,10 +260,9 @@ public: { nNewSize += nGrowBy; if ( m_allocatedSize == 0 ) m_data = (T*)malloc( (nNewSize+1)*sizeof(T) ); - else m_data = (T*)realloc(m_data, (nNewSize+1)*sizeof(T), (m_allocatedSize+1)*sizeof(T)); + else m_data = (T*)Xrealloc(m_data, (nNewSize+1)*sizeof(T), (m_allocatedSize+1)*sizeof(T)); if ( !m_data ) { - DebugLog(2, "XStringAbstract::CheckSize(%zu, %zu) : realloc(%" PRIuPTR ", %lu, %zd) returned NULL. System halted\n", nNewSize, nGrowBy, uintptr_t(m_data), nNewSize*sizeof(T), m_allocatedSize*sizeof(T)); - panic(); + panic("XStringAbstract::CheckSize(%zu, %zu) : Xrealloc(%" PRIuPTR ", %lu, %zd) returned NULL. System halted\n", nNewSize, nGrowBy, uintptr_t(m_data), nNewSize*sizeof(T), m_allocatedSize*sizeof(T)); } m_allocatedSize = nNewSize; m_data[m_allocatedSize] = 0; // we allocated one more char (nNewSize+1). This \0 is an extra precaution. It's not for the normal null terminator. All string operation must considered that only m_allocatedSize bytes were allocated. diff --git a/rEFIt_UEFI/cpp_foundation/XStringArray.cpp b/rEFIt_UEFI/cpp_foundation/XStringArray.cpp index ada2a7d01..f3f16a31c 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringArray.cpp +++ b/rEFIt_UEFI/cpp_foundation/XStringArray.cpp @@ -4,7 +4,6 @@ // //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -#include "XToolsCommon.h" #include "XStringArray.h" diff --git a/rEFIt_UEFI/cpp_foundation/XStringArray.h b/rEFIt_UEFI/cpp_foundation/XStringArray.h index c1762bec3..b61dc7b02 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringArray.h +++ b/rEFIt_UEFI/cpp_foundation/XStringArray.h @@ -9,7 +9,7 @@ #if !defined(__XSTRINGARRAY_H__) #define __XSTRINGARRAY_H__ -#include "XToolsCommon.h" +#include #include "XStringWArray.h" #include "XString.h" diff --git a/rEFIt_UEFI/cpp_foundation/XStringWArray.cpp b/rEFIt_UEFI/cpp_foundation/XStringWArray.cpp index 60d359e87..dfb6c8dd5 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringWArray.cpp +++ b/rEFIt_UEFI/cpp_foundation/XStringWArray.cpp @@ -7,7 +7,6 @@ #if !defined(__XSTRINGWS_CPP__) #define __XSTRINGWS_CPP__ -#include "XToolsCommon.h" #include "XStringWArray.h" diff --git a/rEFIt_UEFI/cpp_foundation/XStringWArray.h b/rEFIt_UEFI/cpp_foundation/XStringWArray.h index 3dab104b8..2216c8900 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringWArray.h +++ b/rEFIt_UEFI/cpp_foundation/XStringWArray.h @@ -9,7 +9,7 @@ #if !defined(__XSTRINGWARRAY_H__) #define __XSTRINGWARRAY_H__ -#include "XToolsCommon.h" +#include #include "XObjArray.h" #include "XString.h" diff --git a/rEFIt_UEFI/cpp_foundation/XToolsCommon.cpp b/rEFIt_UEFI/cpp_foundation/XToolsCommon.cpp deleted file mode 100644 index 1fbe58145..000000000 --- a/rEFIt_UEFI/cpp_foundation/XToolsCommon.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "XToolsCommon.h" - -xsize XArrayGrowByDefault; diff --git a/rEFIt_UEFI/cpp_unit_test/XString_test.cpp b/rEFIt_UEFI/cpp_unit_test/XString_test.cpp index c955b05fc..ec82b3719 100755 --- a/rEFIt_UEFI/cpp_unit_test/XString_test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/XString_test.cpp @@ -90,7 +90,7 @@ public: SimpleString& operator =(const SimpleString& simpleString) { size_t newSize = strlen(simpleString.data)+1; - data = (char*)realloc(data, newSize+1, allocatedSize); + data = (char*)Xrealloc(data, newSize+1, allocatedSize); allocatedSize = newSize+1; strncpy(data, simpleString.data, allocatedSize); return *this; @@ -103,7 +103,7 @@ public: VA_LIST va2; VA_COPY(va2, va); size_t size = (size_t)vsnprintf(NULL, 0, format, va); - data = (char*)realloc(data, size+1, allocatedSize); + data = (char*)Xrealloc(data, size+1, allocatedSize); allocatedSize = size+1; data[size] = 0; vsnprintf(data, allocatedSize, format, va2); diff --git a/rEFIt_UEFI/gui/shared_with_menu.cpp b/rEFIt_UEFI/gui/shared_with_menu.cpp index 501eb0ddd..a5d1751c3 100644 --- a/rEFIt_UEFI/gui/shared_with_menu.cpp +++ b/rEFIt_UEFI/gui/shared_with_menu.cpp @@ -39,10 +39,10 @@ * THIS will most likely disappear soon ! */ -#include "../Platform/Platform.h" -#include "../refit/lib.h" -#include "menu_items/menu_items.h" -#include "../entry_scan/common.h" +#include +//#include "../refit/lib.h" +//#include "menu_items/menu_items.h" +//#include "../entry_scan/common.h" CONST XString ArgOptional[NUM_OPT] = { "arch=i386"_XS, //0 diff --git a/rEFIt_UEFI/include/XToolsConf.h b/rEFIt_UEFI/include/XToolsConf.h new file mode 100755 index 000000000..ae41d4e7e --- /dev/null +++ b/rEFIt_UEFI/include/XToolsConf.h @@ -0,0 +1,25 @@ +#ifndef __XTOOLSCOMMON_H__ +#define __XTOOLSCOMMON_H__ + +#include + + +#define xsize size_t +//#define xisize INTN +#define MAX_XSIZE SIZE_T_MAX +//#define MAX_XISIZE MAX_INTN + +#define XStringGrowByDefault 10 +#define XArrayGrowByDefault 8 +//extern xsize XBufferGrowByDefault; + +/* For convience, operator [] is define with int parameter. + * Defining __XTOOLS_CHECK_OVERFLOW__ make a check that the parameter is >= 0 + * TODO : make new XString using __XTOOLS_CHECK_OVERFLOW__ + */ +#define __XTOOLS_CHECK_OVERFLOW__ + +#define Xrealloc(ptr, newsize, oldsize) realloc(ptr, newsize, oldsize) + + +#endif diff --git a/rEFIt_UEFI/libeg/XCinema.h b/rEFIt_UEFI/libeg/XCinema.h index aa0319b53..3ac586614 100644 --- a/rEFIt_UEFI/libeg/XCinema.h +++ b/rEFIt_UEFI/libeg/XCinema.h @@ -12,7 +12,6 @@ extern "C" { #include } -#include "../cpp_foundation/XToolsCommon.h" #include "../cpp_foundation/XArray.h" #include "../cpp_foundation/XString.h" #include "../libeg/libeg.h" diff --git a/rEFIt_UEFI/libeg/XImage.h b/rEFIt_UEFI/libeg/XImage.h index c880906e0..32d3fe89f 100644 --- a/rEFIt_UEFI/libeg/XImage.h +++ b/rEFIt_UEFI/libeg/XImage.h @@ -11,7 +11,6 @@ This class will replace EG_IMAGE structure and methods extern "C" { #include } -#include "../cpp_foundation/XToolsCommon.h" #include "../cpp_foundation/XArray.h" #include "../cpp_foundation/XString.h" #include "../libeg/libeg.h" diff --git a/rEFIt_UEFI/libeg/XTheme.h b/rEFIt_UEFI/libeg/XTheme.h index 7751d0196..83976e9c7 100644 --- a/rEFIt_UEFI/libeg/XTheme.h +++ b/rEFIt_UEFI/libeg/XTheme.h @@ -1,7 +1,6 @@ #if !defined(__XTHEME_H__) #define __XTHEME_H__ -#include "../cpp_foundation/XToolsCommon.h" #include "../cpp_foundation/XObjArray.h" #include "../cpp_foundation/XString.h" #include "libeg.h" diff --git a/rEFIt_UEFI/libeg/lodepng.cpp b/rEFIt_UEFI/libeg/lodepng.cpp index cd9b4b198..fa5d9232b 100755 --- a/rEFIt_UEFI/libeg/lodepng.cpp +++ b/rEFIt_UEFI/libeg/lodepng.cpp @@ -34,7 +34,7 @@ Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for #include "libegint.h" #include "lodepng.h" -#include "../cpp_util/panic.h" +//#include "../cpp_util/panic.h" #ifdef LODEPNG_COMPILE_DISK #include /* LONG_MAX */ diff --git a/rEFIt_UEFI/libeg/lodepng.h b/rEFIt_UEFI/libeg/lodepng.h index fa2ab783d..e1fa84620 100644 --- a/rEFIt_UEFI/libeg/lodepng.h +++ b/rEFIt_UEFI/libeg/lodepng.h @@ -28,7 +28,6 @@ freely, subject to the following restrictions: //MODSNI v #include -#include "../cpp_foundation/XToolsCommon.h" #include "../cpp_foundation/XArray.h"