[vinagre] Replace xmlChar casts with BAD_CAST from libxml
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vinagre] Replace xmlChar casts with BAD_CAST from libxml
- Date: Sat, 2 Jul 2011 17:20:53 +0000 (UTC)
commit 8ebda9077b1c5f0c968052ebb3fef3aedb29b172
Author: David King <amigadave amigadave com>
Date: Sat Jul 2 15:59:46 2011 +0200
Replace xmlChar casts with BAD_CAST from libxml
plugins/spice/vinagre-spice-connection.c | 20 ++++++++++----------
plugins/vnc/vinagre-vnc-connection.c | 24 ++++++++++++------------
vinagre/vinagre-bookmarks-migration.c | 16 ++++++++--------
vinagre/vinagre-bookmarks.c | 18 +++++++++---------
vinagre/vinagre-connection.c | 24 ++++++++++++------------
5 files changed, 51 insertions(+), 51 deletions(-)
---
diff --git a/plugins/spice/vinagre-spice-connection.c b/plugins/spice/vinagre-spice-connection.c
index 25a6c0d..869096c 100644
--- a/plugins/spice/vinagre-spice-connection.c
+++ b/plugins/spice/vinagre-spice-connection.c
@@ -204,13 +204,13 @@ spice_fill_writer (VinagreConnection *conn, xmlTextWriter *writer)
VinagreSpiceConnection *spice_conn = VINAGRE_SPICE_CONNECTION (conn);
VINAGRE_CONNECTION_CLASS (vinagre_spice_connection_parent_class)->impl_fill_writer (conn, writer);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"view_only", "%d", spice_conn->priv->view_only);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"scaling", "%d", spice_conn->priv->scaling);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"resize_guest", "%d", spice_conn->priv->resize_guest);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"auto_clipboard", "%d", spice_conn->priv->auto_clipboard);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "view_only", "%d", spice_conn->priv->view_only);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "scaling", "%d", spice_conn->priv->scaling);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "resize_guest", "%d", spice_conn->priv->resize_guest);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "auto_clipboard", "%d", spice_conn->priv->auto_clipboard);
if (spice_conn->priv->ssh_tunnel_host && *spice_conn->priv->ssh_tunnel_host)
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"ssh_tunnel_host", "%s", spice_conn->priv->ssh_tunnel_host);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "ssh_tunnel_host", "%s", spice_conn->priv->ssh_tunnel_host);
}
static void
@@ -226,23 +226,23 @@ spice_parse_item (VinagreConnection *conn, xmlNode *root)
{
s_value = xmlNodeGetContent (curr);
- if (!xmlStrcmp(curr->name, (const xmlChar *)"view_only"))
+ if (!xmlStrcmp(curr->name, BAD_CAST "view_only"))
{
vinagre_spice_connection_set_view_only (spice_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"scaling"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "scaling"))
{
vinagre_spice_connection_set_scaling (spice_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"resize_guest"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "resize_guest"))
{
vinagre_spice_connection_set_resize_guest (spice_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"auto_clipboard"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "auto_clipboard"))
{
vinagre_spice_connection_set_auto_clipboard (spice_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"ssh_tunnel_host"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "ssh_tunnel_host"))
{
vinagre_spice_connection_set_ssh_tunnel_host (spice_conn, (const gchar *)s_value);
}
diff --git a/plugins/vnc/vinagre-vnc-connection.c b/plugins/vnc/vinagre-vnc-connection.c
index 8ce2fc1..2182743 100644
--- a/plugins/vnc/vinagre-vnc-connection.c
+++ b/plugins/vnc/vinagre-vnc-connection.c
@@ -226,14 +226,14 @@ vnc_fill_writer (VinagreConnection *conn, xmlTextWriter *writer)
VinagreVncConnection *vnc_conn = VINAGRE_VNC_CONNECTION (conn);
VINAGRE_CONNECTION_CLASS (vinagre_vnc_connection_parent_class)->impl_fill_writer (conn, writer);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"view_only", "%d", vnc_conn->priv->view_only);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"scaling", "%d", vnc_conn->priv->scaling);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"keep_ratio", "%d", vnc_conn->priv->keep_ratio);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"depth_profile", "%d", vnc_conn->priv->depth_profile);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"lossy_encoding", "%d", vnc_conn->priv->lossy_encoding);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "view_only", "%d", vnc_conn->priv->view_only);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "scaling", "%d", vnc_conn->priv->scaling);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "keep_ratio", "%d", vnc_conn->priv->keep_ratio);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "depth_profile", "%d", vnc_conn->priv->depth_profile);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "lossy_encoding", "%d", vnc_conn->priv->lossy_encoding);
if (vnc_conn->priv->ssh_tunnel_host && *vnc_conn->priv->ssh_tunnel_host)
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"ssh_tunnel_host", "%s", vnc_conn->priv->ssh_tunnel_host);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "ssh_tunnel_host", "%s", vnc_conn->priv->ssh_tunnel_host);
}
static void
@@ -249,28 +249,28 @@ vnc_parse_item (VinagreConnection *conn, xmlNode *root)
{
s_value = xmlNodeGetContent (curr);
- if (!xmlStrcmp(curr->name, (const xmlChar *)"view_only"))
+ if (!xmlStrcmp(curr->name, BAD_CAST "view_only"))
{
vinagre_vnc_connection_set_view_only (vnc_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"scaling"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "scaling"))
{
if (!scaling_command_line)
vinagre_vnc_connection_set_scaling (vnc_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"keep_ratio"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "keep_ratio"))
{
vinagre_vnc_connection_set_keep_ratio (vnc_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"depth_profile"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "depth_profile"))
{
vinagre_vnc_connection_set_depth_profile (vnc_conn, atoi((const char *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"lossy_encoding"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "lossy_encoding"))
{
vinagre_vnc_connection_set_lossy_encoding (vnc_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"ssh_tunnel_host"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "ssh_tunnel_host"))
{
vinagre_vnc_connection_set_ssh_tunnel_host (vnc_conn, (const gchar *)s_value);
}
diff --git a/vinagre/vinagre-bookmarks-migration.c b/vinagre/vinagre-bookmarks-migration.c
index dd4304c..3fae66b 100644
--- a/vinagre/vinagre-bookmarks-migration.c
+++ b/vinagre/vinagre-bookmarks-migration.c
@@ -50,8 +50,8 @@ fill_xml (GSList *list, xmlTextWriter *writer)
switch (vinagre_bookmarks_entry_get_node (entry))
{
case VINAGRE_BOOKMARKS_ENTRY_NODE_FOLDER:
- xmlTextWriterStartElement (writer, (const xmlChar *)"folder");
- xmlTextWriterWriteAttribute (writer, (const xmlChar *)"name", (const xmlChar *)vinagre_bookmarks_entry_get_name (entry));
+ xmlTextWriterStartElement (writer, BAD_CAST "folder");
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "name", BAD_CAST vinagre_bookmarks_entry_get_name (entry));
fill_xml (vinagre_bookmarks_entry_get_children (entry), writer);
xmlTextWriterEndElement (writer);
@@ -60,11 +60,11 @@ fill_xml (GSList *list, xmlTextWriter *writer)
case VINAGRE_BOOKMARKS_ENTRY_NODE_CONN:
conn = vinagre_bookmarks_entry_get_conn (entry);
- xmlTextWriterStartElement (writer, (const xmlChar *)"item");
- xmlTextWriterWriteElement (writer, (const xmlChar *)"name", (const xmlChar *)vinagre_connection_get_name (conn));
- xmlTextWriterWriteElement (writer, (const xmlChar *)"host", (const xmlChar *)vinagre_connection_get_host (conn));
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"port", "%d", vinagre_connection_get_port (conn));
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"fullscreen", "%d", vinagre_connection_get_fullscreen (conn));
+ xmlTextWriterStartElement (writer, BAD_CAST "item");
+ xmlTextWriterWriteElement (writer, BAD_CAST "name", BAD_CAST vinagre_connection_get_name (conn));
+ xmlTextWriterWriteElement (writer, BAD_CAST "host", BAD_CAST vinagre_connection_get_host (conn));
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "port", "%d", vinagre_connection_get_port (conn));
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "fullscreen", "%d", vinagre_connection_get_fullscreen (conn));
xmlTextWriterEndElement (writer);
break;
@@ -109,7 +109,7 @@ save_to_file (GSList *entries, const gchar *filename)
goto finalize;
}
- rc = xmlTextWriterStartElement (writer, (const xmlChar *)"vinagre-bookmarks");
+ rc = xmlTextWriterStartElement (writer, BAD_CAST "vinagre-bookmarks");
if (rc < 0)
{
g_warning (_("Error while migrating bookmarks: Failed to initialize the XML structure"));
diff --git a/vinagre/vinagre-bookmarks.c b/vinagre/vinagre-bookmarks.c
index 9ee96ae..968be99 100644
--- a/vinagre/vinagre-bookmarks.c
+++ b/vinagre/vinagre-bookmarks.c
@@ -235,8 +235,8 @@ vinagre_bookmarks_save_fill_xml (GSList *list, xmlTextWriter *writer)
switch (vinagre_bookmarks_entry_get_node (entry))
{
case VINAGRE_BOOKMARKS_ENTRY_NODE_FOLDER:
- xmlTextWriterStartElement (writer, (const xmlChar *)"folder");
- xmlTextWriterWriteAttribute (writer, (const xmlChar *)"name", (const xmlChar *)vinagre_bookmarks_entry_get_name (entry));
+ xmlTextWriterStartElement (writer, BAD_CAST "folder");
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "name", BAD_CAST vinagre_bookmarks_entry_get_name (entry));
vinagre_bookmarks_save_fill_xml (vinagre_bookmarks_entry_get_children (entry), writer);
xmlTextWriterEndElement (writer);
@@ -245,7 +245,7 @@ vinagre_bookmarks_save_fill_xml (GSList *list, xmlTextWriter *writer)
case VINAGRE_BOOKMARKS_ENTRY_NODE_CONN:
conn = vinagre_bookmarks_entry_get_conn (entry);
- xmlTextWriterStartElement (writer, (const xmlChar *)"item");
+ xmlTextWriterStartElement (writer, BAD_CAST "item");
vinagre_connection_fill_writer (conn, writer);
xmlTextWriterEndElement (writer);
break;
@@ -269,7 +269,7 @@ vinagre_bookmarks_parse_item (xmlNode *root)
/* Loop to discover the protocol */
for (curr = root->children; curr; curr = curr->next)
{
- if (xmlStrcmp(curr->name, (const xmlChar *)"protocol"))
+ if (xmlStrcmp(curr->name, BAD_CAST "protocol"))
continue;
s_value = xmlNodeGetContent (curr);
@@ -312,9 +312,9 @@ vinagre_bookmarks_parse_xml (VinagreBookmarks *book, xmlNode *root, VinagreBookm
{
if (curr->type == XML_ELEMENT_NODE)
{
- if (!xmlStrcmp(curr->name, (const xmlChar *)"folder"))
+ if (!xmlStrcmp(curr->name, BAD_CAST "folder"))
{
- folder_name = xmlGetProp (curr, (const xmlChar *)"name");
+ folder_name = xmlGetProp (curr, BAD_CAST "name");
if (folder_name && *folder_name)
{
entry = vinagre_bookmarks_entry_new_folder ((const gchar *) folder_name);
@@ -329,7 +329,7 @@ vinagre_bookmarks_parse_xml (VinagreBookmarks *book, xmlNode *root, VinagreBookm
}
xmlFree (folder_name);
}
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"item"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "item"))
{
entry = vinagre_bookmarks_parse_item (curr);
if (entry)
@@ -374,7 +374,7 @@ vinagre_bookmarks_update_from_file (VinagreBookmarks *book)
return;
}
- if (xmlStrcmp (root->name, (const xmlChar *) "vinagre-bookmarks"))
+ if (xmlStrcmp (root->name, BAD_CAST "vinagre-bookmarks"))
{
g_warning (_("Error while initializing bookmarks: The file is not a vinagre bookmarks file"));
xmlFreeDoc (doc);
@@ -467,7 +467,7 @@ vinagre_bookmarks_save_to_file (VinagreBookmarks *book)
goto finalize;
}
- rc = xmlTextWriterStartElement (writer, (const xmlChar *)"vinagre-bookmarks");
+ rc = xmlTextWriterStartElement (writer, BAD_CAST "vinagre-bookmarks");
if (rc < 0)
{
g_warning (_("Error while saving bookmarks: Failed to initialize the XML structure"));
diff --git a/vinagre/vinagre-connection.c b/vinagre/vinagre-connection.c
index ba51a83..cbc410b 100644
--- a/vinagre/vinagre-connection.c
+++ b/vinagre/vinagre-connection.c
@@ -182,12 +182,12 @@ static void
default_fill_writer (VinagreConnection *conn, xmlTextWriter *writer)
{
if (conn->priv->protocol)
- xmlTextWriterWriteElement (writer, (const xmlChar *)"protocol", (const xmlChar *)conn->priv->protocol);
- xmlTextWriterWriteElement (writer, (const xmlChar *)"name", (const xmlChar *)conn->priv->name);
- xmlTextWriterWriteElement (writer, (const xmlChar *)"host", (const xmlChar *)conn->priv->host);
- xmlTextWriterWriteElement (writer, (const xmlChar *)"username", (const xmlChar *) (conn->priv->username ? conn->priv->username : ""));
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"port", "%d", conn->priv->port);
- xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"fullscreen", "%d", conn->priv->fullscreen);
+ xmlTextWriterWriteElement (writer, BAD_CAST "protocol", BAD_CAST conn->priv->protocol);
+ xmlTextWriterWriteElement (writer, BAD_CAST "name", BAD_CAST conn->priv->name);
+ xmlTextWriterWriteElement (writer, BAD_CAST "host", BAD_CAST conn->priv->host);
+ xmlTextWriterWriteElement (writer, BAD_CAST "username", BAD_CAST (conn->priv->username ? conn->priv->username : ""));
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "port", "%d", conn->priv->port);
+ xmlTextWriterWriteFormatElement (writer, BAD_CAST "fullscreen", "%d", conn->priv->fullscreen);
}
static void
@@ -200,15 +200,15 @@ default_parse_item (VinagreConnection *conn, xmlNode *root)
{
s_value = xmlNodeGetContent (curr);
- if (!xmlStrcmp(curr->name, (const xmlChar *)"host"))
+ if (!xmlStrcmp(curr->name, BAD_CAST "host"))
vinagre_connection_set_host (conn, (const gchar *)s_value);
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"name"))
- vinagre_connection_set_name (conn, (const gchar *)s_value);
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"username"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "name"))
+ vinagre_connection_set_name (conn, BAD_CAST s_value);
+ else if (!xmlStrcmp(curr->name, BAD_CAST "username"))
vinagre_connection_set_username (conn, (const gchar *)s_value);
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"port"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "port"))
vinagre_connection_set_port (conn, atoi ((const char *)s_value));
- else if (!xmlStrcmp(curr->name, (const xmlChar *)"fullscreen"))
+ else if (!xmlStrcmp(curr->name, BAD_CAST "fullscreen"))
vinagre_connection_set_fullscreen (conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
xmlFree (s_value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]