[gnome-maps/wip/rishi/silence-warnings: 2/5] lib: Silence -Wdiscarded-qualifiers



commit c1e3e02c9de5ac5eb1b765584e56a5066b8c8bed
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Oct 19 11:45:14 2018 +0200

    lib: Silence -Wdiscarded-qualifiers
    
    It's idiomatic not to qualify GObjects as const. The various generated
    macros and functions don't mingle well with const.
    
    This is a localized change to only supress -Wdiscarded-qualifiers.
    Removing the use of the const qualifier will be more invasive.
    
    https://gitlab.gnome.org/GNOME/gnome-maps/merge_requests/15

 lib/maps-osm-node.c     |  2 +-
 lib/maps-osm-object.c   | 10 +++++-----
 lib/maps-osm-relation.c |  2 +-
 lib/maps-osm-way.c      |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/lib/maps-osm-node.c b/lib/maps-osm-node.c
index e056253..05711e0 100644
--- a/lib/maps-osm-node.c
+++ b/lib/maps-osm-node.c
@@ -92,7 +92,7 @@ maps_osm_node_get_xml_tag_name (void)
 static GHashTable *
 maps_osm_node_get_xml_attributes (const MapsOSMObject *object)
 {
-  const MapsOSMNode *node = MAPS_OSMNODE (object);
+  const MapsOSMNode *node = MAPS_OSMNODE ((MapsOSMObject *) object);
   GHashTable *attributes;
   char buf[G_ASCII_DTOSTR_BUF_SIZE];
   
diff --git a/lib/maps-osm-object.c b/lib/maps-osm-object.c
index 0ddde89..f2881b7 100644
--- a/lib/maps-osm-object.c
+++ b/lib/maps-osm-object.c
@@ -193,7 +193,7 @@ maps_osm_object_init (MapsOSMObject *object)
 const char *
 maps_osm_object_get_tag (const MapsOSMObject *object, const char *key)
 {
-  MapsOSMObjectPrivate *priv = maps_osm_object_get_instance_private (object);
+  MapsOSMObjectPrivate *priv = maps_osm_object_get_instance_private ((MapsOSMObject *) object);
 
   g_return_val_if_fail (key != NULL, NULL);
 
@@ -264,8 +264,8 @@ maps_osm_object_to_xml (const MapsOSMObject *object)
 
   doc = xmlNewDoc ((xmlChar *) "1.0");
   osm_node = xmlNewNode (NULL, (xmlChar *) "osm");
-  priv = (MapsOSMObjectPrivate *) maps_osm_object_get_instance_private (object);
-  type = MAPS_OSMOBJECT_GET_CLASS (object)->get_xml_tag_name ();
+  priv = (MapsOSMObjectPrivate *) maps_osm_object_get_instance_private ((MapsOSMObject *) object);
+  type = MAPS_OSMOBJECT_GET_CLASS ((MapsOSMObject *) object)->get_xml_tag_name ();
   object_node = xmlNewNode (NULL, (const xmlChar *) type);
 
   /* add common OSM attributes */
@@ -294,7 +294,7 @@ maps_osm_object_to_xml (const MapsOSMObject *object)
   g_hash_table_foreach (priv->tags, maps_osm_object_foreach_tag, object_node);
   
   /* add type-specific attributes */
-  type_attrs = MAPS_OSMOBJECT_GET_CLASS (object)->get_xml_attributes (object);
+  type_attrs = MAPS_OSMOBJECT_GET_CLASS ((MapsOSMObject *) object)->get_xml_attributes (object);
   if (type_attrs)
     {
       g_hash_table_foreach (type_attrs, maps_osm_object_foreach_type_attr,
@@ -304,7 +304,7 @@ maps_osm_object_to_xml (const MapsOSMObject *object)
  
   /* add type-specific sub-nodes */
   type_sub_nodes =
-    MAPS_OSMOBJECT_GET_CLASS (object)->get_xml_child_nodes (object);
+    MAPS_OSMOBJECT_GET_CLASS ((MapsOSMObject *) object)->get_xml_child_nodes (object);
   if (type_sub_nodes)
     xmlAddChildList (object_node, type_sub_nodes);
 
diff --git a/lib/maps-osm-relation.c b/lib/maps-osm-relation.c
index b8f1303..e4d4efd 100644
--- a/lib/maps-osm-relation.c
+++ b/lib/maps-osm-relation.c
@@ -95,7 +95,7 @@ maps_osm_relation_get_member_node (const MapsOSMRelationMember *member)
 static xmlNodePtr
 maps_osm_relation_get_xml_child_nodes (const MapsOSMObject *object)
 {
-  MapsOSMRelation *relation = MAPS_OSMRELATION (object);
+  MapsOSMRelation *relation = MAPS_OSMRELATION ((MapsOSMObject *) object);
   xmlNodePtr nodes = NULL;
   const GList *members = relation->priv->members;
   
diff --git a/lib/maps-osm-way.c b/lib/maps-osm-way.c
index 2427d03..a215028 100644
--- a/lib/maps-osm-way.c
+++ b/lib/maps-osm-way.c
@@ -59,7 +59,7 @@ maps_osm_way_create_node_xml_node (guint64 ref)
 static xmlNodePtr
 maps_osm_way_get_xml_child_nodes(const MapsOSMObject *object)
 {
-  const MapsOSMWay *way = MAPS_OSMWAY (object);
+  const MapsOSMWay *way = MAPS_OSMWAY ((MapsOSMObject *) object);
   int i;
   xmlNodePtr result;
   xmlNodePtr next;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]