stratosphere: In-class initialize members

Same thing, less code, less boilerplate.
This commit is contained in:
Léo Lam
2018-07-02 16:26:03 +02:00
committed by SciresM
parent 5b3e8e1c5d
commit e088a2f414
8 changed files with 42 additions and 54 deletions

View File

@@ -27,12 +27,11 @@ class MapUtils {
class AutoCloseMap {
private:
void *mapped_address;
u64 base_address;
u64 size;
Handle process_handle;
void *mapped_address = nullptr;
u64 base_address = 0;
u64 size = 0;
Handle process_handle = 0;
public:
AutoCloseMap() : mapped_address(0), base_address(0), size(0), process_handle(0) { };
~AutoCloseMap() {
Close();
}
@@ -154,4 +153,4 @@ struct MappedCodeMemory {
}
*this = (const MappedCodeMemory){0};
}
};
};

View File

@@ -13,11 +13,10 @@ enum RoServiceCmd {
};
class RelocatableObjectsService final : public IServiceObject {
Handle process_handle;
u64 process_id;
bool has_initialized;
Handle process_handle = 0;
u64 process_id = U64_MAX;
bool has_initialized = false;
public:
RelocatableObjectsService() : process_handle(0), process_id(U64_MAX), has_initialized(false) { }
~RelocatableObjectsService() {
Registration::CloseRoService(this, this->process_handle);
if (this->has_initialized) {