diff options
author | marxin <mliska@suse.cz> | 2019-02-18 20:28:40 +0100 |
---|---|---|
committer | marxin <mliska@suse.cz> | 2019-02-18 21:54:31 +0100 |
commit | 155cbe0b37ceaed33c1917f61201c1b151747469 (patch) | |
tree | cf10ea4b3aa24cbf925761146aab6ae5eb305d13 /core | |
parent | 07498d313c45f54b0a7c6c0b23e635bddf6f0523 (diff) |
Fix warnings seen with warnings=all and recent GCC 8.2.
Diffstat (limited to 'core')
-rw-r--r-- | core/object.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/core/object.cpp b/core/object.cpp index 54a9bb0d7c..4e0416ccb0 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -703,40 +703,38 @@ Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Vari } #ifdef DEBUG_ENABLED -static bool _test_call_error(const StringName &p_func, const Variant::CallError &error) { +static void _test_call_error(const StringName &p_func, const Variant::CallError &error) { switch (error.error) { case Variant::CallError::CALL_OK: - return true; case Variant::CallError::CALL_ERROR_INVALID_METHOD: - return false; + break; case Variant::CallError::CALL_ERROR_INVALID_ARGUMENT: { ERR_EXPLAIN("Error Calling Function: " + String(p_func) + " - Invalid type for argument " + itos(error.argument) + ", expected " + Variant::get_type_name(error.expected)); - ERR_FAIL_V(true); - } break; + ERR_FAIL(); + break; + } case Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { ERR_EXPLAIN("Error Calling Function: " + String(p_func) + " - Too many arguments, expected " + itos(error.argument)); - ERR_FAIL_V(true); - - } break; + ERR_FAIL(); + break; + } case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { ERR_EXPLAIN("Error Calling Function: " + String(p_func) + " - Too few arguments, expected " + itos(error.argument)); - ERR_FAIL_V(true); - - } break; - case Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL: { - } //? + ERR_FAIL(); + break; + } + case Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL: + break; } - - return true; } #else -#define _test_call_error(m_str, m_err) ((m_err.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) ? false : true) +#define _test_call_error(m_str, m_err) #endif |