Style: Enforce AllowShortFunctionsOnASingleLine

This commit is contained in:
Thaddeus Crews
2024-12-30 10:23:23 -06:00
parent 2582793d40
commit e06d83860d
15 changed files with 611 additions and 405 deletions

View File

@ -70,12 +70,14 @@
// These types can be used in Vector and other containers that use
// pointer operations not supported by ARC.
namespace MTL {
#define MTL_CLASS(name) \
class name { \
public: \
name(id<MTL##name> obj = nil) : m_obj(obj) {} \
operator id<MTL##name>() const { return m_obj; } \
id<MTL##name> m_obj; \
#define MTL_CLASS(name) \
class name { \
public: \
name(id<MTL##name> obj = nil) : m_obj(obj) {} \
operator id<MTL##name>() const { \
return m_obj; \
} \
id<MTL##name> m_obj; \
};
MTL_CLASS(Texture)
@ -949,8 +951,10 @@ void *owned(id p_id) {
return (__bridge_retained void *)p_id;
}
#define MAKE_ID(FROM, TO) \
_FORCE_INLINE_ TO make(FROM p_obj) { return TO(owned(p_obj)); }
#define MAKE_ID(FROM, TO) \
_FORCE_INLINE_ TO make(FROM p_obj) { \
return TO(owned(p_obj)); \
}
MAKE_ID(id<MTLTexture>, RDD::TextureID)
MAKE_ID(id<MTLBuffer>, RDD::BufferID)

View File

@ -53,11 +53,15 @@ void clear(Tv &p_value, Tm p_mask) {
/*! Returns whether the specified value has any of the bits specified in mask set to 1. */
template <typename Tv, typename Tm>
static constexpr bool any(Tv p_value, const Tm p_mask) { return ((p_value & p_mask) != 0); }
static constexpr bool any(Tv p_value, const Tm p_mask) {
return ((p_value & p_mask) != 0);
}
/*! Returns whether the specified value has all of the bits specified in mask set to 1. */
template <typename Tv, typename Tm>
static constexpr bool all(Tv p_value, const Tm p_mask) { return ((p_value & p_mask) == p_mask); }
static constexpr bool all(Tv p_value, const Tm p_mask) {
return ((p_value & p_mask) == p_mask);
}
} //namespace flags