X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/847964f010e5f56bcd13a6dde2d0a73e7cc67273..1402a14592dde378698373044afbcef9c38ec2c2:/src/explain.c diff --git a/src/explain.c b/src/explain.c index 6d6aa87..722e721 100644 --- a/src/explain.c +++ b/src/explain.c @@ -1,6 +1,6 @@ /* * Render C declarations as English. - * Copyright © 2011, 2021, 2023 Nick Bowler + * Copyright © 2011, 2021, 2023-2024 Nick Bowler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ */ #include -#include #include -#include #include "cdecl.h" #include "cdecl-internal.h" @@ -126,10 +124,8 @@ explain_function(struct output_state *dst, struct cdecl_function *f) static void explain_declarators(struct output_state *dst, struct cdecl_declarator *d) { - if (d->type == CDECL_DECL_IDENT || d->type == CDECL_DECL_NULL) - return; - - explain_declarators(dst, d->child); + if (d->child) + explain_declarators(dst, d->child); switch (d->type) { case CDECL_DECL_POINTER: @@ -141,8 +137,6 @@ explain_declarators(struct output_state *dst, struct cdecl_declarator *d) case CDECL_DECL_FUNCTION: explain_function(dst, &d->u.function); return; - default: - assert(0); } }