From d52803e7cd7481346b0c6a28f328aa5243e9658d Mon Sep 17 00:00:00 2001 From: jief666 Date: Wed, 5 May 2021 20:10:10 +0300 Subject: [PATCH] DO NOT explicitly call default ctor with new because of clang bug. --- rEFIt_UEFI/Platform/FixBiosDsdt.cpp | 6 +++--- rEFIt_UEFI/Platform/Settings.h | 10 +++++----- rEFIt_UEFI/Platform/SettingsUtils.h | 4 ++-- rEFIt_UEFI/Platform/StartupSound.cpp | 2 +- rEFIt_UEFI/Platform/kext_inject.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagArray.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagBool.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagData.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagDate.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagDict.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagFloat.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagInt64.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagKey.cpp | 2 +- rEFIt_UEFI/Platform/plist/TagString8.cpp | 2 +- rEFIt_UEFI/Platform/plist/plist.cpp | 2 +- .../ConfigPlist/Config_Devices_Properties.h | 2 +- rEFIt_UEFI/cpp_foundation/shared_ptr.h | 2 +- rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h | 2 +- rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h | 2 +- rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp | 5 +++++ rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h | 2 +- rEFIt_UEFI/entry_scan/legacy.cpp | 6 +++--- rEFIt_UEFI/entry_scan/loader.cpp | 2 +- rEFIt_UEFI/entry_scan/securemenu.cpp | 4 ++-- rEFIt_UEFI/entry_scan/tool.cpp | 4 ++-- rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp | 4 ++-- rEFIt_UEFI/gui/menu_items/menu_items.cpp | 4 ++-- rEFIt_UEFI/include/Pci.h | 17 +++++++++-------- rEFIt_UEFI/libeg/VectorGraphics.cpp | 2 +- rEFIt_UEFI/libeg/XTheme.cpp | 2 +- rEFIt_UEFI/refit/menu.cpp | 6 +++--- 31 files changed, 58 insertions(+), 52 deletions(-) diff --git a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp index da4de8ed3..63e0ccf73 100755 --- a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp +++ b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp @@ -2144,7 +2144,7 @@ UINT32 FixRTC (UINT8 *dsdt, UINT32 len) break; } if ((dsdt[i+1] == 0x5B) && (dsdt[i+2] == 0x82)) { - break; //end of RTC device and begin of new Device() + break; //end of RTC device and begin of new Device } } @@ -2251,7 +2251,7 @@ UINT32 FixTMR (UINT8 *dsdt, UINT32 len) } // offset if if ((dsdt[i+1] == 0x5B) && (dsdt[i+2] == 0x82)) { - break; //end of TMR device and begin of new Device() + break; //end of TMR device and begin of new Device } } // i loop @@ -2336,7 +2336,7 @@ UINT32 FixPIC (UINT8 *dsdt, UINT32 len) sizeoffset = 0; } // sizeoffset if if ((dsdt[i+1] == 0x5B) && (dsdt[i+2] == 0x82)) { - break; //end of PIC device and begin of new Device() + break; //end of PIC device and begin of new Device } } // i loop diff --git a/rEFIt_UEFI/Platform/Settings.h b/rEFIt_UEFI/Platform/Settings.h index 064ca2186..4fb038961 100644 --- a/rEFIt_UEFI/Platform/Settings.h +++ b/rEFIt_UEFI/Platform/Settings.h @@ -1029,7 +1029,7 @@ public: for ( idx = 0 ; idx < configPlist.size() ; ++idx ) { if ( idx < size() ) ElementAt(idx).takeValueFrom(configPlist.getAtIndex(idx)); else { - ACPI_RENAME_DEVICE* s = new ACPI_RENAME_DEVICE(); + ACPI_RENAME_DEVICE* s = new ACPI_RENAME_DEVICE; s->takeValueFrom(configPlist.getAtIndex(idx)); AddReference(s, true); } @@ -1048,7 +1048,7 @@ public: // for ( idx = 0 ; idx < configPlist.size() ; ++idx ) { // if ( idx < size() ) ElementAt(idx).takeValueFrom(configPlist[idx]); // else { -// ACPIDropTablesClass* s = new ACPIDropTablesClass(); +// ACPIDropTablesClass* s = new ACPIDropTablesClass; // s->takeValueFrom(configPlist[idx]); // AddReference(s, true); // } @@ -1994,7 +1994,7 @@ printf("%s", ""); const ArbitraryPropertyClass& newArb = ArbitraryArray[idx]; for ( size_t jdx = newArb.CustomPropertyArray.size() ; jdx-- > 0 ; ) { const SimplePropertyClass& newArbProp = newArb.CustomPropertyArray[jdx]; - DEV_PROPERTY* newProp = new DEV_PROPERTY(); + DEV_PROPERTY* newProp = new DEV_PROPERTY; newProp->Device = newArb.Device; newProp->Key = const_cast(newArbProp.Key.c_str()); // const_cast !!! So ugly. It is just because it's temporary. If ArbProperties is modified after this, a lot a memory problem will happen. I could have done some strdup, but that way I don't use memory and don't have to free it. newProp->Value = const_cast(newArbProp.Value.data()); @@ -2009,7 +2009,7 @@ printf("%s", ""); // Non arb : device = 0 for ( size_t idx = Properties.PropertyArray.size() ; idx-- > 0 ; ) { const PropertiesClass::PropertyClass& Prop = Properties.PropertyArray[idx]; - DEV_PROPERTY* newProp = new DEV_PROPERTY(); + DEV_PROPERTY* newProp = new DEV_PROPERTY; newProp->Device = 0; newProp->Key = 0; if ( Prop.Enabled ) newProp->Label = XString8(Prop.DevicePathAsString).forgetDataWithoutFreeing(); @@ -2017,7 +2017,7 @@ printf("%s", ""); newProp->Child = NULL; for ( size_t jdx = Properties.PropertyArray[idx].propertiesArray.size() ; jdx-- > 0 ; ) { const SimplePropertyClass& SubProp = Prop.propertiesArray[jdx]; - DEV_PROPERTY* newSubProp = new DEV_PROPERTY(); + DEV_PROPERTY* newSubProp = new DEV_PROPERTY; newSubProp->Device = 0; newSubProp->Key = const_cast(SubProp.Key.c_str()); // newSubProp->Key = NULL; diff --git a/rEFIt_UEFI/Platform/SettingsUtils.h b/rEFIt_UEFI/Platform/SettingsUtils.h index 58276c35b..997605f67 100644 --- a/rEFIt_UEFI/Platform/SettingsUtils.h +++ b/rEFIt_UEFI/Platform/SettingsUtils.h @@ -27,7 +27,7 @@ class XObjArrayWithTakeValueFromXmlArray: public XObjArray for ( idx = 0 ; idx < xmlArray.size() ; ++idx ) { if ( idx < super::size() ) super::ElementAt(idx).takeValueFrom(xmlArray[idx]); else { - SettingsClass* s = new SettingsClass(); + SettingsClass* s = new SettingsClass; s->takeValueFrom(xmlArray[idx]); super::AddReference(s, true); } @@ -51,7 +51,7 @@ class XObjArrayWithTakeValueFromXmlRepeatingDict: public XObjArraytakeValueFrom(xmlRepeatingDict.valueArray()[idx]); super::AddReference(s, true); } diff --git a/rEFIt_UEFI/Platform/StartupSound.cpp b/rEFIt_UEFI/Platform/StartupSound.cpp index 2310f5f8b..983e41ce4 100644 --- a/rEFIt_UEFI/Platform/StartupSound.cpp +++ b/rEFIt_UEFI/Platform/StartupSound.cpp @@ -449,7 +449,7 @@ void GetOutputs() } HdaCodecDev = AudioIoPrivateData->HdaCodecDev; for (i = 0; i < OutputPortsCount; i++) { - HDA_OUTPUTS* hdaOutputPtr = new HDA_OUTPUTS(); + HDA_OUTPUTS* hdaOutputPtr = new HDA_OUTPUTS; HDA_OUTPUTS& hdaOutput = *hdaOutputPtr; // HdaCodecDev->OutputPorts[i]; hdaOutput.Name.takeValueFrom(HdaCodecDev->Name); diff --git a/rEFIt_UEFI/Platform/kext_inject.cpp b/rEFIt_UEFI/Platform/kext_inject.cpp index b8f39dd72..d7279ce69 100644 --- a/rEFIt_UEFI/Platform/kext_inject.cpp +++ b/rEFIt_UEFI/Platform/kext_inject.cpp @@ -298,7 +298,7 @@ EFI_STATUS LOADER_ENTRY::AddKext(const EFI_FILE *RootDir, const XString8& FileNa EFI_STATUS Status; KEXT_ENTRY *KextEntry; - KextEntry = new KEXT_ENTRY(); + KextEntry = new KEXT_ENTRY; KextEntry->Signature = KEXT_SIGNATURE; Status = LoadKext(RootDir, FileName, archCpuType, &KextEntry->kext); if(EFI_ERROR(Status)) { diff --git a/rEFIt_UEFI/Platform/plist/TagArray.cpp b/rEFIt_UEFI/Platform/plist/TagArray.cpp index 52af42fb5..0669774c6 100755 --- a/rEFIt_UEFI/Platform/plist/TagArray.cpp +++ b/rEFIt_UEFI/Platform/plist/TagArray.cpp @@ -92,7 +92,7 @@ TagArray* TagArray::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagArray(); + tag = new TagArray; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/TagBool.cpp b/rEFIt_UEFI/Platform/plist/TagBool.cpp index 22ac44b95..4aa558af5 100755 --- a/rEFIt_UEFI/Platform/plist/TagBool.cpp +++ b/rEFIt_UEFI/Platform/plist/TagBool.cpp @@ -59,7 +59,7 @@ TagBool* TagBool::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagBool(); + tag = new TagBool; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/TagData.cpp b/rEFIt_UEFI/Platform/plist/TagData.cpp index 074014771..18a3e6eb8 100755 --- a/rEFIt_UEFI/Platform/plist/TagData.cpp +++ b/rEFIt_UEFI/Platform/plist/TagData.cpp @@ -61,7 +61,7 @@ TagData* TagData::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagData(); + tag = new TagData; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/TagDate.cpp b/rEFIt_UEFI/Platform/plist/TagDate.cpp index dc81bf164..35c632b94 100755 --- a/rEFIt_UEFI/Platform/plist/TagDate.cpp +++ b/rEFIt_UEFI/Platform/plist/TagDate.cpp @@ -60,7 +60,7 @@ TagDate* TagDate::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagDate(); + tag = new TagDate; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/TagDict.cpp b/rEFIt_UEFI/Platform/plist/TagDict.cpp index 507bd103b..72fad6c32 100755 --- a/rEFIt_UEFI/Platform/plist/TagDict.cpp +++ b/rEFIt_UEFI/Platform/plist/TagDict.cpp @@ -59,7 +59,7 @@ TagDict* TagDict::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagDict(); + tag = new TagDict; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/TagFloat.cpp b/rEFIt_UEFI/Platform/plist/TagFloat.cpp index 6302a35a4..10b9727ed 100755 --- a/rEFIt_UEFI/Platform/plist/TagFloat.cpp +++ b/rEFIt_UEFI/Platform/plist/TagFloat.cpp @@ -61,7 +61,7 @@ TagFloat* TagFloat::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagFloat(); + tag = new TagFloat; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/TagInt64.cpp b/rEFIt_UEFI/Platform/plist/TagInt64.cpp index 1871d8543..d2907e14b 100755 --- a/rEFIt_UEFI/Platform/plist/TagInt64.cpp +++ b/rEFIt_UEFI/Platform/plist/TagInt64.cpp @@ -61,7 +61,7 @@ TagInt64* TagInt64::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagInt64(); + tag = new TagInt64; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/TagKey.cpp b/rEFIt_UEFI/Platform/plist/TagKey.cpp index 806b8e682..563b62db1 100755 --- a/rEFIt_UEFI/Platform/plist/TagKey.cpp +++ b/rEFIt_UEFI/Platform/plist/TagKey.cpp @@ -61,7 +61,7 @@ TagKey* TagKey::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagKey(); + tag = new TagKey; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/TagString8.cpp b/rEFIt_UEFI/Platform/plist/TagString8.cpp index 0af7f04ab..eeb72bbeb 100755 --- a/rEFIt_UEFI/Platform/plist/TagString8.cpp +++ b/rEFIt_UEFI/Platform/plist/TagString8.cpp @@ -60,7 +60,7 @@ TagString* TagString::getEmptyTag() //DBG("tagcachehit=%lld\n", tagcachehit); return tag; } - tag = new TagString(); + tag = new TagString; //newtagcount += 1; //DBG("newtagcount=%lld\n", newtagcount); return tag; diff --git a/rEFIt_UEFI/Platform/plist/plist.cpp b/rEFIt_UEFI/Platform/plist/plist.cpp index d23e96d9a..c0ba880ac 100755 --- a/rEFIt_UEFI/Platform/plist/plist.cpp +++ b/rEFIt_UEFI/Platform/plist/plist.cpp @@ -89,7 +89,7 @@ EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CONST CHAR8* tag,UINT32* lenPtr); ////DBG("tagcachehit=%lld\n", tagcachehit); // return tag; // } -// tag = new TagStruct(); +// tag = new TagStruct; ////newtagcount += 1; ////DBG("newtagcount=%lld\n", newtagcount); // return tag; diff --git a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Properties.h b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Properties.h index b0d607f26..b1e723a9f 100644 --- a/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Properties.h +++ b/rEFIt_UEFI/Settings/ConfigPlist/Config_Devices_Properties.h @@ -28,7 +28,7 @@ class PropertiesUnion: public XmlUnion // XmlCompositeField m_fields[1] = { xmlValue }; // virtual void getFields(XmlCompositeField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); }; - Property() : parent(*new Properties4DeviceClass()) { panic("BUG. define getNewInstance()"); } + Property() : parent(*new Properties4DeviceClass) { panic("BUG. define getNewInstance()"); } Property(const Properties4DeviceClass& _parent) : parent(_parent) {} uint8_t dgetBValue() const { diff --git a/rEFIt_UEFI/cpp_foundation/shared_ptr.h b/rEFIt_UEFI/cpp_foundation/shared_ptr.h index d25808766..516338665 100644 --- a/rEFIt_UEFI/cpp_foundation/shared_ptr.h +++ b/rEFIt_UEFI/cpp_foundation/shared_ptr.h @@ -75,7 +75,7 @@ public: explicit Shared_ptr(T* ptr = nullptr) { m_ptr = ptr; - m_counter = new Counter(); + m_counter = new Counter; if (ptr) { ++(*m_counter); } diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h b/rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h index 8eedac432..9d32f027e 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteArrayTypes.h @@ -69,7 +69,7 @@ bool XmlArray::parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlSubPath.S8Catf("[%zu]", n); XmlParserPosition beforePos = xmlLiteParser->getPosition(); - T* newT = new T(); + T* newT = new T; if ( newT->parseFromXmlLite(xmlLiteParser, xmlSubPath, generateErrors) ) { super2::AddReference(newT, true); }else{ diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h b/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h index 4108edeec..a6843824b 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteDictTypes.h @@ -97,7 +97,7 @@ public: virtual const char* getDescription() override { return "dict"; }; virtual void reset() override { super::reset(); m_valueArray.setEmpty(); }; - virtual XmlValueType* getNewInstance() { return new XmlValueType(); } + virtual XmlValueType* getNewInstance() { return new XmlValueType; } const ValueArrayType& valueArray() const { if ( !isDefined() ) panic("%s : value is not defined", __PRETTY_FUNCTION__); return m_valueArray; } diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp b/rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp index a466569be..3d4019bb4 100755 --- a/rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp +++ b/rEFIt_UEFI/cpp_lib/XmlLiteParser.cpp @@ -448,6 +448,11 @@ bool XmlLiteParser::getKeyTagValue(const char** value, size_t* valueLength, XmlP currentPos = *xmlParserPosition; return false; } +#ifdef DEBUG_TRACE +printf("XmlLiteParser::getKeyTagValue key=%.*s, line=%d, buffer=", (int)*valueLength, *value, (*xmlParserPosition).getLine()); +for(size_t i=0 ; i<40 ; i++) printf("%c", (*xmlParserPosition).p[i] < 32 ? 0 : (*xmlParserPosition).p[i]); +printf("\n"); +#endif // I think the following cannot happen anymore... if ( !strnIsEqualIC(tag, tagLength, "key") ) { addXmlError(generateErrors, S8Printf("Expecting a at line %d col %d", (*xmlParserPosition).line, (*xmlParserPosition).col)); diff --git a/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h b/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h index 7c0438dba..c43ea8623 100644 --- a/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h +++ b/rEFIt_UEFI/cpp_lib/XmlLiteSimpleTypes.h @@ -270,7 +270,7 @@ class XmlKeyDisablable : public XmlKey protected: bool Disabled = false; public: - XmlKeyDisablable() : super() {}; + XmlKeyDisablable() {}; ~XmlKeyDisablable() {}; virtual void reset() override { super::reset(); Disabled = false; }; diff --git a/rEFIt_UEFI/entry_scan/legacy.cpp b/rEFIt_UEFI/entry_scan/legacy.cpp index 110b03834..6a97ffa2c 100755 --- a/rEFIt_UEFI/entry_scan/legacy.cpp +++ b/rEFIt_UEFI/entry_scan/legacy.cpp @@ -109,7 +109,7 @@ DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str()); //DBG("VolDesc=%ls\n", VolDesc); // prepare the menu entry - Entry = new LEGACY_ENTRY(); + Entry = new LEGACY_ENTRY; if ( FullTitle.notEmpty() ) { Entry->Title = FullTitle; } else { @@ -181,7 +181,7 @@ DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str()); } // create the submenu - SubScreen = new REFIT_MENU_SCREEN(); + SubScreen = new REFIT_MENU_SCREEN; // SubScreen->Title = L"Boot Options for "_XSW + LoaderTitle + L" on "_XSW + VolDesc; SubScreen->Title.SWPrintf("Boot Options for %ls on %ls", LoaderTitle.wc_str(), VolDesc.wc_str()); @@ -189,7 +189,7 @@ DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str()); SubScreen->ID = SCREEN_BOOT; SubScreen->GetAnime(); // default entry - SubEntry = new LEGACY_ENTRY(); + SubEntry = new LEGACY_ENTRY; SubEntry->Title = L"Boot "_XSW + LoaderTitle; // SubEntry->Tag = TAG_LEGACY; SubEntry->Volume = Entry->Volume; diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 54dd3737a..187a1eb63 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -931,7 +931,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST XStringW& LoaderPath, // DBG("OSType =%d\n", OSType); // DBG("prepare the menu entry\n"); // prepare the menu entry - Entry = new LOADER_ENTRY(); + Entry = new LOADER_ENTRY; if (!CustomEntry) { // Ignore this loader if it's device path is already present in another loader diff --git a/rEFIt_UEFI/entry_scan/securemenu.cpp b/rEFIt_UEFI/entry_scan/securemenu.cpp index 6b0a6bbb1..bcc969124 100644 --- a/rEFIt_UEFI/entry_scan/securemenu.cpp +++ b/rEFIt_UEFI/entry_scan/securemenu.cpp @@ -75,13 +75,13 @@ void AddSecureBootTool(void) } //panic("not done yet"); // if (gSettings.Boot.SecureBoot) { -// Entry = new REFIT_MENU_ENTRY_SECURE_BOOT(); +// Entry = new REFIT_MENU_ENTRY_SECURE_BOOT; // Entry->Title.SWPrintf("Clover Secure Boot Configuration"); //// Entry->Tag = TAG_SECURE_BOOT_CONFIG; // Entry->Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_SECURE_BOOT_CONFIG); // // } else { -// Entry = new REFIT_MENU_ENTRY_SECURE_BOOT_CONFIG(); +// Entry = new REFIT_MENU_ENTRY_SECURE_BOOT_CONFIG; // Entry->Title.SWPrintf("Enable Clover Secure Boot"); //// Entry->Tag = TAG_SECURE_BOOT; // Entry->Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_SECURE_BOOT); diff --git a/rEFIt_UEFI/entry_scan/tool.cpp b/rEFIt_UEFI/entry_scan/tool.cpp index 3512a6094..b591ff97d 100644 --- a/rEFIt_UEFI/entry_scan/tool.cpp +++ b/rEFIt_UEFI/entry_scan/tool.cpp @@ -90,7 +90,7 @@ STATIC BOOLEAN AddToolEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *Full return FALSE; } // Allocate the entry - Entry = new REFIT_MENU_ENTRY_LOADER_TOOL(); + Entry = new REFIT_MENU_ENTRY_LOADER_TOOL; if (FullTitle) { Entry->Title.takeValueFrom(FullTitle); @@ -124,7 +124,7 @@ STATIC void AddCloverEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *Loade // EFI_STATUS Status; // prepare the menu entry - Entry = new REFIT_MENU_ENTRY_CLOVER(); + Entry = new REFIT_MENU_ENTRY_CLOVER; Entry->Title.takeValueFrom(LoaderTitle); // Entry->Tag = TAG_CLOVER; Entry->Row = 1; diff --git a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp index 71302a2ee..9b5469fe3 100644 --- a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp +++ b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp @@ -387,7 +387,7 @@ void REFIT_MENU_SCREEN::HidePointer() EFI_STATUS REFIT_MENU_SCREEN::MouseBirth() { - //if ( !mPointer ) mPointer = new XPointer(); + //if ( !mPointer ) mPointer = new XPointer; return mPointer.MouseBirth(); } @@ -398,7 +398,7 @@ void REFIT_MENU_SCREEN::KillMouse() void REFIT_MENU_SCREEN::AddMenuInfoLine_f(CONST char *format, ...) { - XStringW* s = new XStringW(); + XStringW* s = new XStringW; VA_LIST va; VA_START(va, format); s->vSWPrintf(format, va); diff --git a/rEFIt_UEFI/gui/menu_items/menu_items.cpp b/rEFIt_UEFI/gui/menu_items/menu_items.cpp index 5c619fbfb..a7a244779 100644 --- a/rEFIt_UEFI/gui/menu_items/menu_items.cpp +++ b/rEFIt_UEFI/gui/menu_items/menu_items.cpp @@ -47,7 +47,7 @@ REFIT_MENU_ENTRY_CLOVER* REFIT_MENU_ENTRY_CLOVER::getPartiallyDuplicatedEntry() const { - REFIT_MENU_ENTRY_CLOVER* DuplicateEntry = new REFIT_MENU_ENTRY_CLOVER(); + REFIT_MENU_ENTRY_CLOVER* DuplicateEntry = new REFIT_MENU_ENTRY_CLOVER; DuplicateEntry->AtClick = ActionEnter; DuplicateEntry->Volume = Volume; @@ -62,7 +62,7 @@ REFIT_MENU_ENTRY_CLOVER* REFIT_MENU_ENTRY_CLOVER::getPartiallyDuplicatedEntry() LOADER_ENTRY* LOADER_ENTRY::getPartiallyDuplicatedEntry() const { - LOADER_ENTRY* DuplicateEntry = new LOADER_ENTRY(); + LOADER_ENTRY* DuplicateEntry = new LOADER_ENTRY; DuplicateEntry->AtClick = ActionEnter; DuplicateEntry->Volume = Volume; diff --git a/rEFIt_UEFI/include/Pci.h b/rEFIt_UEFI/include/Pci.h index 7130b233f..de644771d 100644 --- a/rEFIt_UEFI/include/Pci.h +++ b/rEFIt_UEFI/include/Pci.h @@ -8,6 +8,7 @@ #ifndef INCLUDE_PCI_H_ #define INCLUDE_PCI_H_ +#include /* PCI */ #define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ @@ -24,18 +25,18 @@ typedef struct { - UINT32 :2; - UINT32 reg :6; - UINT32 func:3; - UINT32 dev :5; - UINT32 bus :8; - UINT32 :7; - UINT32 eb :1; + uint32_t :2; + uint32_t reg :6; + uint32_t func:3; + uint32_t dev :5; + uint32_t bus :8; + uint32_t :7; + uint32_t eb :1; } pci_addr_t; typedef union { pci_addr_t bits; - UINT32 addr; + uint32_t addr; } pci_dev_t; typedef struct pci_dt_t { diff --git a/rEFIt_UEFI/libeg/VectorGraphics.cpp b/rEFIt_UEFI/libeg/VectorGraphics.cpp index cf1a83b70..49affbdd8 100755 --- a/rEFIt_UEFI/libeg/VectorGraphics.cpp +++ b/rEFIt_UEFI/libeg/VectorGraphics.cpp @@ -356,7 +356,7 @@ EFI_STATUS XTheme::ParseSVGXTheme(CONST CHAR8* buffer) if (Dict != NULL) { INTN Count = Get_TagCount (Dict); for (INTN i = 0; i < Count; i++) { - FILM *NewFilm = new FILM(); + FILM *NewFilm = new FILM; if (EFI_ERROR(GetElement(Dict, i, &Dict3))) { continue; } diff --git a/rEFIt_UEFI/libeg/XTheme.cpp b/rEFIt_UEFI/libeg/XTheme.cpp index c7554040f..32ba585fa 100644 --- a/rEFIt_UEFI/libeg/XTheme.cpp +++ b/rEFIt_UEFI/libeg/XTheme.cpp @@ -680,7 +680,7 @@ XTheme::GetThemeTagSettings(const TagDict* DictPointer) } Dict3 = AnimeArray->dictElementAt(i, "Anime"_XS8); - FILM *NewFilm = new FILM(); + FILM *NewFilm = new FILM; Prop = Dict3->propertyForKey("ID"); NewFilm->SetIndex((UINTN)GetPropertyAsInteger(Prop, 1)); //default=main screen diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index 0f3cb35fd..3e0d9ab01 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -1531,7 +1531,7 @@ REFIT_ABSTRACT_MENU_ENTRY* NewEntry_(REFIT_ABSTRACT_MENU_ENTRY *Entry, REFIT_MEN Entry->Image = OptionMenu.TitleImage; Entry->AtClick = AtClick; // create the submenu - *SubScreen = new REFIT_MENU_SCREEN(); + *SubScreen = new REFIT_MENU_SCREEN; (*SubScreen)->Title = Entry->Title; (*SubScreen)->TitleImage = Entry->Image; (*SubScreen)->ID = ID; @@ -1542,7 +1542,7 @@ REFIT_ABSTRACT_MENU_ENTRY* NewEntry_(REFIT_ABSTRACT_MENU_ENTRY *Entry, REFIT_MEN REFIT_MENU_ITEM_OPTIONS* newREFIT_MENU_ITEM_OPTIONS(REFIT_MENU_SCREEN **SubScreen, ACTION AtClick, UINTN ID, const XString8& Title) { - REFIT_MENU_ITEM_OPTIONS* Entry = new REFIT_MENU_ITEM_OPTIONS(); + REFIT_MENU_ITEM_OPTIONS* Entry = new REFIT_MENU_ITEM_OPTIONS; return NewEntry_(Entry, SubScreen, AtClick, ID, Title)->getREFIT_MENU_ITEM_OPTIONS(); } @@ -1797,7 +1797,7 @@ LOADER_ENTRY* LOADER_ENTRY::SubMenuKextInjectMgmt() LOADER_ENTRY *SubEntry; REFIT_MENU_SCREEN *SubSubScreen; - SubEntry = new LOADER_ENTRY(); + SubEntry = new LOADER_ENTRY; NewEntry_(SubEntry, &SubSubScreen, ActionEnter, SCREEN_SYSTEM, "Block injected kexts->"_XS8); SubEntry->Flags = Flags; if (macOSVersion.notEmpty()) {