From 8ce36c05eab6c1787c4e62052fb8d2ba6369cbe8 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 23 Nov 2000 21:40:07 +0000 Subject: 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 --- src/lib-config/get.c | 3 ++- src/lib-config/parse.c | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/lib-config') 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); -- cgit v1.2.3