[glib] Revert "G_DECLARE_*: be const-compliant"
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Revert "G_DECLARE_*: be const-compliant"
- Date: Mon, 18 Jan 2016 18:53:44 +0000 (UTC)
commit 617189f28c5d3eb05d7d09fe453b6f98c87d8a40
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Jan 18 18:46:12 2016 +0000
Revert "G_DECLARE_*: be const-compliant"
This reverts commit 52f23db74ad58b822bafb0fdcac106489d864f8c.
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
gobject/gtype.h | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gobject/gtype.h b/gobject/gtype.h
index 25f5bc1..7c3936b 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]