diff options
author | reduz <reduzio@gmail.com> | 2022-03-09 14:58:40 +0100 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2022-03-09 18:39:13 +0100 |
commit | 21637dfc2535a00f531b8b664c1e66ba34d11eb0 (patch) | |
tree | bfe6059eedfd5a4233d7d4b46d60703e342860d8 /platform/javascript/javascript_singleton.cpp | |
parent | 922348f4c00e694961a7c9717abdcd0310c11973 (diff) |
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.
Diffstat (limited to 'platform/javascript/javascript_singleton.cpp')
-rw-r--r-- | platform/javascript/javascript_singleton.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/javascript/javascript_singleton.cpp b/platform/javascript/javascript_singleton.cpp index eb5c02822f..c9c4d6e1b9 100644 --- a/platform/javascript/javascript_singleton.cpp +++ b/platform/javascript/javascript_singleton.cpp @@ -81,7 +81,7 @@ protected: public: Variant getvar(const Variant &p_key, bool *r_valid = nullptr) const override; void setvar(const Variant &p_key, const Variant &p_value, bool *r_valid = nullptr) override; - Variant call(const StringName &p_method, const Variant **p_args, int p_argc, Callable::CallError &r_error) override; + Variant callp(const StringName &p_method, const Variant **p_args, int p_argc, Callable::CallError &r_error) override; JavaScriptObjectImpl() {} JavaScriptObjectImpl(int p_id) { _js_id = p_id; } ~JavaScriptObjectImpl() { @@ -231,7 +231,7 @@ int JavaScriptObjectImpl::_variant2js(const void **p_args, int p_pos, godot_js_w return type; } -Variant JavaScriptObjectImpl::call(const StringName &p_method, const Variant **p_args, int p_argc, Callable::CallError &r_error) { +Variant JavaScriptObjectImpl::callp(const StringName &p_method, const Variant **p_args, int p_argc, Callable::CallError &r_error) { godot_js_wrapper_ex exchange; const String method = p_method; void *lock = nullptr; |