You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +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:
@@ -1197,7 +1197,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const
|
||||
if (psg->_setptr) {
|
||||
psg->_setptr->call(p_object, arg, 2, ce);
|
||||
} else {
|
||||
p_object->call(psg->setter, arg, 2, ce);
|
||||
p_object->callp(psg->setter, arg, 2, ce);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -1205,7 +1205,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const
|
||||
if (psg->_setptr) {
|
||||
psg->_setptr->call(p_object, arg, 1, ce);
|
||||
} else {
|
||||
p_object->call(psg->setter, arg, 1, ce);
|
||||
p_object->callp(psg->setter, arg, 1, ce);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1238,14 +1238,14 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia
|
||||
Variant index = psg->index;
|
||||
const Variant *arg[1] = { &index };
|
||||
Callable::CallError ce;
|
||||
r_value = p_object->call(psg->getter, arg, 1, ce);
|
||||
r_value = p_object->callp(psg->getter, arg, 1, ce);
|
||||
|
||||
} else {
|
||||
Callable::CallError ce;
|
||||
if (psg->_getptr) {
|
||||
r_value = psg->_getptr->call(p_object, nullptr, 0, ce);
|
||||
} else {
|
||||
r_value = p_object->call(psg->getter, nullptr, 0, ce);
|
||||
r_value = p_object->callp(psg->getter, nullptr, 0, ce);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user