mirror of
https://github.com/godotengine/godot.git
synced 2025-10-26 03:04:31 +00:00
Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
This commit is contained in:
parent
922348f4c0
commit
21637dfc25
59 changed files with 417 additions and 467 deletions
|
|
@ -1893,7 +1893,7 @@ bool CSharpInstance::has_method(const StringName &p_method) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
|
||||
Variant CSharpInstance::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
|
||||
ERR_FAIL_COND_V(!script.is_valid(), Variant());
|
||||
|
||||
GD_MONO_SCOPE_THREAD_ATTACH;
|
||||
|
|
@ -2908,7 +2908,7 @@ int CSharpScript::_try_get_member_export_hint(IMonoClassMember *p_member, Manage
|
|||
}
|
||||
#endif
|
||||
|
||||
Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
|
||||
Variant CSharpScript::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
|
||||
if (unlikely(GDMono::get_singleton() == nullptr)) {
|
||||
// Probably not the best error but eh.
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
|
||||
|
|
@ -2936,7 +2936,7 @@ Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, i
|
|||
}
|
||||
|
||||
// No static method found. Try regular instance calls
|
||||
return Script::call(p_method, p_args, p_argcount, r_error);
|
||||
return Script::callp(p_method, p_args, p_argcount, r_error);
|
||||
}
|
||||
|
||||
void CSharpScript::_resource_path_changed() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue