diff options
author | Timo Sirainen <cras@irssi.org> | 2000-11-23 21:40:07 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-11-23 21:40:07 +0000 |
commit | 8ce36c05eab6c1787c4e62052fb8d2ba6369cbe8 (patch) | |
tree | 52324a388e270f22cef46fb5a5fcdcc1c3d71ac8 /src/lib-config | |
parent | 8fb2249f0742cd391796b2a07c6611a696f7681a (diff) | |
download | irssi-8ce36c05eab6c1787c4e62052fb8d2ba6369cbe8.zip |
several fixes to make irssi compile without warnings with MIPSpro
also fixed ctcp_queue_clean() - it might have crashed sometimes..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@859 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/lib-config')
-rw-r--r-- | src/lib-config/get.c | 3 | ||||
-rw-r--r-- | src/lib-config/parse.c | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/lib-config/get.c b/src/lib-config/get.c index 4db6b4b7..98e2a30b 100644 --- a/src/lib-config/get.c +++ b/src/lib-config/get.c @@ -203,7 +203,8 @@ char *config_node_get_str(CONFIG_NODE *parent, const char *key, const char *def) if (parent == NULL) return (char *) def; node = config_node_find(parent, key); - return (node == NULL || !has_node_value(node)) ? def : node->value; + return (char *) ((node != NULL && has_node_value(node)) ? + node->value : def); } int config_node_get_int(CONFIG_NODE *parent, const char *key, int def) diff --git a/src/lib-config/parse.c b/src/lib-config/parse.c index 05b76975..1c468ad8 100644 --- a/src/lib-config/parse.c +++ b/src/lib-config/parse.c @@ -134,8 +134,9 @@ static void config_parse_loop(CONFIG_REC *rec, CONFIG_NODE *node, GTokenType exp static int config_parse_symbol(CONFIG_REC *rec, CONFIG_NODE *node) { CONFIG_NODE *newnode; + GTokenType last_char; int print_warning; - char *key, last_char; + char *key; g_return_val_if_fail(rec != NULL, G_TOKEN_ERROR); g_return_val_if_fail(node != NULL, G_TOKEN_ERROR); @@ -182,7 +183,7 @@ static int config_parse_symbol(CONFIG_REC *rec, CONFIG_NODE *node) return G_TOKEN_ERROR; newnode = config_node_section(node, key, NODE_TYPE_BLOCK); - config_parse_loop(rec, newnode, '}'); + config_parse_loop(rec, newnode, (GTokenType) '}'); g_free_not_null(key); config_parse_get_token(rec->scanner, node); @@ -197,7 +198,7 @@ static int config_parse_symbol(CONFIG_REC *rec, CONFIG_NODE *node) if (key == NULL) return G_TOKEN_ERROR; newnode = config_node_section(node, key, NODE_TYPE_LIST); - config_parse_loop(rec, newnode, ')'); + config_parse_loop(rec, newnode, (GTokenType) ')'); g_free_not_null(key); config_parse_get_token(rec->scanner, node); @@ -218,7 +219,7 @@ static int config_parse_symbol(CONFIG_REC *rec, CONFIG_NODE *node) static void config_parse_loop(CONFIG_REC *rec, CONFIG_NODE *node, GTokenType expect) { - int expected_token; + GTokenType expected_token; g_return_if_fail(rec != NULL); g_return_if_fail(node != NULL); |