Commit 52f23db7 authored by Marc-Antoine Perennou's avatar Marc-Antoine Perennou

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=745068Signed-off-by: Marc-Antoine Perennou's avatarMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
parent 3f596074
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment