Commit e4700c0a authored by Max Kellermann's avatar Max Kellermann

util/Cast: remove redundant `inline` keywords from `constexpr` functions

parent cf23fd87
...@@ -36,28 +36,28 @@ ...@@ -36,28 +36,28 @@
#include <stddef.h> #include <stddef.h>
template<typename T, typename U> template<typename T, typename U>
static inline constexpr T * constexpr T *
OffsetCast(U *p, ptrdiff_t offset) OffsetCast(U *p, ptrdiff_t offset)
{ {
return reinterpret_cast<T *>(OffsetPointer(p, offset)); return reinterpret_cast<T *>(OffsetPointer(p, offset));
} }
template<typename T, typename U> template<typename T, typename U>
static inline constexpr T * constexpr T *
OffsetCast(const U *p, ptrdiff_t offset) OffsetCast(const U *p, ptrdiff_t offset)
{ {
return reinterpret_cast<const T *>(OffsetPointer(p, offset)); return reinterpret_cast<const T *>(OffsetPointer(p, offset));
} }
template<class C, class A> template<class C, class A>
static constexpr inline ptrdiff_t constexpr ptrdiff_t
ContainerAttributeOffset(const C *null_c, const A C::*p) ContainerAttributeOffset(const C *null_c, const A C::*p)
{ {
return ptrdiff_t((const char *)&(null_c->*p) - (const char *)null_c); return ptrdiff_t((const char *)&(null_c->*p) - (const char *)null_c);
} }
template<class C, class A> template<class C, class A>
static constexpr inline ptrdiff_t constexpr ptrdiff_t
ContainerAttributeOffset(const A C::*p) ContainerAttributeOffset(const A C::*p)
{ {
return ContainerAttributeOffset<C, A>(nullptr, p); return ContainerAttributeOffset<C, A>(nullptr, p);
...@@ -67,7 +67,7 @@ ContainerAttributeOffset(const A C::*p) ...@@ -67,7 +67,7 @@ ContainerAttributeOffset(const A C::*p)
* Cast the given pointer to a struct member to its parent structure. * Cast the given pointer to a struct member to its parent structure.
*/ */
template<class C, class A> template<class C, class A>
static inline constexpr C & constexpr C &
ContainerCast(A &a, const A C::*member) ContainerCast(A &a, const A C::*member)
{ {
return *OffsetCast<C, A>(&a, -ContainerAttributeOffset<C, A>(member)); return *OffsetCast<C, A>(&a, -ContainerAttributeOffset<C, A>(member));
...@@ -77,7 +77,7 @@ ContainerCast(A &a, const A C::*member) ...@@ -77,7 +77,7 @@ ContainerCast(A &a, const A C::*member)
* Cast the given pointer to a struct member to its parent structure. * Cast the given pointer to a struct member to its parent structure.
*/ */
template<class C, class A> template<class C, class A>
static inline constexpr const C & constexpr const C &
ContainerCast(const A &a, const A C::*member) ContainerCast(const A &a, const A C::*member)
{ {
return *OffsetCast<const C, const A>(&a, -ContainerAttributeOffset<C, A>(member)); return *OffsetCast<const C, const A>(&a, -ContainerAttributeOffset<C, A>(member));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment