starter: Use custom type to mark seen keywords.

This commit is contained in:
Tobias Brunner
2012-06-11 17:33:30 +02:00
parent 57323f6259
commit f82365ad27
3 changed files with 27 additions and 23 deletions
+3 -4
View File
@@ -360,21 +360,20 @@ bool assign_arg(kw_token_t token, kw_token_t first, kw_list_t *kw, char *base,
int index = -1; /* used for enumeration arguments */
lset_t *seen = (lset_t *)base; /* seen flags are at the top of the struct */
lset_t f = LELEM(token - first); /* compute flag position of argument */
seen_t *seen = (seen_t*)base; /* seen flags are at the top of the struct */
*assigned = FALSE;
DBG3(DBG_APP, " %s=%s", kw->entry->name, kw->value);
if (*seen & f)
if (*seen & SEEN_KW(token, first))
{
DBG1(DBG_APP, "# duplicate '%s' option", kw->entry->name);
return FALSE;
}
/* set flag that this argument has been seen */
*seen |= f;
*seen |= SEEN_KW(token, first);
/* is there a keyword list? */
if (list != NULL && token_info[token].type != ARG_LST)