return ret;
}
-static struct cdecl_declarator *next_declarator(struct cdecl_declarator *d)
-{
- switch (d->type) {
- case CDECL_DECL_IDENT:
- return NULL;
- case CDECL_DECL_POINTER:
- return d->u.pointer.declarator;
- case CDECL_DECL_ARRAY:
- return d->u.array.declarator;
- default:
- assert(0);
- }
-}
-
/* Renders the name of the thing being declared. */
static size_t
explain_prologue(char *buf, size_t n, struct cdecl_declarator *d)
return snprintf(buf, n, "type");
return snprintf(buf, n, "declare %s as", d->u.ident);
}
- d = next_declarator(d);
+ d = d->child;
}
}
if (d->type == CDECL_DECL_IDENT)
return 0;
- rc = explain_declarators(buf, n, next_declarator(d));
+ rc = explain_declarators(buf, n, d->child);
ret += advance(&buf, &n, rc);
switch (d->type) {