Commit e065acb7 authored by Karl Heyes's avatar Karl Heyes

no functional/structural change but cleans up the annoying signed/unsigned pointer warnings

here with xmlChar, based on work originally done by gtgbr@gmx.net.
closes #783, #784, #785, #787

svn path=/icecast/trunk/icecast/; revision=13933
parent da893d8b
This diff is collapsed.
...@@ -561,8 +561,8 @@ static int get_authenticator (auth_t *auth, config_options_t *options) ...@@ -561,8 +561,8 @@ static int get_authenticator (auth_t *auth, config_options_t *options)
while (options) while (options)
{ {
if (strcmp(options->name, "allow_duplicate_users") == 0) if (strcmp (options->name, "allow_duplicate_users") == 0)
auth->allow_duplicate_users = atoi (options->value); auth->allow_duplicate_users = atoi ((char*)options->value);
options = options->next; options = options->next;
} }
return 0; return 0;
...@@ -583,16 +583,16 @@ auth_t *auth_get_authenticator (xmlNodePtr node) ...@@ -583,16 +583,16 @@ auth_t *auth_get_authenticator (xmlNodePtr node)
{ {
xmlNodePtr current = option; xmlNodePtr current = option;
option = option->next; option = option->next;
if (strcmp (current->name, "option") == 0) if (xmlStrcmp (current->name, XMLSTR("option")) == 0)
{ {
config_options_t *opt = calloc (1, sizeof (config_options_t)); config_options_t *opt = calloc (1, sizeof (config_options_t));
opt->name = xmlGetProp (current, "name"); opt->name = (char *)xmlGetProp (current, XMLSTR("name"));
if (opt->name == NULL) if (opt->name == NULL)
{ {
free(opt); free(opt);
continue; continue;
} }
opt->value = xmlGetProp (current, "value"); opt->value = (char *)xmlGetProp (current, XMLSTR("value"));
if (opt->value == NULL) if (opt->value == NULL)
{ {
xmlFree (opt->name); xmlFree (opt->name);
...@@ -603,10 +603,10 @@ auth_t *auth_get_authenticator (xmlNodePtr node) ...@@ -603,10 +603,10 @@ auth_t *auth_get_authenticator (xmlNodePtr node)
next_option = &opt->next; next_option = &opt->next;
} }
else else
if (strcmp (current->name, "text") != 0) if (xmlStrcmp (current->name, XMLSTR("text")) != 0)
WARN1 ("unknown auth setting (%s)", current->name); WARN1 ("unknown auth setting (%s)", current->name);
} }
auth->type = xmlGetProp (node, "type"); auth->type = (char*)xmlGetProp (node, XMLSTR("type"));
if (get_authenticator (auth, options) < 0) if (get_authenticator (auth, options) < 0)
{ {
xmlFree (auth->type); xmlFree (auth->type);
......
...@@ -88,7 +88,7 @@ static char *get_hash(const char *data, int len) ...@@ -88,7 +88,7 @@ static char *get_hash(const char *data, int len)
MD5Init(&context); MD5Init(&context);
MD5Update(&context, data, len); MD5Update(&context, (const unsigned char *)data, len);
MD5Final(digest, &context); MD5Final(digest, &context);
...@@ -406,9 +406,9 @@ static auth_result htpasswd_userlist(auth_t *auth, xmlNodePtr srcnode) ...@@ -406,9 +406,9 @@ static auth_result htpasswd_userlist(auth_t *auth, xmlNodePtr srcnode)
while (node) while (node)
{ {
htpasswd_user *user = (htpasswd_user *)node->key; htpasswd_user *user = (htpasswd_user *)node->key;
newnode = xmlNewChild (srcnode, NULL, "User", NULL); newnode = xmlNewChild (srcnode, NULL, XMLSTR("User"), NULL);
xmlNewChild(newnode, NULL, "username", user->name); xmlNewChild(newnode, NULL, XMLSTR("username"), XMLSTR(user->name));
xmlNewChild(newnode, NULL, "password", user->pass); xmlNewChild(newnode, NULL, XMLSTR("password"), XMLSTR(user->pass));
node = avl_get_next (node); node = avl_get_next (node);
} }
thread_rwlock_unlock (&state->file_rwlock); thread_rwlock_unlock (&state->file_rwlock);
......
...@@ -169,6 +169,7 @@ static auth_result url_remove_listener (auth_client *auth_user) ...@@ -169,6 +169,7 @@ static auth_result url_remove_listener (auth_client *auth_user)
auth_url *url = auth->state; auth_url *url = auth->state;
time_t duration = time(NULL) - client->con->con_time; time_t duration = time(NULL) - client->con->con_time;
char *username, *password, *mount, *server; char *username, *password, *mount, *server;
const char *mountreq;
ice_config_t *config; ice_config_t *config;
int port; int port;
char *userpwd = NULL, post [4096]; char *userpwd = NULL, post [4096];
...@@ -191,10 +192,10 @@ static auth_result url_remove_listener (auth_client *auth_user) ...@@ -191,10 +192,10 @@ static auth_result url_remove_listener (auth_client *auth_user)
password = strdup (""); password = strdup ("");
/* get the full uri (with query params if available) */ /* get the full uri (with query params if available) */
mount = httpp_getvar (client->parser, HTTPP_VAR_RAWURI); mountreq = httpp_getvar (client->parser, HTTPP_VAR_RAWURI);
if (mount == NULL) if (mountreq == NULL)
mount = httpp_getvar (client->parser, HTTPP_VAR_URI); mountreq = httpp_getvar (client->parser, HTTPP_VAR_URI);
mount = util_url_escape (mount); mount = util_url_escape (mountreq);
snprintf (post, sizeof (post), snprintf (post, sizeof (post),
"action=listener_remove&server=%s&port=%d&client=%lu&mount=%s" "action=listener_remove&server=%s&port=%d&client=%lu&mount=%s"
...@@ -248,7 +249,9 @@ static auth_result url_add_listener (auth_client *auth_user) ...@@ -248,7 +249,9 @@ static auth_result url_add_listener (auth_client *auth_user)
auth_t *auth = client->auth; auth_t *auth = client->auth;
auth_url *url = auth->state; auth_url *url = auth->state;
int res = 0, port; int res = 0, port;
char *agent, *user_agent, *username, *password; const char *agent;
char *user_agent, *username, *password;
const char *mountreq;
char *mount, *ipaddr, *server; char *mount, *ipaddr, *server;
ice_config_t *config; ice_config_t *config;
char *userpwd = NULL, post [4096]; char *userpwd = NULL, post [4096];
...@@ -274,10 +277,10 @@ static auth_result url_add_listener (auth_client *auth_user) ...@@ -274,10 +277,10 @@ static auth_result url_add_listener (auth_client *auth_user)
password = strdup (""); password = strdup ("");
/* get the full uri (with query params if available) */ /* get the full uri (with query params if available) */
mount = httpp_getvar (client->parser, HTTPP_VAR_RAWURI); mountreq = httpp_getvar (client->parser, HTTPP_VAR_RAWURI);
if (mount == NULL) if (mountreq == NULL)
mount = httpp_getvar (client->parser, HTTPP_VAR_URI); mountreq = httpp_getvar (client->parser, HTTPP_VAR_URI);
mount = util_url_escape (mount); mount = util_url_escape (mountreq);
ipaddr = util_url_escape (client->con->ip); ipaddr = util_url_escape (client->con->ip);
snprintf (post, sizeof (post), snprintf (post, sizeof (post),
......
This diff is collapsed.
...@@ -27,6 +27,8 @@ struct _mount_proxy; ...@@ -27,6 +27,8 @@ struct _mount_proxy;
#include "auth.h" #include "auth.h"
#include "global.h" #include "global.h"
#define XMLSTR(str) ((xmlChar *)(str))
typedef struct ice_config_dir_tag typedef struct ice_config_dir_tag
{ {
char *host; char *host;
......
...@@ -74,7 +74,7 @@ ogg_codec_t *initial_speex_page (format_plugin_t *plugin, ogg_page *page) ...@@ -74,7 +74,7 @@ ogg_codec_t *initial_speex_page (format_plugin_t *plugin, ogg_page *page)
ogg_stream_packetout (&codec->os, &packet); ogg_stream_packetout (&codec->os, &packet);
DEBUG0("checking for speex codec"); DEBUG0("checking for speex codec");
header = speex_packet_to_header (packet.packet, packet.bytes); header = speex_packet_to_header ((char*)packet.packet, packet.bytes);
if (header == NULL) if (header == NULL)
{ {
ogg_stream_clear (&codec->os); ogg_stream_clear (&codec->os);
......
...@@ -91,13 +91,13 @@ relay_server *relay_copy (relay_server *r) ...@@ -91,13 +91,13 @@ relay_server *relay_copy (relay_server *r)
if (copy) if (copy)
{ {
copy->server = xmlStrdup (r->server); copy->server = (char *)xmlCharStrdup (r->server);
copy->mount = xmlStrdup (r->mount); copy->mount = (char *)xmlCharStrdup (r->mount);
copy->localmount = xmlStrdup (r->localmount); copy->localmount = (char *)xmlCharStrdup (r->localmount);
if (r->username) if (r->username)
copy->username = xmlStrdup (r->username); copy->username = (char *)xmlCharStrdup (r->username);
if (r->password) if (r->password)
copy->password = xmlStrdup (r->password); copy->password = (char *)xmlCharStrdup (r->password);
copy->port = r->port; copy->port = r->port;
copy->mp3metadata = r->mp3metadata; copy->mp3metadata = r->mp3metadata;
copy->on_demand = r->on_demand; copy->on_demand = r->on_demand;
...@@ -646,10 +646,10 @@ static int update_from_master(ice_config_t *config) ...@@ -646,10 +646,10 @@ static int update_from_master(ice_config_t *config)
r = calloc (1, sizeof (relay_server)); r = calloc (1, sizeof (relay_server));
if (r) if (r)
{ {
r->server = xmlStrdup (master); r->server = (char *)xmlCharStrdup (master);
r->port = port; r->port = port;
r->mount = xmlStrdup (buf); r->mount = (char *)xmlCharStrdup (buf);
r->localmount = xmlStrdup (buf); r->localmount = (char *)xmlCharStrdup (buf);
r->mp3metadata = 1; r->mp3metadata = 1;
r->on_demand = on_demand; r->on_demand = on_demand;
r->next = new_relays; r->next = new_relays;
......
...@@ -911,8 +911,8 @@ static xmlNodePtr _find_xml_node(char *mount, source_xml_t **list, xmlNodePtr ro ...@@ -911,8 +911,8 @@ static xmlNodePtr _find_xml_node(char *mount, source_xml_t **list, xmlNodePtr ro
/* build node */ /* build node */
node = (source_xml_t *)malloc(sizeof(source_xml_t)); node = (source_xml_t *)malloc(sizeof(source_xml_t));
node->mount = strdup(mount); node->mount = strdup(mount);
node->node = xmlNewChild(root, NULL, "source", NULL); node->node = xmlNewChild (root, NULL, XMLSTR("source"), NULL);
xmlSetProp(node->node, "mount", mount); xmlSetProp (node->node, XMLSTR("mount"), XMLSTR(mount));
node->next = NULL; node->next = NULL;
/* add node */ /* add node */
...@@ -952,8 +952,8 @@ void stats_get_xml(xmlDocPtr *doc, int show_hidden, const char *show_mount) ...@@ -952,8 +952,8 @@ void stats_get_xml(xmlDocPtr *doc, int show_hidden, const char *show_mount)
event_queue_init (&queue); event_queue_init (&queue);
_dump_stats_to_queue (&queue); _dump_stats_to_queue (&queue);
*doc = xmlNewDoc("1.0"); *doc = xmlNewDoc (XMLSTR("1.0"));
node = xmlNewDocNode(*doc, NULL, "icestats", NULL); node = xmlNewDocNode(*doc, NULL, XMLSTR("icestats"), NULL);
xmlDocSetRootElement(*doc, node); xmlDocSetRootElement(*doc, node);
event = _get_event_from_queue(&queue); event = _get_event_from_queue(&queue);
...@@ -964,8 +964,8 @@ void stats_get_xml(xmlDocPtr *doc, int show_hidden, const char *show_mount) ...@@ -964,8 +964,8 @@ void stats_get_xml(xmlDocPtr *doc, int show_hidden, const char *show_mount)
do do
{ {
xmlChar *name, *value; xmlChar *name, *value;
name = xmlEncodeEntitiesReentrant (*doc, event->name); name = xmlEncodeEntitiesReentrant (*doc, XMLSTR(event->name));
value = xmlEncodeEntitiesReentrant (*doc, event->value); value = xmlEncodeEntitiesReentrant (*doc, XMLSTR(event->value));
srcnode = node; srcnode = node;
if (event->source) if (event->source)
{ {
...@@ -975,7 +975,7 @@ void stats_get_xml(xmlDocPtr *doc, int show_hidden, const char *show_mount) ...@@ -975,7 +975,7 @@ void stats_get_xml(xmlDocPtr *doc, int show_hidden, const char *show_mount)
} }
else else
srcnode = node; srcnode = node;
xmlNewChild(srcnode, NULL, name, value); xmlNewChild(srcnode, NULL, XMLSTR(name), XMLSTR(value));
xmlFree (value); xmlFree (value);
xmlFree (name); xmlFree (name);
} while (0); } while (0);
...@@ -1007,18 +1007,18 @@ void stats_sendxml(client_t *client) ...@@ -1007,18 +1007,18 @@ void stats_sendxml(client_t *client)
event_queue_init (&queue); event_queue_init (&queue);
_dump_stats_to_queue (&queue); _dump_stats_to_queue (&queue);
doc = xmlNewDoc("1.0"); doc = xmlNewDoc (XMLSTR("1.0"));
node = xmlNewDocNode(doc, NULL, "icestats", NULL); node = xmlNewDocNode (doc, NULL, XMLSTR("icestats"), NULL);
xmlDocSetRootElement(doc, node); xmlDocSetRootElement(doc, node);
event = _get_event_from_queue(&queue); event = _get_event_from_queue(&queue);
while (event) { while (event) {
if (event->source == NULL) { if (event->source == NULL) {
xmlNewChild(node, NULL, event->name, event->value); xmlNewChild (node, NULL, XMLSTR(event->name), XMLSTR(event->value));
} else { } else {
srcnode = _find_xml_node(event->source, &src_nodes, node); srcnode = _find_xml_node(event->source, &src_nodes, node);
xmlNewChild(srcnode, NULL, event->name, event->value); xmlNewChild (srcnode, NULL, XMLSTR(event->name), XMLSTR(event->value));
} }
_free_event(event); _free_event(event);
......
...@@ -160,7 +160,7 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) { ...@@ -160,7 +160,7 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) {
xsltFreeStylesheet(cache[i].stylesheet); xsltFreeStylesheet(cache[i].stylesheet);
cache[i].last_modified = file.st_mtime; cache[i].last_modified = file.st_mtime;
cache[i].stylesheet = xsltParseStylesheetFile(fn); cache[i].stylesheet = xsltParseStylesheetFile (XMLSTR(fn));
cache[i].cache_age = time(NULL); cache[i].cache_age = time(NULL);
} }
DEBUG1("Using cached sheet %i", i); DEBUG1("Using cached sheet %i", i);
...@@ -178,7 +178,7 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) { ...@@ -178,7 +178,7 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) {
cache[i].last_modified = file.st_mtime; cache[i].last_modified = file.st_mtime;
cache[i].filename = strdup(fn); cache[i].filename = strdup(fn);
cache[i].stylesheet = xsltParseStylesheetFile(fn); cache[i].stylesheet = xsltParseStylesheetFile (XMLSTR(fn));
cache[i].cache_age = time(NULL); cache[i].cache_age = time(NULL);
return cache[i].stylesheet; return cache[i].stylesheet;
} }
...@@ -216,10 +216,10 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client) ...@@ -216,10 +216,10 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
else else
{ {
/* check method for the default, a missing method assumes xml */ /* check method for the default, a missing method assumes xml */
if (cur->method && xmlStrcmp (cur->method, "html") == 0) if (cur->method && xmlStrcmp (cur->method, XMLSTR("html")) == 0)
mediatype = "text/html"; mediatype = "text/html";
else else
if (cur->method && xmlStrcmp (cur->method, "text") == 0) if (cur->method && xmlStrcmp (cur->method, XMLSTR("text")) == 0)
mediatype = "text/plain"; mediatype = "text/plain";
else else
mediatype = "text/xml"; mediatype = "text/xml";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment