mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 11:12:11 +01:00
G_DECLARE_*: be const-compliant
switching to the old macros boilerplate to G_DECLARE_* a lot of warnings start to pop when *_IS_A_* or such are called from a const context. Fix this by taking const pointers as parameters https://bugzilla.gnome.org/show_bug.cgi?id=745068 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This commit is contained in:
parent
3f596074a9
commit
52f23db74a
@ -1392,9 +1392,9 @@ guint g_type_get_type_registration_serial (void);
|
||||
\
|
||||
_GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName) \
|
||||
\
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gconstpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gconstpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
@ -1483,15 +1483,15 @@ guint g_type_get_type_registration_serial (void);
|
||||
\
|
||||
_GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName) \
|
||||
\
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gconstpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
|
||||
static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_CLASS (gpointer ptr) { \
|
||||
static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_CLASS (gconstpointer ptr) { \
|
||||
return G_TYPE_CHECK_CLASS_CAST (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gconstpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME##_CLASS (gpointer ptr) { \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME##_CLASS (gconstpointer ptr) { \
|
||||
return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); } \
|
||||
static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_GET_CLASS (gpointer ptr) { \
|
||||
static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_GET_CLASS (gconstpointer ptr) { \
|
||||
return G_TYPE_INSTANCE_GET_CLASS (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
@ -1561,11 +1561,11 @@ guint g_type_get_type_registration_serial (void);
|
||||
\
|
||||
_GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, PrerequisiteName) \
|
||||
\
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gconstpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gconstpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
|
||||
static inline ModuleObjName##Interface * MODULE##_##OBJ_NAME##_GET_IFACE (gpointer ptr) { \
|
||||
static inline ModuleObjName##Interface * MODULE##_##OBJ_NAME##_GET_IFACE (gconstpointer ptr) { \
|
||||
return G_TYPE_INSTANCE_GET_INTERFACE (ptr, module_obj_name##_get_type (), ModuleObjName##Interface); } \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user