diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-16 10:42:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-16 10:42:56 +0200 |
commit | 309adb93cdd1cead9221d4f33f788d98175c4508 (patch) | |
tree | 06e45d0e996623afdcd4d6dc57c756bc777e297a | |
parent | 33069352890e24370a424b8397b27ca1210d7acc (diff) | |
parent | 4fea536517f56678013871b5283e3aba63d42fff (diff) |
Merge pull request #39484 from hbina/use_nullptr_in_macros
Check pointers against nullptr.
-rw-r--r-- | core/error_macros.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/error_macros.h b/core/error_macros.h index 46a1623115..d7366be453 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -285,7 +285,7 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li * If it is null, the current function returns. */ #define ERR_FAIL_NULL(m_param) \ - if (unlikely(!m_param)) { \ + if (unlikely(m_param == nullptr)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter \"" _STR(m_param) "\" is null."); \ return; \ } else \ @@ -296,7 +296,7 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li * If it is null, prints `m_msg` and the current function returns. */ #define ERR_FAIL_NULL_MSG(m_param, m_msg) \ - if (unlikely(!m_param)) { \ + if (unlikely(m_param == nullptr)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter \"" _STR(m_param) "\" is null.", DEBUG_STR(m_msg)); \ return; \ } else \ @@ -310,7 +310,7 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li * If it is null, the current function returns `m_retval`. */ #define ERR_FAIL_NULL_V(m_param, m_retval) \ - if (unlikely(!m_param)) { \ + if (unlikely(m_param == nullptr)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter \"" _STR(m_param) "\" is null."); \ return m_retval; \ } else \ @@ -321,7 +321,7 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li * If it is null, prints `m_msg` and the current function returns `m_retval`. */ #define ERR_FAIL_NULL_V_MSG(m_param, m_retval, m_msg) \ - if (unlikely(!m_param)) { \ + if (unlikely(m_param == nullptr)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter \"" _STR(m_param) "\" is null.", DEBUG_STR(m_msg)); \ return m_retval; \ } else \ |