mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-21 20:29:17 +01:00
Update PluginInformation to return std::optional instead of raw pointer
This commit is contained in:
parent
cc5acd0980
commit
36e99e95a2
@ -78,11 +78,11 @@ public:
|
||||
return mSectionInfoList;
|
||||
}
|
||||
|
||||
[[nodiscard]] SectionInfo *getSectionInfo(const std::string §ionName) const {
|
||||
[[nodiscard]] std::optional<SectionInfo> getSectionInfo(const std::string §ionName) const {
|
||||
if (getSectionInfoList().contains(sectionName)) {
|
||||
return mSectionInfoList.at(sectionName).get();
|
||||
return *mSectionInfoList.at(sectionName);
|
||||
}
|
||||
return nullptr;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void setTrampolineId(uint8_t trampolineId) {
|
||||
@ -93,7 +93,7 @@ public:
|
||||
return mTrampolineId;
|
||||
}
|
||||
|
||||
[[nodiscard]] FunctionSymbolData *getNearestFunctionSymbolData(uint32_t address) const {
|
||||
[[nodiscard]] std::optional<FunctionSymbolData> getNearestFunctionSymbolData(uint32_t address) const {
|
||||
FunctionSymbolData *result = nullptr;
|
||||
|
||||
bool foundHit = false;
|
||||
@ -106,8 +106,11 @@ public:
|
||||
foundHit = true;
|
||||
}
|
||||
}
|
||||
if (!foundHit) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return result;
|
||||
return *result;
|
||||
}
|
||||
|
||||
[[nodiscard]] const HeapMemoryFixedSize &getTextMemory() const {
|
||||
|
Loading…
Reference in New Issue
Block a user