mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
Revert "G_DECLARE_*: be const-compliant"
This reverts commit 52f23db74a
.
Constifying these macros make C++ compilers and GCC with -Wcast-qual
warn during compilation of GLib and projects depending on GLib.
Since using const with GObject instances is not a common coding
practice, it's better to revert than trying to make every sigle GType
function const-safe (and possibly add more compiler warnings in the
process).
https://bugzilla.gnome.org/show_bug.cgi?id=745068
This commit is contained in:
parent
476f30a004
commit
617189f28c
@ -1395,9 +1395,9 @@ guint g_type_get_type_registration_serial (void);
|
||||
\
|
||||
_GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName) \
|
||||
\
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gconstpointer ptr) { \
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gconstpointer ptr) { \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
@ -1486,15 +1486,15 @@ guint g_type_get_type_registration_serial (void);
|
||||
\
|
||||
_GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName) \
|
||||
\
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gconstpointer ptr) { \
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
|
||||
static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_CLASS (gconstpointer ptr) { \
|
||||
static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_CLASS (gpointer ptr) { \
|
||||
return G_TYPE_CHECK_CLASS_CAST (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gconstpointer ptr) { \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME##_CLASS (gconstpointer ptr) { \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME##_CLASS (gpointer ptr) { \
|
||||
return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); } \
|
||||
static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_GET_CLASS (gconstpointer ptr) { \
|
||||
static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_GET_CLASS (gpointer ptr) { \
|
||||
return G_TYPE_INSTANCE_GET_CLASS (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
@ -1564,11 +1564,11 @@ guint g_type_get_type_registration_serial (void);
|
||||
\
|
||||
_GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, PrerequisiteName) \
|
||||
\
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gconstpointer ptr) { \
|
||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gconstpointer ptr) { \
|
||||
static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
|
||||
return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
|
||||
static inline ModuleObjName##Interface * MODULE##_##OBJ_NAME##_GET_IFACE (gconstpointer ptr) { \
|
||||
static inline ModuleObjName##Interface * MODULE##_##OBJ_NAME##_GET_IFACE (gpointer ptr) { \
|
||||
return G_TYPE_INSTANCE_GET_INTERFACE (ptr, module_obj_name##_get_type (), ModuleObjName##Interface); } \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user