diff options
author | rune-scape <spartacrafter@gmail.com> | 2024-06-17 13:05:19 -0700 |
---|---|---|
committer | rune-scape <spartacrafter@gmail.com> | 2024-06-17 19:06:40 -0700 |
commit | ca916a536af39c99927c3587b6988168f7c285ff (patch) | |
tree | 7ad6dc1e3a1ab5653821a1a2626d072bc29891fd | |
parent | 8c70c18132441d11a88dd96b462d89d8eba4c2f5 (diff) | |
download | redot-engine-ca916a536af39c99927c3587b6988168f7c285ff.tar.gz |
Object: use correct GDExtensionConstStringNamePtr
-rw-r--r-- | core/object/object.cpp | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp index 0383753f38..97a3a405b9 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -236,20 +236,12 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid } if (_extension && _extension->set) { -// C style pointer casts should never trigger a compiler warning because the risk is assumed by the user, so GCC should keep quiet about it. -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wignored-qualifiers" -#endif - if (_extension->set(_extension_instance, (const GDExtensionStringNamePtr)&p_name, (const GDExtensionVariantPtr)&p_value)) { + if (_extension->set(_extension_instance, (GDExtensionConstStringNamePtr)&p_name, (GDExtensionConstVariantPtr)&p_value)) { if (r_valid) { *r_valid = true; } return; } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif } // Try built-in setter. @@ -323,21 +315,12 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const { } } if (_extension && _extension->get) { -// C style pointer casts should never trigger a compiler warning because the risk is assumed by the user, so GCC should keep quiet about it. -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wignored-qualifiers" -#endif - - if (_extension->get(_extension_instance, (const GDExtensionStringNamePtr)&p_name, (GDExtensionVariantPtr)&ret)) { + if (_extension->get(_extension_instance, (GDExtensionConstStringNamePtr)&p_name, (GDExtensionVariantPtr)&ret)) { if (r_valid) { *r_valid = true; } return ret; } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif } // Try built-in getter. @@ -575,19 +558,11 @@ bool Object::property_can_revert(const StringName &p_name) const { } } -// C style pointer casts should never trigger a compiler warning because the risk is assumed by the user, so GCC should keep quiet about it. -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wignored-qualifiers" -#endif if (_extension && _extension->property_can_revert) { - if (_extension->property_can_revert(_extension_instance, (const GDExtensionStringNamePtr)&p_name)) { + if (_extension->property_can_revert(_extension_instance, (GDExtensionConstStringNamePtr)&p_name)) { return true; } } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif return _property_can_revertv(p_name); } @@ -601,19 +576,11 @@ Variant Object::property_get_revert(const StringName &p_name) const { } } -// C style pointer casts should never trigger a compiler warning because the risk is assumed by the user, so GCC should keep quiet about it. -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wignored-qualifiers" -#endif if (_extension && _extension->property_get_revert) { - if (_extension->property_get_revert(_extension_instance, (const GDExtensionStringNamePtr)&p_name, (GDExtensionVariantPtr)&ret)) { + if (_extension->property_get_revert(_extension_instance, (GDExtensionConstStringNamePtr)&p_name, (GDExtensionVariantPtr)&ret)) { return ret; } } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif if (_property_get_revertv(p_name, ret)) { return ret; |