mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-17 17:36:44 +00:00
ams: fix compilation with gcc 13
This commit is contained in:
parent
ed9e60acb9
commit
1f5ec68a5c
8 changed files with 8 additions and 28 deletions
|
@ -257,7 +257,7 @@ namespace ams::kern {
|
||||||
class KScopedAutoObject {
|
class KScopedAutoObject {
|
||||||
NON_COPYABLE(KScopedAutoObject);
|
NON_COPYABLE(KScopedAutoObject);
|
||||||
private:
|
private:
|
||||||
template<typename U>
|
template<typename U> requires std::derived_from<U, KAutoObject>
|
||||||
friend class KScopedAutoObject;
|
friend class KScopedAutoObject;
|
||||||
private:
|
private:
|
||||||
T *m_obj;
|
T *m_obj;
|
||||||
|
|
|
@ -120,10 +120,6 @@ namespace ams::kern {
|
||||||
return m_address == rhs;
|
return m_address == rhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE bool operator!=(uintptr_t rhs) const {
|
|
||||||
return m_address != rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Allow getting the address explicitly, for use in accessors. */
|
/* Allow getting the address explicitly, for use in accessors. */
|
||||||
constexpr ALWAYS_INLINE uintptr_t GetValue() const {
|
constexpr ALWAYS_INLINE uintptr_t GetValue() const {
|
||||||
return m_address;
|
return m_address;
|
||||||
|
|
|
@ -164,8 +164,9 @@ namespace ams::kern {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template<typename Derived, typename Base, bool SupportDynamicExpansion = false> requires std::derived_from<Base, KAutoObjectWithList>
|
template<typename Derived, typename Base, bool SupportDynamicExpansion = false>
|
||||||
class KAutoObjectWithSlabHeapAndContainer : public KAutoObjectWithSlabHeapBase<Derived, Base, SupportDynamicExpansion> {
|
class KAutoObjectWithSlabHeapAndContainer : public KAutoObjectWithSlabHeapBase<Derived, Base, SupportDynamicExpansion> {
|
||||||
|
static_assert(std::derived_from<Base, KAutoObjectWithList>);
|
||||||
private:
|
private:
|
||||||
static constinit inline KAutoObjectWithListContainer<Derived> s_container;
|
static constinit inline KAutoObjectWithListContainer<Derived> s_container;
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace ams::kern::svc {
|
||||||
R_UNLESS(size < ams::kern::MainMemorySizeMax, svc::ResultInvalidSize());
|
R_UNLESS(size < ams::kern::MainMemorySizeMax, svc::ResultInvalidSize());
|
||||||
|
|
||||||
/* Set the heap size. */
|
/* Set the heap size. */
|
||||||
KProcessAddress address;
|
KProcessAddress address = Null<KProcessAddress>;
|
||||||
R_TRY(GetCurrentProcess().GetPageTable().SetHeapSize(std::addressof(address), size));
|
R_TRY(GetCurrentProcess().GetPageTable().SetHeapSize(std::addressof(address), size));
|
||||||
|
|
||||||
/* Set the output. */
|
/* Set the output. */
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace ams::sf::hipc {
|
||||||
AMS_ABORT_UNLESS(ServerManagerBase::CanAnyManageMitmServers());
|
AMS_ABORT_UNLESS(ServerManagerBase::CanAnyManageMitmServers());
|
||||||
|
|
||||||
/* Clone the forward service. */
|
/* Clone the forward service. */
|
||||||
std::shared_ptr<::Service> new_forward_service = std::move(ServerSession::CreateForwardService());
|
std::shared_ptr<::Service> new_forward_service = ServerSession::CreateForwardService();
|
||||||
R_ABORT_UNLESS(serviceClone(util::GetReference(m_session->m_forward_service).get(), new_forward_service.get()));
|
R_ABORT_UNLESS(serviceClone(util::GetReference(m_session->m_forward_service).get(), new_forward_service.get()));
|
||||||
R_ABORT_UNLESS(tagged_manager->RegisterMitmSession(server_handle, std::move(clone), std::move(new_forward_service)));
|
R_ABORT_UNLESS(tagged_manager->RegisterMitmSession(server_handle, std::move(clone), std::move(new_forward_service)));
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ namespace ams::sf::hipc {
|
||||||
R_ABORT_UNLESS(hipc::CreateSession(std::addressof(server_handle), std::addressof(client_handle)));
|
R_ABORT_UNLESS(hipc::CreateSession(std::addressof(server_handle), std::addressof(client_handle)));
|
||||||
|
|
||||||
/* Register. */
|
/* Register. */
|
||||||
std::shared_ptr<::Service> new_forward_service = std::move(ServerSession::CreateForwardService());
|
std::shared_ptr<::Service> new_forward_service = ServerSession::CreateForwardService();
|
||||||
serviceCreate(new_forward_service.get(), new_forward_target);
|
serviceCreate(new_forward_service.get(), new_forward_target);
|
||||||
R_ABORT_UNLESS(m_manager->RegisterMitmSession(server_handle, std::move(object), std::move(new_forward_service)));
|
R_ABORT_UNLESS(m_manager->RegisterMitmSession(server_handle, std::move(object), std::move(new_forward_service)));
|
||||||
|
|
||||||
|
|
|
@ -144,10 +144,6 @@ namespace ams::util {
|
||||||
return m_node == rhs.m_node;
|
return m_node == rhs.m_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE bool operator!=(const Iterator &rhs) const {
|
|
||||||
return !(*this == rhs);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE pointer operator->() const {
|
constexpr ALWAYS_INLINE pointer operator->() const {
|
||||||
return m_node;
|
return m_node;
|
||||||
}
|
}
|
||||||
|
@ -355,10 +351,6 @@ namespace ams::util {
|
||||||
return m_iterator == rhs.m_iterator;
|
return m_iterator == rhs.m_iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE bool operator!=(const Iterator &rhs) const {
|
|
||||||
return !(*this == rhs);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE pointer operator->() const {
|
constexpr ALWAYS_INLINE pointer operator->() const {
|
||||||
return std::addressof(Traits::GetParent(*m_iterator));
|
return std::addressof(Traits::GetParent(*m_iterator));
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,10 +94,6 @@ namespace ams::util {
|
||||||
return m_node == rhs.m_node;
|
return m_node == rhs.m_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE bool operator!=(const Iterator &rhs) const {
|
|
||||||
return !(*this == rhs);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE pointer operator->() const {
|
constexpr ALWAYS_INLINE pointer operator->() const {
|
||||||
return m_node;
|
return m_node;
|
||||||
}
|
}
|
||||||
|
@ -304,10 +300,6 @@ namespace ams::util {
|
||||||
return m_impl == rhs.m_impl;
|
return m_impl == rhs.m_impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE bool operator!=(const Iterator &rhs) const {
|
|
||||||
return !(*this == rhs);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE pointer operator->() const {
|
constexpr ALWAYS_INLINE pointer operator->() const {
|
||||||
return Traits::GetParent(std::addressof(*m_impl));
|
return Traits::GetParent(std::addressof(*m_impl));
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,12 +251,11 @@ namespace ams::mitm::fs {
|
||||||
using DirectoryTableWriter = TableWriter<DirectoryEntry>;
|
using DirectoryTableWriter = TableWriter<DirectoryEntry>;
|
||||||
using FileTableWriter = TableWriter<FileEntry>;
|
using FileTableWriter = TableWriter<FileEntry>;
|
||||||
|
|
||||||
constexpr inline u32 CalculatePathHash(u32 parent, const char *_path, u32 start, size_t path_len) {
|
constexpr inline u32 CalculatePathHash(u32 parent, const char *path, u32 start, size_t path_len) {
|
||||||
const unsigned char *path = reinterpret_cast<const unsigned char *>(_path);
|
|
||||||
u32 hash = parent ^ 123456789;
|
u32 hash = parent ^ 123456789;
|
||||||
for (size_t i = 0; i < path_len; i++) {
|
for (size_t i = 0; i < path_len; i++) {
|
||||||
hash = (hash >> 5) | (hash << 27);
|
hash = (hash >> 5) | (hash << 27);
|
||||||
hash ^= path[start + i];
|
hash ^= static_cast<unsigned char>(path[start + i]);
|
||||||
}
|
}
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue