mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
Remove do{ } while(0) wrapper around error macros.
As pointed out by Faless, a do{ } while(0) wrapper around a continue or
break just ends the do{ } while(0) loop. The do{ } while(0) loop exists
to enable the macro to be used as a function which requires a semicolon.
The alternative approach is to use an if(1) { } else ((void)0) wrapper.
Since the macro already has an if(unlikely(m_cond)) { } this patch simply
adds the else ((void)0) to this if statement instead.
For consistency all the macros have been updated in the same way, and
trailing else warnings corrected. However, the wrappers around ERR_PRINT
and WARN_PRINT were removed, because they generated too many ambiguous
trailing else warnings. They are also single line macros so a wrapper is
not needed.
This commit is contained in:
parent
343b29a651
commit
d2b02a3d7b
2 changed files with 191 additions and 214 deletions
|
|
@ -1721,8 +1721,7 @@ bool CSharpInstance::has_method(const StringName &p_method) const {
|
|||
|
||||
Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
|
||||
|
||||
if (!script.is_valid())
|
||||
ERR_FAIL_V(Variant());
|
||||
ERR_FAIL_COND_V(!script.is_valid(), Variant());
|
||||
|
||||
GD_MONO_SCOPE_THREAD_ATTACH;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue