Merge pull request #17486 from bojidar-bg/x-fix-clang-negation-warn

Fix a potential bug hinted by clang
This commit is contained in:
Rémi Verschelde 2018-03-13 20:02:42 +01:00 committed by GitHub
commit b64d4e3a83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -177,7 +177,7 @@ bool Variant::booleanize() const {
CASE_TYPE(m_prefix, m_op_name, m_name) { \ CASE_TYPE(m_prefix, m_op_name, m_name) { \
if (p_b.type == INT) _RETURN(p_a._data.m_type m_op p_b._data._int); \ if (p_b.type == INT) _RETURN(p_a._data.m_type m_op p_b._data._int); \
if (p_b.type == REAL) _RETURN(p_a._data.m_type m_op p_b._data._real); \ if (p_b.type == REAL) _RETURN(p_a._data.m_type m_op p_b._data._real); \
if (p_b.type == NIL) _RETURN(!p_b.type m_op NIL); \ if (p_b.type == NIL) _RETURN(!(p_b.type m_op NIL)); \
\ \
_RETURN_FAIL \ _RETURN_FAIL \
}; };
@ -252,7 +252,7 @@ bool Variant::booleanize() const {
CASE_TYPE(m_prefix, m_op_name, m_name) { \ CASE_TYPE(m_prefix, m_op_name, m_name) { \
if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const String *>(p_b._data._mem)); \ if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const String *>(p_b._data._mem)); \
if (p_b.type == NODE_PATH) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const NodePath *>(p_b._data._mem)); \ if (p_b.type == NODE_PATH) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const NodePath *>(p_b._data._mem)); \
if (p_b.type == NIL) _RETURN(!p_b.type m_op NIL); \ if (p_b.type == NIL) _RETURN(!(p_b.type m_op NIL)); \
\ \
_RETURN_FAIL \ _RETURN_FAIL \
}; };
@ -278,7 +278,7 @@ bool Variant::booleanize() const {
if (p_b.type == m_name) \ if (p_b.type == m_name) \
_RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const m_type *>(p_b._data._mem)); \ _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const m_type *>(p_b._data._mem)); \
if (p_b.type == NIL) \ if (p_b.type == NIL) \
_RETURN(!p_b.type m_op NIL); \ _RETURN(!(p_b.type m_op NIL)); \
\ \
_RETURN_FAIL \ _RETURN_FAIL \
}; };
@ -323,7 +323,7 @@ bool Variant::booleanize() const {
if (p_b.type == m_name) \ if (p_b.type == m_name) \
_RETURN(*p_a._data.m_sub m_op *p_b._data.m_sub); \ _RETURN(*p_a._data.m_sub m_op *p_b._data.m_sub); \
if (p_b.type == NIL) \ if (p_b.type == NIL) \
_RETURN(!p_b.type m_op NIL); \ _RETURN(!(p_b.type m_op NIL)); \
\ \
_RETURN_FAIL \ _RETURN_FAIL \
} }