mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-04 08:29:44 -04:00
ams: improve offsetof style consistency
This commit is contained in:
parent
ec6d1a92ef
commit
889d843718
29 changed files with 140 additions and 142 deletions
|
@ -50,7 +50,7 @@ namespace ams::crypto::impl {
|
|||
public:
|
||||
HmacImpl() : m_state(State_None) { /* ... */ }
|
||||
~HmacImpl() {
|
||||
static_assert(offsetof(HmacImpl, m_hash_function) == 0);
|
||||
static_assert(AMS_OFFSETOF(HmacImpl, m_hash_function) == 0);
|
||||
|
||||
/* Clear everything except for the hash function. */
|
||||
ClearMemory(reinterpret_cast<u8 *>(this) + sizeof(m_hash_function), sizeof(*this) - sizeof(m_hash_function));
|
||||
|
|
|
@ -563,7 +563,7 @@ namespace ams::svc {
|
|||
u64 padding[6];
|
||||
};
|
||||
static_assert(sizeof(ProcessLocalRegion) == 0x200);
|
||||
static_assert(OFFSETOF(ProcessLocalRegion, dying_message_region_address) == 0x1C0);
|
||||
static_assert(AMS_OFFSETOF(ProcessLocalRegion, dying_message_region_address) == 0x1C0);
|
||||
|
||||
}
|
||||
|
||||
|
@ -607,7 +607,7 @@ namespace ams::svc {
|
|||
u64 padding[6];
|
||||
};
|
||||
static_assert(sizeof(ProcessLocalRegion) == 0x200);
|
||||
static_assert(OFFSETOF(ProcessLocalRegion, dying_message_region_address) == 0x1C0);
|
||||
static_assert(AMS_OFFSETOF(ProcessLocalRegion, dying_message_region_address) == 0x1C0);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -170,11 +170,8 @@ namespace ams::util {
|
|||
|
||||
|
||||
/* Defines, for use by other code. */
|
||||
|
||||
#define OFFSETOF(parent, member) (::ams::util::impl::OffsetOf<&parent::member, parent>::value)
|
||||
|
||||
#define GET_PARENT_PTR(parent, member, _arg) (::ams::util::GetParentPointer<&parent::member, parent>(_arg))
|
||||
|
||||
#define GET_PARENT_REF(parent, member, _arg) (::ams::util::GetParentReference<&parent::member, parent>(_arg))
|
||||
#define AMS_OFFSETOF(parent, member) (__builtin_offsetof(parent, member))
|
||||
#define AMS_GET_PARENT_PTR(parent, member, _arg) (::ams::util::GetParentPointer<&parent::member, parent>(_arg))
|
||||
#define AMS_GET_PARENT_REF(parent, member, _arg) (::ams::util::GetParentReference<&parent::member, parent>(_arg))
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue