Merge pull request #90218 from Repiteo/do-while-false-cleanup
Update lingering `do/while(0)` defines
This commit is contained in:
@ -77,15 +77,17 @@ subject to the following restrictions:
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
#define CHULL_ASSERT(m_cond) \
|
||||
do { \
|
||||
if constexpr (true) { \
|
||||
if (unlikely(!(m_cond))) { \
|
||||
ERR_PRINT("Assertion \"" _STR(m_cond) "\" failed."); \
|
||||
} \
|
||||
} while (0)
|
||||
} else \
|
||||
((void)0)
|
||||
#else
|
||||
#define CHULL_ASSERT(m_cond) \
|
||||
do { \
|
||||
} while (0)
|
||||
if constexpr (true) { \
|
||||
} else \
|
||||
((void)0)
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG_CONVEX_HULL) || defined(SHOW_ITERATIONS)
|
||||
|
||||
@ -36,12 +36,13 @@
|
||||
#include "core/string/print_string.h"
|
||||
|
||||
#define COMPACT_CHUNK(m_entry, m_to_pos) \
|
||||
do { \
|
||||
if constexpr (true) { \
|
||||
void *_dst = &((unsigned char *)pool)[m_to_pos]; \
|
||||
void *_src = &((unsigned char *)pool)[(m_entry).pos]; \
|
||||
memmove(_dst, _src, aligned((m_entry).len)); \
|
||||
(m_entry).pos = m_to_pos; \
|
||||
} while (0);
|
||||
} else \
|
||||
((void)0)
|
||||
|
||||
void PoolAllocator::mt_lock() const {
|
||||
}
|
||||
|
||||
@ -230,18 +230,20 @@ public:
|
||||
};
|
||||
|
||||
#define register_string_op(m_op_type, m_op_code) \
|
||||
do { \
|
||||
if constexpr (true) { \
|
||||
register_op<m_op_type<String, String>>(m_op_code, Variant::STRING, Variant::STRING); \
|
||||
register_op<m_op_type<String, StringName>>(m_op_code, Variant::STRING, Variant::STRING_NAME); \
|
||||
register_op<m_op_type<StringName, String>>(m_op_code, Variant::STRING_NAME, Variant::STRING); \
|
||||
register_op<m_op_type<StringName, StringName>>(m_op_code, Variant::STRING_NAME, Variant::STRING_NAME); \
|
||||
} while (false)
|
||||
} else \
|
||||
((void)0)
|
||||
|
||||
#define register_string_modulo_op(m_class, m_type) \
|
||||
do { \
|
||||
if constexpr (true) { \
|
||||
register_op<OperatorEvaluatorStringFormat<String, m_class>>(Variant::OP_MODULE, Variant::STRING, m_type); \
|
||||
register_op<OperatorEvaluatorStringFormat<StringName, m_class>>(Variant::OP_MODULE, Variant::STRING_NAME, m_type); \
|
||||
} while (false)
|
||||
} else \
|
||||
((void)0)
|
||||
|
||||
void Variant::_register_variant_operators() {
|
||||
memset(operator_return_type_table, 0, sizeof(operator_return_type_table));
|
||||
|
||||
Reference in New Issue
Block a user