From 44175058f676ce16c0de93af4d32d6bd4a423f17 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 30 Oct 2018 12:23:21 -0700 Subject: [PATCH] libstrat: mark ServiceObjectHolder functions const --- .../stratosphere/ipc/ipc_service_object.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stratosphere/libstratosphere/include/stratosphere/ipc/ipc_service_object.hpp b/stratosphere/libstratosphere/include/stratosphere/ipc/ipc_service_object.hpp index c2189920d..8803da33f 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ipc/ipc_service_object.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ipc/ipc_service_object.hpp @@ -72,7 +72,7 @@ class ServiceObjectHolder { explicit ServiceObjectHolder(std::shared_ptr&& s) : srv(std::move(s)), dispatch_table(DispatchTable()), entry_count(DispatchTableEntryCount()) { } template - ServiceImpl *GetServiceObject() { + ServiceImpl *GetServiceObject() const { if (GetServiceId() == ServiceObjectId()) { return static_cast(this->srv.get()); } @@ -80,19 +80,19 @@ class ServiceObjectHolder { } template - ServiceImpl *GetServiceObjectUnsafe() { + ServiceImpl *GetServiceObjectUnsafe() const { return static_cast(this->srv.get()); } - const ServiceCommandMeta *GetDispatchTable() { + const ServiceCommandMeta *GetDispatchTable() const { return this->dispatch_table; } - size_t GetDispatchTableEntryCount() { + size_t GetDispatchTableEntryCount() const { return this->entry_count; } - constexpr uintptr_t GetServiceId() { + constexpr uintptr_t GetServiceId() const { return reinterpret_cast(this->dispatch_table); } @@ -109,11 +109,11 @@ class ServiceObjectHolder { return *this; } - explicit operator bool() { + explicit operator bool() const { return this->srv != nullptr; } - bool operator!() { + bool operator!() const { return this->srv == nullptr; } @@ -123,7 +123,7 @@ class ServiceObjectHolder { this->entry_count = 0; } - ServiceObjectHolder Clone() { + ServiceObjectHolder Clone() const { ServiceObjectHolder clone(*this); return clone; }