summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2006-11-03 18:31:08 +0000
committerDan Winship <danw@src.gnome.org>2006-11-03 18:31:08 +0000
commit5d1ec83b575dfd265de78c3b584527b7422611e1 (patch)
tree99de41240cde062d75d7da63f922da3966edf871
parentc1a212725b1b2ddacc156efba72ecc3f84fdac28 (diff)
downloadlibsoup-5d1ec83b575dfd265de78c3b584527b7422611e1.tar.gz
fix lots of warnings. Partially from patches from Andrew W. Nosenko, and
* libsoup/*.c: fix lots of warnings. Partially from patches from Andrew W. Nosenko, and also some fixes from libsoup-pre214-branch.
-rw-r--r--ChangeLog5
-rw-r--r--libsoup/soup-auth-digest.c6
-rw-r--r--libsoup/soup-connection-ntlm.c27
-rw-r--r--libsoup/soup-message.c4
-rw-r--r--libsoup/soup-misc.c17
-rw-r--r--libsoup/soup-soap-message.c70
-rw-r--r--libsoup/soup-soap-response.c20
-rw-r--r--libsoup/soup-socket.c8
-rw-r--r--libsoup/soup-uri.c2
-rw-r--r--libsoup/soup-xmlrpc-message.c55
-rw-r--r--libsoup/soup-xmlrpc-response.c68
-rw-r--r--tests/getbug.c2
-rw-r--r--tests/uri-parsing.c6
13 files changed, 148 insertions, 142 deletions
diff --git a/ChangeLog b/ChangeLog
index cee7ee17..8009d005 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2006-11-03 Dan Winship <danw@novell.com>
+ * libsoup/*.c: fix lots of warnings. Partially from patches from
+ Andrew W. Nosenko, and also some fixes from libsoup-pre214-branch.
+
+2006-11-03 Dan Winship <danw@novell.com>
+
* Makefile.am (uninstall-local): uninstall the pkgconfig file.
Based on #356809 from Matthew Barnes.
diff --git a/libsoup/soup-auth-digest.c b/libsoup/soup-auth-digest.c
index ec24e82f..bf54d0dd 100644
--- a/libsoup/soup-auth-digest.c
+++ b/libsoup/soup-auth-digest.c
@@ -104,20 +104,20 @@ soup_auth_digest_class_init (SoupAuthDigestClass *auth_digest_class)
}
typedef struct {
- char *name;
+ const char *name;
guint type;
} DataType;
static DataType qop_types[] = {
{ "auth", QOP_AUTH },
{ "auth-int", QOP_AUTH_INT },
- { NULL, NULL }
+ { NULL, 0 }
};
static DataType algorithm_types[] = {
{ "MD5", ALGORITHM_MD5 },
{ "MD5-sess", ALGORITHM_MD5_SESS },
- { NULL, NULL }
+ { NULL, 0 }
};
static guint
diff --git a/libsoup/soup-connection-ntlm.c b/libsoup/soup-connection-ntlm.c
index 4ca38fff..27b8cd06 100644
--- a/libsoup/soup-connection-ntlm.c
+++ b/libsoup/soup-connection-ntlm.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-ntlm-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* soup-connection-ntlm.c: NTLM-using Connection
*
@@ -330,8 +330,9 @@ soup_ntlm_parse_challenge (const char *challenge,
{
int clen, decodelen;
NTLMString domain;
- char *chall;
- int state, save;
+ guchar *chall;
+ int state;
+ unsigned int save;
if (strncmp (challenge, "NTLM ", 5) != 0)
return FALSE;
@@ -340,7 +341,7 @@ soup_ntlm_parse_challenge (const char *challenge,
chall = g_malloc (decodelen);
state = save = 0;
- clen = soup_base64_decode_step ((guchar *) challenge + 5,
+ clen = soup_base64_decode_step ((const guchar *) challenge + 5,
decodelen,
chall,
&state,
@@ -362,7 +363,7 @@ soup_ntlm_parse_challenge (const char *challenge,
return FALSE;
}
- *default_domain = g_strndup (chall + domain.offset, domain.length);
+ *default_domain = g_strndup ((char *)chall + domain.offset, domain.length);
}
if (nonce) {
@@ -384,13 +385,13 @@ soup_ntlm_response (const char *nonce,
int hlen, dlen, ulen, offset;
guchar hash[21], lm_resp[24], nt_resp[24];
NTLMResponse resp;
- unsigned char *out, *p;
+ guchar *out, *p;
int state, save;
nt_hash (password, hash);
- calc_response (hash, nonce, nt_resp);
+ calc_response (hash, (guchar *)nonce, nt_resp);
lanmanager_hash (password, hash);
- calc_response (hash, nonce, lm_resp);
+ calc_response (hash, (guchar *)nonce, lm_resp);
memset (&resp, 0, sizeof (resp));
memcpy (resp.header, NTLM_RESPONSE_HEADER, sizeof (resp.header));
@@ -410,7 +411,7 @@ soup_ntlm_response (const char *nonce,
ntlm_set_string (&resp.nt_resp, &offset, sizeof (nt_resp));
out = g_malloc (((offset + 3) * 4) / 3 + 6);
- strncpy (out, "NTLM ", 5);
+ strncpy ((char *)out, "NTLM ", 5);
p = out + 5;
state = save = 0;
@@ -421,19 +422,19 @@ soup_ntlm_response (const char *nonce,
p,
&state,
&save);
- p += soup_base64_encode_step ((guchar *) domain,
+ p += soup_base64_encode_step ((const guchar *) domain,
dlen,
FALSE,
p,
&state,
&save);
- p += soup_base64_encode_step ((guchar *) user,
+ p += soup_base64_encode_step ((const guchar *) user,
ulen,
FALSE,
p,
&state,
&save);
- p += soup_base64_encode_step ((guchar *) host,
+ p += soup_base64_encode_step ((const guchar *) host,
hlen,
FALSE,
p,
@@ -454,7 +455,7 @@ soup_ntlm_response (const char *nonce,
&save);
*p = '\0';
- return out;
+ return (char *)out;
}
/* DES utils */
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index 93fd1ad7..ac16aa09 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -631,7 +631,7 @@ soup_message_add_header (GHashTable *hash, const char *name, const char *value)
old_value = g_hash_table_lookup (hash, name);
if (old_value)
- g_slist_append (old_value, g_strdup (value));
+ old_value = g_slist_append (old_value, g_strdup (value));
else {
g_hash_table_insert (hash, g_strdup (name),
g_slist_append (NULL, g_strdup (value)));
@@ -1110,7 +1110,7 @@ soup_message_add_chunk (SoupMessage *msg,
chunk->length = length;
if (priv->chunks) {
- g_slist_append (priv->last_chunk, chunk);
+ priv->last_chunk = g_slist_append (priv->last_chunk, chunk);
priv->last_chunk = priv->last_chunk->next;
} else {
priv->chunks = priv->last_chunk =
diff --git a/libsoup/soup-misc.c b/libsoup/soup-misc.c
index 8fb59951..f3d194b6 100644
--- a/libsoup/soup-misc.c
+++ b/libsoup/soup-misc.c
@@ -53,7 +53,7 @@ soup_str_case_equal (gconstpointer v1,
/* Base64 utils (straight from camel-mime-utils.c) */
#define d(x)
-static char *base64_alphabet =
+static const char *base64_alphabet =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/*
@@ -217,11 +217,10 @@ char *
soup_base64_encode (const char *text, int len)
{
unsigned char *out;
- int state = 0, outlen;
- unsigned int save = 0;
+ int state = 0, outlen, save = 0;
out = g_malloc (len * 4 / 3 + 5);
- outlen = soup_base64_encode_close (text,
+ outlen = soup_base64_encode_close ((const guchar *)text,
len,
FALSE,
out,
@@ -318,15 +317,17 @@ char *
soup_base64_decode (const char *text,
int *out_len)
{
- char *ret;
- int inlen, state = 0, save = 0;
+ guchar *ret;
+ int inlen, state = 0;
+ unsigned int save = 0;
inlen = strlen (text);
ret = g_malloc0 (inlen);
- *out_len = soup_base64_decode_step (text, inlen, ret, &state, &save);
+ *out_len = soup_base64_decode_step ((const guchar *)text, inlen,
+ ret, &state, &save);
- return ret;
+ return (char *)ret;
}
typedef struct {
diff --git a/libsoup/soup-soap-message.c b/libsoup/soup-soap-message.c
index 1bd04a7c..364a7b1a 100644
--- a/libsoup/soup-soap-message.c
+++ b/libsoup/soup-soap-message.c
@@ -56,7 +56,7 @@ soup_soap_message_init (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
/* initialize XML structures */
- priv->doc = xmlNewDoc ((xmlChar *)"1.0");
+ priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
priv->doc->standalone = FALSE;
priv->doc->encoding = xmlCharStrdup ("UTF-8");
}
@@ -69,11 +69,11 @@ fetch_ns (SoupSoapMessage *msg, const char *prefix, const char *ns_uri)
xmlNsPtr ns = NULL;
if (prefix && ns_uri)
- ns = xmlNewNs (priv->last_node, (xmlChar *)ns_uri, (xmlChar *)prefix);
+ ns = xmlNewNs (priv->last_node, (const xmlChar *)ns_uri, (const xmlChar *)prefix);
else if (prefix && !ns_uri) {
- ns = xmlSearchNs (priv->doc, priv->last_node, (xmlChar *)prefix);
+ ns = xmlSearchNs (priv->doc, priv->last_node, (const xmlChar *)prefix);
if (!ns)
- ns = xmlNewNs (priv->last_node, (xmlChar *)"", (xmlChar *)prefix);
+ ns = xmlNewNs (priv->last_node, (const xmlChar *)"", (const xmlChar *)prefix);
}
return ns;
@@ -169,12 +169,12 @@ soup_soap_message_start_envelope (SoupSoapMessage *msg)
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = priv->doc->xmlRootNode =
- xmlNewDocNode (priv->doc, NULL, (xmlChar *)"Envelope", NULL);
+ xmlNewDocNode (priv->doc, NULL, (const xmlChar *)"Envelope", NULL);
priv->soap_ns = xmlNewNs (priv->doc->xmlRootNode,
priv->env_uri ? priv->env_uri :
- (xmlChar *)"http://schemas.xmlsoap.org/soap/envelope/",
- priv->env_prefix ? priv->env_prefix : (xmlChar *)"SOAP-ENV");
+ (const xmlChar *)"http://schemas.xmlsoap.org/soap/envelope/",
+ priv->env_prefix ? priv->env_prefix : (const xmlChar *)"SOAP-ENV");
if (priv->env_uri) {
xmlFree (priv->env_uri);
priv->env_uri = NULL;
@@ -187,17 +187,17 @@ soup_soap_message_start_envelope (SoupSoapMessage *msg)
xmlSetNs (priv->doc->xmlRootNode, priv->soap_ns);
xmlNewNs (priv->doc->xmlRootNode,
- (xmlChar *)"http://schemas.xmlsoap.org/soap/encoding/",
- (xmlChar *)"SOAP-ENC");
+ (const xmlChar *)"http://schemas.xmlsoap.org/soap/encoding/",
+ (const xmlChar *)"SOAP-ENC");
xmlNewNs (priv->doc->xmlRootNode,
- (xmlChar *)"http://www.w3.org/1999/XMLSchema",
- (xmlChar *)"xsd");
+ (const xmlChar *)"http://www.w3.org/1999/XMLSchema",
+ (const xmlChar *)"xsd");
xmlNewNs (priv->doc->xmlRootNode,
- (xmlChar *)"http://schemas.xmlsoap.org/soap/envelope/",
- (xmlChar *)"SOAP-ENV");
+ (const xmlChar *)"http://schemas.xmlsoap.org/soap/envelope/",
+ (const xmlChar *)"SOAP-ENV");
priv->xsi_ns = xmlNewNs (priv->doc->xmlRootNode,
- (xmlChar *)"http://www.w3.org/1999/XMLSchema-instance",
- (xmlChar *)"xsi");
+ (const xmlChar *)"http://www.w3.org/1999/XMLSchema-instance",
+ (const xmlChar *)"xsi");
}
/**
@@ -231,7 +231,7 @@ soup_soap_message_start_body (SoupSoapMessage *msg)
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
- (xmlChar *)"Body", NULL);
+ (const xmlChar *)"Body", NULL);
priv->body_started = TRUE;
}
@@ -280,7 +280,7 @@ soup_soap_message_start_element (SoupSoapMessage *msg,
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)name, NULL);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)name, NULL);
xmlSetNs (priv->last_node, fetch_ns (msg, prefix, ns_uri));
@@ -333,12 +333,12 @@ soup_soap_message_start_fault (SoupSoapMessage *msg,
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
- (xmlChar *)"Fault", NULL);
- xmlNewChild (priv->last_node, priv->soap_ns, (xmlChar *)"faultcode", (xmlChar *)faultcode);
- xmlNewChild (priv->last_node, priv->soap_ns, (xmlChar *)"faultstring", (xmlChar *)faultstring);
+ (const xmlChar *)"Fault", NULL);
+ xmlNewChild (priv->last_node, priv->soap_ns, (const xmlChar *)"faultcode", (const xmlChar *)faultcode);
+ xmlNewChild (priv->last_node, priv->soap_ns, (const xmlChar *)"faultstring", (const xmlChar *)faultstring);
priv->last_node = xmlNewChild (priv->last_node, priv->soap_ns,
- (xmlChar *)"faultfactor", (xmlChar *)faultfactor);
+ (const xmlChar *)"faultfactor", (const xmlChar *)faultfactor);
if (!faultfactor)
soup_soap_message_set_null (msg);
@@ -375,7 +375,7 @@ soup_soap_message_start_fault_detail (SoupSoapMessage *msg)
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
- (xmlChar *)"detail",
+ (const xmlChar *)"detail",
NULL);
}
@@ -412,7 +412,7 @@ soup_soap_message_start_header (SoupSoapMessage *msg)
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node, priv->soap_ns,
- (xmlChar *)"Header", NULL);
+ (const xmlChar *)"Header", NULL);
}
/**
@@ -454,9 +454,9 @@ soup_soap_message_start_header_element (SoupSoapMessage *msg,
soup_soap_message_start_element (msg, name, prefix, ns_uri);
if (actor_uri)
- xmlNewNsProp (priv->last_node, priv->soap_ns, (xmlChar *)"actorUri", (xmlChar *)actor_uri);
+ xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"actorUri", (const xmlChar *)actor_uri);
if (must_understand)
- xmlNewNsProp (priv->last_node, priv->soap_ns, (xmlChar *)"mustUnderstand", (xmlChar *)"1");
+ xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"mustUnderstand", (const xmlChar *)"1");
}
/**
@@ -548,7 +548,7 @@ soup_soap_message_write_string (SoupSoapMessage *msg, const char *string)
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNodeAddContent (priv->last_node, (xmlChar *)string);
+ xmlNodeAddContent (priv->last_node, (const xmlChar *)string);
}
/**
@@ -568,7 +568,7 @@ soup_soap_message_write_buffer (SoupSoapMessage *msg, const char *buffer, int le
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNodeAddContentLen (priv->last_node, (xmlChar *)buffer, len);
+ xmlNodeAddContentLen (priv->last_node, (const xmlChar *)buffer, len);
}
/**
@@ -587,7 +587,7 @@ soup_soap_message_set_element_type (SoupSoapMessage *msg, const char *xsi_type)
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNsProp (priv->last_node, priv->xsi_ns, (xmlChar *)"type", (xmlChar *)xsi_type);
+ xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"type", (const xmlChar *)xsi_type);
}
/**
@@ -604,7 +604,7 @@ soup_soap_message_set_null (SoupSoapMessage *msg)
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNsProp (priv->last_node, priv->xsi_ns, (xmlChar *)"null", (xmlChar *)"1");
+ xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"null", (const xmlChar *)"1");
}
/**
@@ -631,7 +631,7 @@ soup_soap_message_add_attribute (SoupSoapMessage *msg,
xmlNewNsProp (priv->last_node,
fetch_ns (msg, prefix, ns_uri),
- (xmlChar *)name, (xmlChar *)value);
+ (const xmlChar *)name, (const xmlChar *)value);
}
/**
@@ -650,7 +650,7 @@ soup_soap_message_add_namespace (SoupSoapMessage *msg, const char *prefix, const
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNs (priv->last_node, (xmlChar *)(ns_uri ? ns_uri : ""), (xmlChar *)prefix);
+ xmlNewNs (priv->last_node, (const xmlChar *)(ns_uri ? ns_uri : ""), (const xmlChar *)prefix);
}
/**
@@ -689,7 +689,7 @@ soup_soap_message_set_encoding_style (SoupSoapMessage *msg, const char *enc_styl
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNsProp (priv->last_node, priv->soap_ns, (xmlChar *)"encodingStyle", (xmlChar *)enc_style);
+ xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"encodingStyle", (const xmlChar *)enc_style);
}
/**
@@ -707,7 +707,7 @@ soup_soap_message_reset (SoupSoapMessage *msg)
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlFreeDoc (priv->doc);
- priv->doc = xmlNewDoc ((xmlChar *)"1.0");
+ priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
priv->last_node = NULL;
g_free (priv->action);
@@ -767,10 +767,10 @@ soup_soap_message_get_namespace_prefix (SoupSoapMessage *msg, const char *ns_uri
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
g_return_val_if_fail (ns_uri != NULL, NULL);
- ns = xmlSearchNsByHref (priv->doc, priv->last_node, (xmlChar *)ns_uri);
+ ns = xmlSearchNsByHref (priv->doc, priv->last_node, (const xmlChar *)ns_uri);
if (ns) {
if (ns->prefix)
- return (char *)ns->prefix;
+ return (const char *)ns->prefix;
else
return "";
}
diff --git a/libsoup/soup-soap-response.c b/libsoup/soup-soap-response.c
index 6376ef30..261b5cf1 100644
--- a/libsoup/soup-soap-response.c
+++ b/libsoup/soup-soap-response.c
@@ -51,7 +51,7 @@ soup_soap_response_init (SoupSoapResponse *response)
{
SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
- priv->xmldoc = xmlNewDoc ((xmlChar *)"1.0");
+ priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
}
@@ -105,7 +105,7 @@ parse_parameters (SoupSoapResponsePrivate *priv, xmlNodePtr xml_method)
xmlNodePtr tmp;
for (tmp = xml_method->xmlChildrenNode; tmp != NULL; tmp = tmp->next) {
- if (!strcmp ((char *)tmp->name, "Fault")) {
+ if (!strcmp ((const char *)tmp->name, "Fault")) {
priv->soap_fault = tmp;
continue;
} else {
@@ -154,7 +154,7 @@ soup_soap_response_from_string (SoupSoapResponse *response, const char *xmlstr)
return FALSE;
}
- if (strcmp ((char *)xml_root->name, "Envelope") != 0) {
+ if (strcmp ((const char *)xml_root->name, "Envelope") != 0) {
xmlFreeDoc (priv->xmldoc);
priv->xmldoc = old_doc;
return FALSE;
@@ -162,9 +162,9 @@ soup_soap_response_from_string (SoupSoapResponse *response, const char *xmlstr)
if (xml_root->xmlChildrenNode != NULL) {
xml_body = xml_root->xmlChildrenNode;
- if (strcmp ((char *)xml_body->name, "Header") == 0)
+ if (strcmp ((const char *)xml_body->name, "Header") == 0)
xml_body = xml_root->xmlChildrenNode->next;
- if (strcmp ((char *)xml_body->name, "Body") != 0) {
+ if (strcmp ((const char *)xml_body->name, "Body") != 0) {
xmlFreeDoc (priv->xmldoc);
priv->xmldoc = old_doc;
return FALSE;
@@ -223,7 +223,7 @@ soup_soap_response_set_method_name (SoupSoapResponse *response, const char *meth
g_return_if_fail (priv->xml_method != NULL);
g_return_if_fail (method_name != NULL);
- xmlNodeSetName (priv->xml_method, (xmlChar *)method_name);
+ xmlNodeSetName (priv->xml_method, (const xmlChar *)method_name);
}
/**
@@ -331,7 +331,7 @@ soup_soap_parameter_get_first_child_by_name (SoupSoapParameter *param, const cha
for (tmp = soup_soap_parameter_get_first_child (param);
tmp != NULL;
tmp = soup_soap_parameter_get_next_child (tmp)) {
- if (!strcmp (name, (char *)tmp->name))
+ if (!strcmp (name, (const char *)tmp->name))
return tmp;
}
@@ -383,7 +383,7 @@ soup_soap_parameter_get_next_child_by_name (SoupSoapParameter *param,
for (tmp = soup_soap_parameter_get_next_child (param);
tmp != NULL;
tmp = soup_soap_parameter_get_next_child (tmp)) {
- if (!strcmp (name, (char *)tmp->name))
+ if (!strcmp (name, (const char *)tmp->name))
return tmp;
}
@@ -408,7 +408,7 @@ soup_soap_parameter_get_property (SoupSoapParameter *param, const char *prop_nam
g_return_val_if_fail (param != NULL, NULL);
g_return_val_if_fail (prop_name != NULL, NULL);
- xml_s = xmlGetProp (param, (xmlChar *)prop_name);
+ xml_s = xmlGetProp (param, (const xmlChar *)prop_name);
s = g_strdup ((char *)xml_s);
xmlFree (xml_s);
@@ -479,7 +479,7 @@ soup_soap_response_get_first_parameter_by_name (SoupSoapResponse *response,
for (l = priv->parameters; l != NULL; l = l->next) {
SoupSoapParameter *param = (SoupSoapParameter *) l->data;
- if (!strcmp (name, (char *)param->name))
+ if (!strcmp (name, (const char *)param->name))
return param;
}
diff --git a/libsoup/soup-socket.c b/libsoup/soup-socket.c
index 9ed47e0f..6d9f6bce 100644
--- a/libsoup/soup-socket.c
+++ b/libsoup/soup-socket.c
@@ -525,7 +525,7 @@ connect_watch (GIOChannel* iochannel, GIOCondition condition, gpointer data)
goto cant_connect;
if (getsockopt (priv->sockfd, SOL_SOCKET, SO_ERROR,
- (void *) &error, &len) != 0)
+ (void *)&error, (void *)&len) != 0)
goto cant_connect;
if (error)
goto cant_connect;
@@ -655,7 +655,7 @@ listen_watch (GIOChannel* iochannel, GIOCondition condition, gpointer data)
}
sa_len = sizeof (sa);
- sockfd = accept (priv->sockfd, (struct sockaddr *)&sa, &sa_len);
+ sockfd = accept (priv->sockfd, (struct sockaddr *)&sa, (void *)&sa_len);
if (SOUP_IS_INVALID_SOCKET (sockfd))
return TRUE;
@@ -1015,7 +1015,7 @@ soup_socket_get_local_address (SoupSocket *sock)
int sa_len;
sa_len = sizeof (bound_sa);
- getsockname (priv->sockfd, (struct sockaddr *)&bound_sa, &sa_len);
+ getsockname (priv->sockfd, (struct sockaddr *)&bound_sa, (void *)&sa_len);
priv->local_addr = soup_address_new_from_sockaddr ((struct sockaddr *)&bound_sa, sa_len);
}
g_mutex_unlock (priv->addrlock);
@@ -1045,7 +1045,7 @@ soup_socket_get_remote_address (SoupSocket *sock)
int sa_len;
sa_len = sizeof (bound_sa);
- getpeername (priv->sockfd, (struct sockaddr *)&bound_sa, &sa_len);
+ getpeername (priv->sockfd, (struct sockaddr *)&bound_sa, (void *)&sa_len);
priv->remote_addr = soup_address_new_from_sockaddr ((struct sockaddr *)&bound_sa, sa_len);
}
g_mutex_unlock (priv->addrlock);
diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
index ae298f41..e04baedf 100644
--- a/libsoup/soup-uri.c
+++ b/libsoup/soup-uri.c
@@ -167,7 +167,7 @@ soup_uri_new_with_base (const SoupUri *base, const char *uri_string)
last = strrchr (base->path, '/');
if (last) {
newpath = g_strdup_printf ("%.*s/%s",
- last - base->path,
+ (int)(last - base->path),
base->path,
uri->path);
} else
diff --git a/libsoup/soup-xmlrpc-message.c b/libsoup/soup-xmlrpc-message.c
index 34f84d57..d623424a 100644
--- a/libsoup/soup-xmlrpc-message.c
+++ b/libsoup/soup-xmlrpc-message.c
@@ -57,7 +57,7 @@ soup_xmlrpc_message_init (SoupXmlrpcMessage *msg)
xmlKeepBlanksDefault (0);
- priv->doc = xmlNewDoc ((xmlChar *)"1.0");
+ priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
priv->doc->standalone = FALSE;
priv->doc->encoding = xmlCharStrdup ("UTF-8");
}
@@ -100,14 +100,14 @@ soup_xmlrpc_message_start_call (SoupXmlrpcMessage *msg, const char *method_name)
g_return_if_fail (SOUP_IS_XMLRPC_MESSAGE (msg));
- root = xmlNewDocNode (priv->doc, NULL, (xmlChar *)"methodCall", NULL);
+ root = xmlNewDocNode (priv->doc, NULL, (const xmlChar *)"methodCall", NULL);
xmlDocSetRootElement (priv->doc, root);
- xmlNewChild (root, NULL, (xmlChar *)"methodName", (xmlChar *)method_name);
+ xmlNewChild (root, NULL, (const xmlChar *)"methodName", (const xmlChar *)method_name);
priv->last_node = root;
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"params", NULL);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"params", NULL);
}
void
@@ -128,7 +128,7 @@ soup_xmlrpc_message_start_param (SoupXmlrpcMessage *msg)
g_return_if_fail (SOUP_IS_XMLRPC_MESSAGE (msg));
priv = SOUP_XMLRPC_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"param", NULL);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"param", NULL);
}
void
@@ -150,8 +150,8 @@ soup_xmlrpc_message_write_int (SoupXmlrpcMessage *msg, long i)
str = g_strdup_printf ("%ld", i);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"value", NULL);
- xmlNewTextChild (priv->last_node, NULL, (xmlChar *)"i4", (xmlChar *)str);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"value", NULL);
+ xmlNewTextChild (priv->last_node, NULL, (const xmlChar *)"i4", (xmlChar *)str);
soup_xmlrpc_message_end_element (msg);
g_free (str);
@@ -165,8 +165,8 @@ soup_xmlrpc_message_write_boolean (SoupXmlrpcMessage *msg, gboolean b)
g_return_if_fail (SOUP_IS_XMLRPC_MESSAGE (msg));
priv = SOUP_XMLRPC_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"value", NULL);
- xmlNewChild (priv->last_node, NULL, (xmlChar *)"boolean", b ? (xmlChar *)"1" : (xmlChar *)"0");
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"value", NULL);
+ xmlNewChild (priv->last_node, NULL, (const xmlChar *)"boolean", (const xmlChar*)(b ? "1" : "0"));
soup_xmlrpc_message_end_element (msg);
}
@@ -178,8 +178,8 @@ soup_xmlrpc_message_write_string (SoupXmlrpcMessage *msg, const char *str)
g_return_if_fail (SOUP_IS_XMLRPC_MESSAGE (msg));
priv = SOUP_XMLRPC_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"value", NULL);
- xmlNewTextChild (priv->last_node, NULL, (xmlChar *)"string", (xmlChar *)str);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"value", NULL);
+ xmlNewTextChild (priv->last_node, NULL, (const xmlChar *)"string", (const xmlChar *)str);
soup_xmlrpc_message_end_element (msg);
}
@@ -194,8 +194,8 @@ soup_xmlrpc_message_write_double (SoupXmlrpcMessage *msg, double d)
str = g_strdup_printf ("%f", d);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"value", NULL);
- xmlNewTextChild (priv->last_node, NULL, (xmlChar *)"double", (xmlChar *)str);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"value", NULL);
+ xmlNewTextChild (priv->last_node, NULL, (const xmlChar *)"double", (xmlChar *)str);
soup_xmlrpc_message_end_element (msg);
g_free (str);
@@ -214,8 +214,8 @@ soup_xmlrpc_message_write_datetime (SoupXmlrpcMessage *msg, const time_t timeval
soup_gmtime (&timeval, &time);
strftime (str, 128, "%Y%m%dT%H:%M:%S", &time);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"value", NULL);
- xmlNewTextChild (priv->last_node, NULL, (xmlChar *)"dateTime.iso8601", (xmlChar *)str);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"value", NULL);
+ xmlNewTextChild (priv->last_node, NULL, (const xmlChar *)"dateTime.iso8601", (xmlChar *)str);
soup_xmlrpc_message_end_element (msg);
}
@@ -230,8 +230,8 @@ soup_xmlrpc_message_write_base64 (SoupXmlrpcMessage *msg, gconstpointer buf, int
str = soup_base64_encode (buf, len);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"value", NULL);
- xmlNewTextChild (priv->last_node, NULL, (xmlChar *)"base64", (xmlChar *)str);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"value", NULL);
+ xmlNewTextChild (priv->last_node, NULL, (const xmlChar *)"base64", (xmlChar *)str);
soup_xmlrpc_message_end_element (msg);
g_free (str);
@@ -245,8 +245,8 @@ soup_xmlrpc_message_start_struct (SoupXmlrpcMessage *msg)
g_return_if_fail (SOUP_IS_XMLRPC_MESSAGE (msg));
priv = SOUP_XMLRPC_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"value", NULL);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"struct", NULL);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"value", NULL);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"struct", NULL);
}
void
@@ -266,8 +266,8 @@ soup_xmlrpc_message_start_member (SoupXmlrpcMessage *msg, const char *name)
g_return_if_fail (SOUP_IS_XMLRPC_MESSAGE (msg));
priv = SOUP_XMLRPC_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"member", NULL);
- xmlNewChild (priv->last_node, NULL, (xmlChar *)"name", (xmlChar *)name);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"member", NULL);
+ xmlNewChild (priv->last_node, NULL, (const xmlChar *)"name", (const xmlChar *)name);
}
void
@@ -286,9 +286,9 @@ soup_xmlrpc_message_start_array (SoupXmlrpcMessage *msg)
g_return_if_fail (SOUP_IS_XMLRPC_MESSAGE (msg));
priv = SOUP_XMLRPC_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"value", NULL);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"array", NULL);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (xmlChar *)"data", NULL);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"value", NULL);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"array", NULL);
+ priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)"data", NULL);
}
void
@@ -333,7 +333,6 @@ soup_xmlrpc_message_from_string (SoupXmlrpcMessage *message, const char *xmlstr)
SoupXmlrpcMessagePrivate *priv;
xmlDocPtr newdoc;
xmlNodePtr body;
- gboolean fault = TRUE;
g_return_val_if_fail (SOUP_IS_XMLRPC_MESSAGE (message), FALSE);
priv = SOUP_XMLRPC_MESSAGE_GET_PRIVATE (message);
@@ -345,15 +344,15 @@ soup_xmlrpc_message_from_string (SoupXmlrpcMessage *message, const char *xmlstr)
return FALSE;
body = xmlDocGetRootElement (newdoc);
- if (!body || strcmp ((char *)body->name, "methodCall"))
+ if (!body || strcmp ((const char *)body->name, "methodCall"))
goto bad;
body = body->children;
- if (!body || strcmp ((char *)body->name, "methodName"))
+ if (!body || strcmp ((const char *)body->name, "methodName"))
goto bad;
body = body->next;
- if (!body || strcmp ((char *)body->name, "params"))
+ if (!body || strcmp ((const char *)body->name, "params"))
goto bad;
body = xmlGetLastChild (body);
diff --git a/libsoup/soup-xmlrpc-response.c b/libsoup/soup-xmlrpc-response.c
index ab7abeb1..b166610a 100644
--- a/libsoup/soup-xmlrpc-response.c
+++ b/libsoup/soup-xmlrpc-response.c
@@ -60,7 +60,7 @@ soup_xmlrpc_response_init (SoupXmlrpcResponse *response)
{
SoupXmlrpcResponsePrivate *priv = SOUP_XMLRPC_RESPONSE_GET_PRIVATE (response);
- priv->doc = xmlNewDoc ((xmlChar *)"1.0");
+ priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
priv->fault = FALSE;
}
@@ -130,23 +130,23 @@ soup_xmlrpc_response_from_string (SoupXmlrpcResponse *response, const char *xmls
goto very_bad;
body = xmlDocGetRootElement (newdoc);
- if (!body || strcmp ((char *)body->name, "methodResponse"))
+ if (!body || strcmp ((const char *)body->name, "methodResponse"))
goto bad;
body = exactly_one_child (body);
if (!body)
goto bad;
- if (strcmp ((char *)body->name, "params") == 0) {
+ if (strcmp ((const char *)body->name, "params") == 0) {
fault = FALSE;
body = exactly_one_child (body);
- if (!body || strcmp ((char *)body->name, "param"))
+ if (!body || strcmp ((const char *)body->name, "param"))
goto bad;
- } else if (strcmp ((char *)body->name, "fault") != 0)
+ } else if (strcmp ((const char *)body->name, "fault") != 0)
goto bad;
body = exactly_one_child (body);
- if (!body || strcmp ((char *)body->name, "value"))
+ if (!body || strcmp ((const char *)body->name, "value"))
goto bad;
/* body should be pointing by now to the struct of a fault, or the value of a
@@ -206,28 +206,28 @@ soup_xmlrpc_value_get_type (SoupXmlrpcValue *value)
xml = (xmlNode *) value;
- if (strcmp ((char *)xml->name, "value"))
+ if (strcmp ((const char *)xml->name, "value"))
return SOUP_XMLRPC_VALUE_TYPE_BAD;
xml = exactly_one_child (xml);
if (!xml)
return SOUP_XMLRPC_VALUE_TYPE_BAD;
- if (strcmp ((char *)xml->name, "i4") == 0 || strcmp ((char *)xml->name, "int") == 0)
+ if (strcmp ((const char *)xml->name, "i4") == 0 || strcmp ((const char *)xml->name, "int") == 0)
return SOUP_XMLRPC_VALUE_TYPE_INT;
- else if (strcmp ((char *)xml->name, "boolean") == 0)
+ else if (strcmp ((const char *)xml->name, "boolean") == 0)
return SOUP_XMLRPC_VALUE_TYPE_BOOLEAN;
- else if (strcmp ((char *)xml->name, "string") == 0)
+ else if (strcmp ((const char *)xml->name, "string") == 0)
return SOUP_XMLRPC_VALUE_TYPE_STRING;
- else if (strcmp ((char *)xml->name, "double") == 0)
+ else if (strcmp ((const char *)xml->name, "double") == 0)
return SOUP_XMLRPC_VALUE_TYPE_DOUBLE;
- else if (strcmp ((char *)xml->name, "dateTime.iso8601") == 0)
+ else if (strcmp ((const char *)xml->name, "dateTime.iso8601") == 0)
return SOUP_XMLRPC_VALUE_TYPE_DATETIME;
- else if (strcmp ((char *)xml->name, "base64") == 0)
+ else if (strcmp ((const char *)xml->name, "base64") == 0)
return SOUP_XMLRPC_VALUE_TYPE_BASE64;
- else if (strcmp ((char *)xml->name, "struct") == 0)
+ else if (strcmp ((const char *)xml->name, "struct") == 0)
return SOUP_XMLRPC_VALUE_TYPE_STRUCT;
- else if (strcmp ((char *)xml->name, "array") == 0)
+ else if (strcmp ((const char *)xml->name, "array") == 0)
return SOUP_XMLRPC_VALUE_TYPE_ARRAY;
else
return SOUP_XMLRPC_VALUE_TYPE_BAD;
@@ -243,10 +243,10 @@ soup_xmlrpc_value_get_int (SoupXmlrpcValue *value, long *i)
xml = (xmlNode *) value;
- if (strcmp ((char *)xml->name, "value"))
+ if (strcmp ((const char *)xml->name, "value"))
return FALSE;
xml = exactly_one_child (xml);
- if (!xml || (strcmp ((char *)xml->name, "int") && strcmp ((char *)xml->name, "i4")))
+ if (!xml || (strcmp ((const char *)xml->name, "int") && strcmp ((const char *)xml->name, "i4")))
return FALSE;
/* FIXME this should be exactly one text node */
@@ -268,10 +268,10 @@ soup_xmlrpc_value_get_double (SoupXmlrpcValue *value, double *d)
xml = (xmlNode *) value;
- if (strcmp ((char *)xml->name, "value"))
+ if (strcmp ((const char *)xml->name, "value"))
return FALSE;
xml = exactly_one_child (xml);
- if (!xml || (strcmp ((char *)xml->name, "double")))
+ if (!xml || (strcmp ((const char *)xml->name, "double")))
return FALSE;
/* FIXME this should be exactly one text node */
@@ -294,10 +294,10 @@ soup_xmlrpc_value_get_boolean (SoupXmlrpcValue *value, gboolean *b)
xml = (xmlNode *) value;
- if (strcmp ((char *)xml->name, "value"))
+ if (strcmp ((const char *)xml->name, "value"))
return FALSE;
xml = exactly_one_child (xml);
- if (!xml || strcmp ((char *)xml->name, "boolean"))
+ if (!xml || strcmp ((const char *)xml->name, "boolean"))
return FALSE;
content = xmlNodeGetContent (xml);
@@ -317,10 +317,10 @@ soup_xmlrpc_value_get_string (SoupXmlrpcValue *value, char **str)
xml = (xmlNode *) value;
- if (strcmp ((char *)xml->name, "value"))
+ if (strcmp ((const char *)xml->name, "value"))
return FALSE;
xml = exactly_one_child (xml);
- if (!xml || strcmp ((char *)xml->name, "string"))
+ if (!xml || strcmp ((const char *)xml->name, "string"))
return FALSE;
content = xmlNodeGetContent (xml);
@@ -338,10 +338,10 @@ soup_xmlrpc_value_get_datetime (SoupXmlrpcValue *value, time_t *timeval)
xml = (xmlNode *) value;
- if (strcmp ((char *)xml->name, "value"))
+ if (strcmp ((const char *)xml->name, "value"))
return FALSE;
xml = exactly_one_child (xml);
- if (!xml || (strcmp ((char *)xml->name, "dateTime.iso8601")))
+ if (!xml || (strcmp ((const char *)xml->name, "dateTime.iso8601")))
return FALSE;
/* FIXME this should be exactly one text node */
@@ -365,10 +365,10 @@ soup_xmlrpc_value_get_base64 (SoupXmlrpcValue *value, GByteArray **data)
int len;
xml = (xmlNode *) value;
- if (strcmp ((char *)xml->name, "value"))
+ if (strcmp ((const char *)xml->name, "value"))
return FALSE;
xml = exactly_one_child (xml);
- if (!xml || strcmp ((char *)xml->name, "base64"))
+ if (!xml || strcmp ((const char *)xml->name, "base64"))
return FALSE;
content = xmlNodeGetContent (xml);
@@ -391,11 +391,11 @@ soup_xmlrpc_value_get_struct (SoupXmlrpcValue *value, GHashTable **table)
xml = (xmlNode *) value;
- if (strcmp ((char *)xml->name, "value"))
+ if (strcmp ((const char *)xml->name, "value"))
return FALSE;
xml = exactly_one_child (xml);
- if (!xml || strcmp ((char *)xml->name, "struct"))
+ if (!xml || strcmp ((const char *)xml->name, "struct"))
return FALSE;
t = g_hash_table_new_full (g_str_hash, g_str_equal, xmlFree, NULL);
@@ -404,19 +404,19 @@ soup_xmlrpc_value_get_struct (SoupXmlrpcValue *value, GHashTable **table)
xmlChar *name;
xmlNode *val, *cur;
- if (strcmp ((char *)xml->name, "member") || !xml->children)
+ if (strcmp ((const char *)xml->name, "member") || !xml->children)
goto bad;
name = NULL;
val = NULL;
for (cur = xml->children; cur; cur = cur->next) {
- if (strcmp((char *)cur->name, "name") == 0) {
+ if (strcmp((const char *)cur->name, "name") == 0) {
if (name)
goto local_bad;
name = xmlNodeGetContent (cur);
}
- else if (strcmp ((char *)cur->name, "value") == 0)
+ else if (strcmp ((const char *)cur->name, "value") == 0)
val = cur;
else goto local_bad;
@@ -448,9 +448,9 @@ soup_xmlrpc_value_array_get_iterator (SoupXmlrpcValue *value, SoupXmlrpcValueArr
xml = (xmlNode *) value;
- if (!xml->children || strcmp((char *)xml->children->name, "array") != 0 ||
+ if (!xml->children || strcmp((const char *)xml->children->name, "array") != 0 ||
xml->children->next || !xml->children->children ||
- strcmp((char *)xml->children->children->name, "data") != 0 ||
+ strcmp((const char *)xml->children->children->name, "data") != 0 ||
xml->children->children->next)
return FALSE;
diff --git a/tests/getbug.c b/tests/getbug.c
index 058eb000..e50f6e0f 100644
--- a/tests/getbug.c
+++ b/tests/getbug.c
@@ -75,7 +75,7 @@ main (int argc, char **argv)
{
SoupUri *proxy = NULL;
SoupXmlrpcMessage *msg;
- char *uri = "http://bugzilla.redhat.com/bugzilla/xmlrpc.cgi";
+ const char *uri = "http://bugzilla.redhat.com/bugzilla/xmlrpc.cgi";
int opt, bug;
g_type_init ();
diff --git a/tests/uri-parsing.c b/tests/uri-parsing.c
index 9ff9cfed..7ae3fbc6 100644
--- a/tests/uri-parsing.c
+++ b/tests/uri-parsing.c
@@ -7,7 +7,7 @@
#include "libsoup/soup-uri.h"
struct {
- char *uri_string, *result;
+ const char *uri_string, *result;
} abs_tests[] = {
{ "foo:", "foo:" },
{ "file:/dev/null", "file:/dev/null" },
@@ -33,9 +33,9 @@ struct {
int num_abs_tests = G_N_ELEMENTS(abs_tests);
/* From RFC 2396. */
-char *base = "http://a/b/c/d;p?q";
+const char *base = "http://a/b/c/d;p?q";
struct {
- char *uri_string, *result;
+ const char *uri_string, *result;
} rel_tests[] = {
{ "g:h", "g:h" },
{ "g", "http://a/b/c/g" },