diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-06-27 01:05:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-27 01:05:18 +0200 |
commit | eaaff9da3178fa515a0f051fda932c1dd04d53db (patch) | |
tree | 56173535c376e0324f89baccf4bc14b2580ead23 /core/error_macros.h | |
parent | d8c96461183f0dc3208c3d624674fa4544212ea5 (diff) | |
parent | 4e5310cc60dc17e5ef09e57115ca8236544679e4 (diff) | |
download | redot-engine-eaaff9da3178fa515a0f051fda932c1dd04d53db.tar.gz |
Merge pull request #29941 from qarmin/redundant_code_and_others
Remove redundant code, possible NULL pointers and others
Diffstat (limited to 'core/error_macros.h')
-rw-r--r-- | core/error_macros.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/core/error_macros.h b/core/error_macros.h index f72e987e23..69874e280b 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -136,8 +136,8 @@ extern bool _err_error_exists; if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ return; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } while (0); // (*) /** An index has failed if m_index<0 or m_index >=m_size, the function exits. @@ -150,8 +150,8 @@ extern bool _err_error_exists; if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ return m_retval; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } while (0); // (*) /** An index has failed if m_index >=m_size, the function exits. @@ -164,8 +164,8 @@ extern bool _err_error_exists; if (unlikely((m_index) >= (m_size))) { \ _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ return m_retval; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } while (0); // (*) /** Use this one if there is no sensible fallback, that is, the error is unrecoverable. @@ -188,8 +188,8 @@ extern bool _err_error_exists; if (unlikely(!m_param)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null."); \ return; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } #define ERR_FAIL_NULL_V(m_param, m_retval) \ @@ -197,8 +197,8 @@ extern bool _err_error_exists; if (unlikely(!m_param)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null."); \ return m_retval; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). @@ -210,8 +210,8 @@ extern bool _err_error_exists; if (unlikely(m_cond)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true."); \ return; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } /** Use this one if there is no sensible fallback, that is, the error is unrecoverable. @@ -236,8 +236,8 @@ extern bool _err_error_exists; if (unlikely(m_cond)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. returned: " _STR(m_retval)); \ return m_retval; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). @@ -249,8 +249,8 @@ extern bool _err_error_exists; if (unlikely(m_cond)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Continuing..:"); \ continue; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). @@ -262,8 +262,8 @@ extern bool _err_error_exists; if (unlikely(m_cond)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Breaking..:"); \ break; \ - } else \ - _err_error_exists = false; \ + } \ + _err_error_exists = false; \ } /** Print an error string and return |