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:
@ -1003,7 +1003,7 @@ static void register_builtin_method(const Vector<String> &p_argnames, const Vect
|
||||
builtin_method_names[T::get_base_type()].push_back(name);
|
||||
}
|
||||
|
||||
void Variant::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) {
|
||||
void Variant::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) {
|
||||
if (type == Variant::OBJECT) {
|
||||
//call object
|
||||
Object *obj = _get_obj().obj;
|
||||
@ -1018,7 +1018,7 @@ void Variant::call(const StringName &p_method, const Variant **p_args, int p_arg
|
||||
}
|
||||
|
||||
#endif
|
||||
r_ret = _get_obj().obj->call(p_method, p_args, p_argcount, r_error);
|
||||
r_ret = _get_obj().obj->callp(p_method, p_args, p_argcount, r_error);
|
||||
|
||||
//else if (type==Variant::METHOD) {
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user