aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/grecs-lex.l3
-rw-r--r--src/list.c6
-rw-r--r--src/lookup.c2
-rw-r--r--src/symtab.c6
4 files changed, 9 insertions, 8 deletions
diff --git a/src/grecs-lex.l b/src/grecs-lex.l
index 29a511e..b007780 100644
--- a/src/grecs-lex.l
+++ b/src/grecs-lex.l
@@ -1,4 +1,6 @@
1/* grecs - Gray's Extensible Configuration System -*- c -*- */ 1/* grecs - Gray's Extensible Configuration System -*- c -*- */
2%option nounput
3%option noinput
2%top { 4%top {
3#ifdef HAVE_CONFIG_H 5#ifdef HAVE_CONFIG_H
4# include <config.h> 6# include <config.h>
@@ -75,7 +77,6 @@ static void qstring_locus_fixup(void);
75 77
76%} 78%}
77 79
78
79%x COMMENT ML STR 80%x COMMENT ML STR
80 81
81WS [ \t\f][ \t\f]* 82WS [ \t\f][ \t\f]*
diff --git a/src/list.c b/src/list.c
index 2ef7cea..e7f69f7 100644
--- a/src/list.c
+++ b/src/list.c
@@ -61,7 +61,7 @@ grecs_list_insert_entry(struct grecs_list *lp,
61 } 61 }
62 62
63 ent->prev = anchor; 63 ent->prev = anchor;
64 if (p = anchor->next) 64 if ((p = anchor->next))
65 p->prev = ent; 65 p->prev = ent;
66 else 66 else
67 lp->tail = ent; 67 lp->tail = ent;
@@ -74,11 +74,11 @@ void
74grecs_list_remove_entry(struct grecs_list *lp, struct grecs_list_entry *ent) 74grecs_list_remove_entry(struct grecs_list *lp, struct grecs_list_entry *ent)
75{ 75{
76 struct grecs_list_entry *p; 76 struct grecs_list_entry *p;
77 if (p = ent->prev) 77 if ((p = ent->prev))
78 p->next = ent->next; 78 p->next = ent->next;
79 else 79 else
80 lp->head = ent->next; 80 lp->head = ent->next;
81 if (p = ent->next) 81 if ((p = ent->next))
82 p->prev = ent->prev; 82 p->prev = ent->prev;
83 else 83 else
84 lp->tail = ent->prev; 84 lp->tail = ent->prev;
diff --git a/src/lookup.c b/src/lookup.c
index 675a4b8..130163e 100644
--- a/src/lookup.c
+++ b/src/lookup.c
@@ -548,7 +548,7 @@ grecs_match_next(struct grecs_match_buf *buf)
548{ 548{
549 if (!buf) 549 if (!buf)
550 return NULL; 550 return NULL;
551 while (buf->node = grecs_next_node(buf->node)) 551 while ((buf->node = grecs_next_node(buf->node)))
552 if (grecs_match(buf)) 552 if (grecs_match(buf))
553 break; 553 break;
554 return buf->node; 554 return buf->node;
diff --git a/src/symtab.c b/src/symtab.c
index c4a552b..1e1c99a 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -142,7 +142,7 @@ grecs_symtab_replace(struct grecs_symtab *st, void *ent, void **old_ent)
142{ 142{
143 struct grecs_syment *entry; 143 struct grecs_syment *entry;
144 unsigned i, pos = st->hash_fun(ent, hash_size[st->hash_num]); 144 unsigned i, pos = st->hash_fun(ent, hash_size[st->hash_num]);
145 for (i = pos; entry = st->tab[i];) { 145 for (i = pos; (entry = st->tab[i]);) {
146 if (st->cmp_fun(entry, ent) == 0) 146 if (st->cmp_fun(entry, ent) == 0)
147 break; 147 break;
148 if (++i >= hash_size[st->hash_num]) 148 if (++i >= hash_size[st->hash_num])
@@ -206,7 +206,7 @@ grecs_symtab_remove(struct grecs_symtab *st, void *elt)
206 struct grecs_syment *entry; 206 struct grecs_syment *entry;
207 207
208 pos = st->hash_fun(elt, hash_size[st->hash_num]); 208 pos = st->hash_fun(elt, hash_size[st->hash_num]);
209 for (i = pos; entry = st->tab[i];) { 209 for (i = pos; (entry = st->tab[i]);) {
210 if (st->cmp_fun(entry, elt) == 0) 210 if (st->cmp_fun(entry, elt) == 0)
211 break; 211 break;
212 if (++i >= hash_size[st->hash_num]) 212 if (++i >= hash_size[st->hash_num])
@@ -254,7 +254,7 @@ grecs_symtab_get_index(unsigned *idx, struct grecs_symtab *st,
254 254
255 pos = st->hash_fun(key, hash_size[st->hash_num]); 255 pos = st->hash_fun(key, hash_size[st->hash_num]);
256 256
257 for (i = pos; elem = st->tab[i];) { 257 for (i = pos; (elem = st->tab[i]);) {
258 if (st->cmp_fun(elem, key) == 0) { 258 if (st->cmp_fun(elem, key) == 0) {
259 if (install) 259 if (install)
260 *install = 0; 260 *install = 0;

Return to:

Send suggestions and report system problems to the System administrator.