# HG changeset patch # User Richard Laager # Date 1181185982 0 # Node ID 23b03396e71e86972223cb5911d93a4378e3c3e4 # Parent 6f7f5476582225aeaa10bc6855fb6ebfe0da6be6 Eliminate warnings about array subscripts being char. They can be signed, so we need to cast to unsigned char. diff -r 6f7f54765822 -r 23b03396e71e finch/libgnt/gntkeys.c --- a/finch/libgnt/gntkeys.c Thu Jun 07 03:11:56 2007 +0000 +++ b/finch/libgnt/gntkeys.c Thu Jun 07 03:13:02 2007 +0000 @@ -206,8 +206,8 @@ node->flags |= IS_END; return; } - while (*path && node->next[*path]) { - node = node->next[*path]; + while (*path && node->next[(unsigned char)*path]) { + node = node->next[(unsigned char)*path]; node->ref++; path++; } @@ -215,7 +215,7 @@ return; n = g_new0(struct _node, 1); n->ref = 1; - node->next[*path++] = n; + node->next[(unsigned char)*path++] = n; add_path(n, path); } @@ -230,13 +230,13 @@ if (!*path) return; - next = node->next[*path]; + next = node->next[(unsigned char)*path]; if (!next) return; del_path(next, path + 1); next->ref--; if (next->ref == 0) { - node->next[*path] = NULL; + node->next[(unsigned char)*path] = NULL; g_free(next); } } @@ -252,12 +252,12 @@ struct _node *n = &root; root.flags &= ~IS_END; - while (*path && n->next[*path] && !(n->flags & IS_END)) { + while (*path && n->next[(unsigned char)*path] && !(n->flags & IS_END)) { if (!g_ascii_isspace(*path) && !g_ascii_iscntrl(*path) && !g_ascii_isgraph(*path)) return 0; - n = n->next[*path++]; + n = n->next[(unsigned char)*path++]; depth++; }