strat: use m_ for member variables

This commit is contained in:
Michael Scire 2021-10-10 00:14:06 -07:00
parent ce28591ab2
commit a595c232b9
425 changed files with 8531 additions and 8484 deletions

View file

@ -34,57 +34,57 @@ namespace ams::psc {
}
PmModule::PmModule() : intf(nullptr), initialized(false), reserved(0) { /* ... */ }
PmModule::PmModule() : m_intf(nullptr), m_initialized(false), m_reserved(0) { /* ... */ }
PmModule::~PmModule() {
if (this->initialized) {
this->intf = nullptr;
os::DestroySystemEvent(this->system_event.GetBase());
if (m_initialized) {
m_intf = nullptr;
os::DestroySystemEvent(m_system_event.GetBase());
}
}
Result PmModule::Initialize(const PmModuleId mid, const PmModuleId *dependencies, u32 dependency_count, os::EventClearMode clear_mode) {
R_UNLESS(!this->initialized, psc::ResultAlreadyInitialized());
R_UNLESS(!m_initialized, psc::ResultAlreadyInitialized());
static_assert(sizeof(*dependencies) == sizeof(u32));
::PscPmModule module;
R_TRY(::pscmGetPmModule(std::addressof(module), static_cast<::PscPmModuleId>(mid), reinterpret_cast<const u32 *>(dependencies), dependency_count, clear_mode == os::EventClearMode_AutoClear));
this->intf = RemoteObjectFactory::CreateSharedEmplaced<psc::sf::IPmModule, RemotePmModule>(module);
this->system_event.AttachReadableHandle(module.event.revent, false, clear_mode);
this->initialized = true;
m_intf = RemoteObjectFactory::CreateSharedEmplaced<psc::sf::IPmModule, RemotePmModule>(module);
m_system_event.AttachReadableHandle(module.event.revent, false, clear_mode);
m_initialized = true;
return ResultSuccess();
}
Result PmModule::Finalize() {
R_UNLESS(this->initialized, psc::ResultNotInitialized());
R_UNLESS(m_initialized, psc::ResultNotInitialized());
R_TRY(this->intf->Finalize());
this->intf = nullptr;
os::DestroySystemEvent(this->system_event.GetBase());
this->initialized = false;
R_TRY(m_intf->Finalize());
m_intf = nullptr;
os::DestroySystemEvent(m_system_event.GetBase());
m_initialized = false;
return ResultSuccess();
}
Result PmModule::GetRequest(PmState *out_state, PmFlagSet *out_flags) {
R_UNLESS(this->initialized, psc::ResultNotInitialized());
R_UNLESS(m_initialized, psc::ResultNotInitialized());
return this->intf->GetRequest(out_state, out_flags);
return m_intf->GetRequest(out_state, out_flags);
}
Result PmModule::Acknowledge(PmState state, Result res) {
R_ABORT_UNLESS(res);
R_UNLESS(this->initialized, psc::ResultNotInitialized());
R_UNLESS(m_initialized, psc::ResultNotInitialized());
if (hos::GetVersion() >= hos::Version_5_1_0) {
return this->intf->AcknowledgeEx(state);
return m_intf->AcknowledgeEx(state);
} else {
return this->intf->Acknowledge();
return m_intf->Acknowledge();
}
}
os::SystemEvent *PmModule::GetEventPointer() {
return std::addressof(this->system_event);
return std::addressof(m_system_event);
}
}