[gnome-maps/wip/rishi/silence-warnings: 1/5] lib: Silence -Wpointer-sign
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/rishi/silence-warnings: 1/5] lib: Silence -Wpointer-sign
- Date: Fri, 19 Oct 2018 09:57:48 +0000 (UTC)
commit 3c1958842f6380761bcb2056b14a87bb3ed00e03
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Oct 19 11:31:50 2018 +0200
lib: Silence -Wpointer-sign
xmlChar is an unsigned char, so it can't be interchangeably used with
string literals or signed chars.
lib/maps-osm-changeset.c | 14 +++++++-------
lib/maps-osm-object.c | 24 ++++++++++++------------
lib/maps-osm-relation.c | 10 +++++-----
lib/maps-osm-way.c | 4 ++--
lib/maps-osm.c | 6 +++---
5 files changed, 29 insertions(+), 29 deletions(-)
---
diff --git a/lib/maps-osm-changeset.c b/lib/maps-osm-changeset.c
index 00edd41..9dcc274 100644
--- a/lib/maps-osm-changeset.c
+++ b/lib/maps-osm-changeset.c
@@ -152,9 +152,9 @@ maps_osm_changeset_create_tag_node (const char *key, const char * value)
{
xmlNodePtr node;
- node = xmlNewNode (NULL, "tag");
- xmlNewProp (node, "k", key);
- xmlNewProp (node, "v", value);
+ node = xmlNewNode (NULL, (xmlChar *) "tag");
+ xmlNewProp (node, (xmlChar *) "k", (xmlChar *) key);
+ xmlNewProp (node, (xmlChar *) "v", (xmlChar *) value);
return node;
}
@@ -170,9 +170,9 @@ maps_osm_changeset_serialize (const MapsOSMChangeset *changeset)
xmlChar *result;
int size;
- doc = xmlNewDoc ("1.0");
- osm_node = xmlNewNode (NULL, "osm");
- changeset_node = xmlNewNode (NULL, "changeset");
+ doc = xmlNewDoc ((xmlChar *) "1.0");
+ osm_node = xmlNewNode (NULL, (xmlChar *) "osm");
+ changeset_node = xmlNewNode (NULL, (xmlChar *) "changeset");
comment_node =
maps_osm_changeset_create_tag_node ("comment", changeset->priv->comment);
created_by_node =
@@ -186,5 +186,5 @@ maps_osm_changeset_serialize (const MapsOSMChangeset *changeset)
xmlDocDumpMemory (doc, &result, &size);
xmlFreeDoc (doc);
- return result;
+ return (char *) result;
}
diff --git a/lib/maps-osm-object.c b/lib/maps-osm-object.c
index c171925..0ddde89 100644
--- a/lib/maps-osm-object.c
+++ b/lib/maps-osm-object.c
@@ -233,9 +233,9 @@ maps_osm_object_foreach_tag (gpointer key, gpointer value, gpointer user_data)
{
xmlNodePtr tag_node;
- tag_node = xmlNewNode (NULL, "tag");
- xmlNewProp (tag_node, "k", key);
- xmlNewProp (tag_node, "v", val);
+ tag_node = xmlNewNode (NULL, (xmlChar *) "tag");
+ xmlNewProp (tag_node, (xmlChar *) "k", (xmlChar *) key);
+ xmlNewProp (tag_node, (xmlChar *) "v", (xmlChar *) val);
xmlAddChild (object_node, tag_node);
}
}
@@ -244,8 +244,8 @@ static void
maps_osm_object_foreach_type_attr (gpointer key, gpointer value,
gpointer user_data)
{
- const char *name = (const char *) key;
- const char *val = (const char *) value;
+ const xmlChar *name = (const xmlChar *) key;
+ const xmlChar *val = (const xmlChar *) value;
xmlNodePtr object_node = (xmlNodePtr) user_data;
xmlNewProp (object_node, name, val);
@@ -262,32 +262,32 @@ maps_osm_object_to_xml (const MapsOSMObject *object)
GHashTable *type_attrs;
xmlNodePtr type_sub_nodes;
- doc = xmlNewDoc ("1.0");
- osm_node = xmlNewNode (NULL, "osm");
+ 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 ();
- object_node = xmlNewNode (NULL, type);
+ object_node = xmlNewNode (NULL, (const xmlChar *) type);
/* add common OSM attributes */
if (priv->id != 0)
{
char buf[32];
g_snprintf (buf, 32, "%" G_GUINT64_FORMAT, priv->id);
- xmlNewProp (object_node, "id", buf);
+ xmlNewProp (object_node, (xmlChar *) "id", (xmlChar *) buf);
}
if (priv->version != 0)
{
char buf[16];
g_snprintf (buf, 16, "%d", priv->version);
- xmlNewProp (object_node, "version", buf);
+ xmlNewProp (object_node, (xmlChar *) "version", (xmlChar *) buf);
}
if (priv->changeset != 0)
{
char buf[32];
g_snprintf (buf, 32, "%" G_GUINT64_FORMAT, priv->changeset);
- xmlNewProp (object_node, "changeset", buf);
+ xmlNewProp (object_node, (xmlChar *) "changeset", (xmlChar *) buf);
}
/* add OSM tags */
@@ -327,5 +327,5 @@ maps_osm_object_serialize (const MapsOSMObject *object)
xmlDocDumpMemory (doc, &result, &size);
xmlFreeDoc (doc);
- return result;
+ return (char *) result;
}
diff --git a/lib/maps-osm-relation.c b/lib/maps-osm-relation.c
index bb3f424..b8f1303 100644
--- a/lib/maps-osm-relation.c
+++ b/lib/maps-osm-relation.c
@@ -78,16 +78,16 @@ maps_osm_relation_member_type_to_string (guint type)
static xmlNodePtr
maps_osm_relation_get_member_node (const MapsOSMRelationMember *member)
{
- xmlNodePtr node = xmlNewNode (NULL, "member");
+ xmlNodePtr node = xmlNewNode (NULL, (xmlChar *) "member");
char buf[16];
if (member->role)
- xmlNewProp (node, "role", g_strdup (member->role));
+ xmlNewProp (node, (xmlChar *) "role", (xmlChar *) g_strdup (member->role));
- xmlNewProp (node, "type",
- maps_osm_relation_member_type_to_string (member->type));
+ xmlNewProp (node, (xmlChar *) "type",
+ (xmlChar *) maps_osm_relation_member_type_to_string (member->type));
g_snprintf (buf, 16, "%" G_GUINT64_FORMAT, member->ref);
- xmlNewProp (node, "ref", buf);
+ xmlNewProp (node, (xmlChar *) "ref", (xmlChar *) buf);
return node;
}
diff --git a/lib/maps-osm-way.c b/lib/maps-osm-way.c
index 71b35e2..2427d03 100644
--- a/lib/maps-osm-way.c
+++ b/lib/maps-osm-way.c
@@ -50,8 +50,8 @@ maps_osm_way_create_node_xml_node (guint64 ref)
char buf[16];
g_snprintf (buf, 16, "%" G_GUINT64_FORMAT, ref);
- nd = xmlNewNode (NULL, "nd");
- xmlNewProp (nd, "ref", buf);
+ nd = xmlNewNode (NULL, (xmlChar *) "nd");
+ xmlNewProp (nd, (xmlChar *) "ref", (xmlChar *) buf);
return nd;
}
diff --git a/lib/maps-osm.c b/lib/maps-osm.c
index a1aac02..db847dd 100644
--- a/lib/maps-osm.c
+++ b/lib/maps-osm.c
@@ -74,9 +74,9 @@ parse_tag (const xmlAttr *attrs, GHashTable *tags)
for (cur_attr = attrs; cur_attr; cur_attr = cur_attr->next)
{
if (g_str_equal (cur_attr->name, "k"))
- key = cur_attr->children->content, "";
+ key = (char *) cur_attr->children->content, "";
else if (g_str_equal (cur_attr->name, "v"))
- value = cur_attr->children->content, "";
+ value = (char *) cur_attr->children->content, "";
else
g_warning ("Unexpected tag property: %s\n", cur_attr->name);
}
@@ -170,7 +170,7 @@ get_sub_node (xmlDoc *doc)
xmlXPathObject * xpath_obj;
xpath_ctx = xmlXPathNewContext (doc);
- xpath_obj = xmlXPathEvalExpression ("/osm/node|/osm/way|/osm/relation",
+ xpath_obj = xmlXPathEvalExpression ((xmlChar *) "/osm/node|/osm/way|/osm/relation",
xpath_ctx);
if (xpath_obj && xpath_obj->nodesetval && xpath_obj->nodesetval->nodeNr > 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]