ams: remove TYPED_STORAGE() macro in favor of template

This commit is contained in:
Michael Scire
2021-03-21 18:47:30 -07:00
parent 8d9174b227
commit aff0da9427
31 changed files with 55 additions and 57 deletions

View File

@@ -49,7 +49,7 @@ namespace ams::ddsf {
NON_MOVEABLE(DeviceCodeEntryHolder);
private:
util::IntrusiveListNode list_node;
TYPED_STORAGE(DeviceCodeEntry) entry_storage;
util::TypedStorage<DeviceCodeEntry> entry_storage;
bool is_constructed;
public:
using ListTraits = util::IntrusiveListMemberTraitsDeferredAssert<&DeviceCodeEntryHolder::list_node>;

View File

@@ -29,7 +29,7 @@ namespace ams::ncm {
struct InstallProgress {
InstallProgressState state;
u8 pad[3];
TYPED_STORAGE(Result) last_result;
util::TypedStorage<Result> last_result;
s64 installed_size;
s64 total_size;

View File

@@ -53,6 +53,6 @@ namespace ams::os::impl {
}
};
using InternalConditionVariableStorage = TYPED_STORAGE(InternalConditionVariable);
using InternalConditionVariableStorage = util::TypedStorage<InternalConditionVariable>;
}

View File

@@ -57,6 +57,6 @@ namespace ams::os::impl {
}
};
using InternalCriticalSectionStorage = TYPED_STORAGE(InternalCriticalSection);
using InternalCriticalSectionStorage = util::TypedStorage<InternalCriticalSection>;
}

View File

@@ -44,7 +44,7 @@ namespace ams::os {
State_Terminated = 4,
};
TYPED_STORAGE(util::IntrusiveListNode) all_threads_node;
util::TypedStorage<util::IntrusiveListNode> all_threads_node;
util::TypedStorage<impl::WaitableObjectList, sizeof(util::IntrusiveListNode), alignof(util::IntrusiveListNode)> waitlist;
uintptr_t reserved[4];
u8 state;

View File

@@ -29,7 +29,7 @@ namespace ams::os {
}
struct TimerEventType {
using TimeSpanStorage = TYPED_STORAGE(TimeSpan);
using TimeSpanStorage = util::TypedStorage<TimeSpan>;
enum State {
State_NotInitialized = 0,

View File

@@ -35,7 +35,7 @@ namespace ams::powctl {
struct Session {
bool has_session;
TYPED_STORAGE(impl::SessionImpl) impl_storage;
util::TypedStorage<impl::SessionImpl> impl_storage;
Session() : has_session(false) { /* ... */ }
};

View File

@@ -77,8 +77,8 @@ namespace ams::sf::cmif {
virtual ServiceObjectHolder GetObject(DomainObjectId id) override final;
};
public:
using DomainEntryStorage = TYPED_STORAGE(Entry);
using DomainStorage = TYPED_STORAGE(Domain);
using DomainEntryStorage = util::TypedStorage<Entry>;
using DomainStorage = util::TypedStorage<Domain>;
private:
class EntryManager {
private:

View File

@@ -260,9 +260,9 @@ namespace ams::sf::hipc {
private:
/* Resource storage. */
os::Mutex resource_mutex;
TYPED_STORAGE(Server) server_storages[MaxServers];
util::TypedStorage<Server> server_storages[MaxServers];
bool server_allocated[MaxServers];
TYPED_STORAGE(ServerSession) session_storages[MaxSessions];
util::TypedStorage<ServerSession> session_storages[MaxSessions];
bool session_allocated[MaxSessions];
u8 pointer_buffer_storage[0x10 + (MaxSessions * ManagerOptions::PointerBufferSize)];
u8 saved_message_storage[0x10 + (MaxSessions * hipc::TlsMessageBufferSize)];

View File

@@ -684,7 +684,7 @@ namespace ams::sf::impl {
private:
std::array<cmif::ServiceObjectHolder, NumInObjects> in_object_holders;
std::array<cmif::ServiceObjectHolder, NumOutObjects> out_object_holders;
std::array<TYPED_STORAGE(SharedPointer<sf::IServiceObject>), NumOutObjects> out_shared_pointers;
std::array<util::TypedStorage<SharedPointer<sf::IServiceObject>>, NumOutObjects> out_shared_pointers;
std::array<cmif::DomainObjectId, NumOutObjects> out_object_ids;
public:
constexpr InOutObjectHolder() : in_object_holders(), out_object_holders() {