From deaf37120fe8b964b2b9d6b9d79c9553dde4cafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaim=20=28Jo=C3=ABl=20Lamotte=29?= <142265+Klaim@users.noreply.github.com> Date: Thu, 8 Aug 2024 02:10:41 +0200 Subject: [PATCH] removes warnings generated by GDCLASS usage This change removes the warnings (unused parameters) coming from code injected by the GDCLASS macro. Contrary to warnings coming from the normal source code which can be suppressed with most compiles by specifying the include directories of this library as external or system, when the code is injected through a macro it is considered in the context of the user, which is the source code of user of the library. That forces the users to modify their code to hide the warnings coming from the mandatory `GDCLASS` here. That's why it's important to remove these warning from that specific macro and ideally any other macro that the user must use. (cherry picked from commit 738859f49bf34b176116729f56dd2e57e2fd9b86) --- include/godot_cpp/classes/wrapped.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 73d6de40..29334172 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -138,7 +138,7 @@ struct EngineClassRegistration { // every line of the macro different #define GDCLASS(m_class, m_inherits) /***********************************************************************************************************************************************/ \ private: \ - void operator=(const m_class &p_rval) {} \ + void operator=(const m_class & /*p_rval*/) {} \ friend class ::godot::ClassDB; \ \ protected: \ @@ -333,7 +333,7 @@ public: } \ } \ \ - static void free(void *data, GDExtensionClassInstancePtr ptr) { \ + static void free(void * /*data*/, GDExtensionClassInstancePtr ptr) { \ if (ptr) { \ m_class *cls = reinterpret_cast(ptr); \ cls->~m_class(); \ @@ -341,14 +341,14 @@ public: } \ } \ \ - static void *_gde_binding_create_callback(void *p_token, void *p_instance) { \ + static void *_gde_binding_create_callback(void * /*p_token*/, void * /*p_instance*/) { \ return nullptr; \ } \ \ - static void _gde_binding_free_callback(void *p_token, void *p_instance, void *p_binding) { \ + static void _gde_binding_free_callback(void * /*p_token*/, void * /*p_instance*/, void * /*p_binding*/) { \ } \ \ - static GDExtensionBool _gde_binding_reference_callback(void *p_token, void *p_instance, GDExtensionBool p_reference) { \ + static GDExtensionBool _gde_binding_reference_callback(void * /*p_token*/, void * /*p_instance*/, GDExtensionBool /*p_reference*/) { \ return true; \ } \ \