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 738859f49b)
pull/1572/head
Klaim (Joël Lamotte) 2024-08-08 02:10:41 +02:00 committed by David Snopek
parent 9a4ba00b0e
commit d529fc5b69
1 changed files with 5 additions and 5 deletions

View File

@ -120,7 +120,7 @@ struct EngineClassRegistration {
#define GDCLASS(m_class, m_inherits) \ #define GDCLASS(m_class, m_inherits) \
private: \ private: \
void operator=(const m_class &p_rval) {} \ void operator=(const m_class & /*p_rval*/) {} \
friend class ::godot::ClassDB; \ friend class ::godot::ClassDB; \
\ \
protected: \ protected: \
@ -308,7 +308,7 @@ public:
} \ } \
} \ } \
\ \
static void free(void *data, GDExtensionClassInstancePtr ptr) { \ static void free(void * /*data*/, GDExtensionClassInstancePtr ptr) { \
if (ptr) { \ if (ptr) { \
m_class *cls = reinterpret_cast<m_class *>(ptr); \ m_class *cls = reinterpret_cast<m_class *>(ptr); \
cls->~m_class(); \ cls->~m_class(); \
@ -316,14 +316,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; \ 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; \ return true; \
} \ } \
\ \