summaryrefslogtreecommitdiffstats
path: root/src/classes/wrapped.cpp
diff options
context:
space:
mode:
authorEmmanuel Leblond <emmanuel.leblond@gmail.com>2022-12-03 11:13:23 +0100
committerGitHub <noreply@github.com>2022-12-03 11:13:23 +0100
commit32859ea25c31ae596535d6bf0178a6e01f45a001 (patch)
treede338d0fd68e5fbe4067b8faeeb338f40e66ff4e /src/classes/wrapped.cpp
parentf1d501f97749fd70f590a3e82b81e55d6cf1d2d7 (diff)
parentfe86a94dcf996e6262d788028e7efd1f50267e20 (diff)
downloadredot-cpp-32859ea25c31ae596535d6bf0178a6e01f45a001.tar.gz
Merge pull request #897 from touilleMan/gdextension-fix-gdnative-types-const-qualifier
Fix const qualifier for parameters in GDExtension api functions
Diffstat (limited to 'src/classes/wrapped.cpp')
-rw-r--r--src/classes/wrapped.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/classes/wrapped.cpp b/src/classes/wrapped.cpp
index fead050..ed57f44 100644
--- a/src/classes/wrapped.cpp
+++ b/src/classes/wrapped.cpp
@@ -43,17 +43,13 @@ const StringName *Wrapped::_get_extension_class_name() const {
void Wrapped::_postinitialize() {
const StringName *extension_class = _get_extension_class_name();
if (extension_class) {
- // TODO: replace C cast by a proper reinterpret_cast once `object_set_instance` signature correctly handles `const GDNativeStringNamePtr` param
- // (see: https://github.com/godotengine/godot/pull/67751)
- godot::internal::gdn_interface->object_set_instance(_owner, (GDNativeStringNamePtr)(extension_class), this);
+ godot::internal::gdn_interface->object_set_instance(_owner, reinterpret_cast<GDNativeConstStringNamePtr>(extension_class), this);
}
godot::internal::gdn_interface->object_set_instance_binding(_owner, godot::internal::token, this, _get_bindings_callbacks());
}
Wrapped::Wrapped(const StringName p_godot_class) {
- // TODO: replace C cast by a proper reinterpret_cast once `classdb_construct_object` signature correctly handles `const GDNativeStringNamePtr` param
- // (see: https://github.com/godotengine/godot/pull/67751)
- _owner = godot::internal::gdn_interface->classdb_construct_object((GDNativeStringNamePtr)(p_godot_class._native_ptr()));
+ _owner = godot::internal::gdn_interface->classdb_construct_object(reinterpret_cast<GDNativeConstStringNamePtr>(p_godot_class._native_ptr()));
}
Wrapped::Wrapped(GodotObject *p_godot_object) {