From: Christoph Mallon Date: Sun, 14 Sep 2008 15:01:15 +0000 (+0000) Subject: Fix printing of function types, which return function pointers: The parameter lists... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=1544eb2d414393a2077292b5c1b118f0bf0fa7a9;p=cparser Fix printing of function types, which return function pointers: The parameter lists got swapped. [r21939] --- diff --git a/type.c b/type.c index 085a6b9..2eba180 100644 --- a/type.c +++ b/type.c @@ -313,7 +313,7 @@ static void print_function_type_pre(const function_type_t *type, bool top) break; } - /* don't emit braces if we're the toplevel type... */ + /* don't emit parenthesis if we're the toplevel type... */ if (!top) fputc('(', out); } @@ -327,7 +327,9 @@ static void print_function_type_pre(const function_type_t *type, bool top) static void print_function_type_post(const function_type_t *type, const scope_t *scope, bool top) { - intern_print_type_post(type->return_type, false); + /* don't emit parenthesis if we're the toplevel type... */ + if (!top) + fputc(')', out); fputc('(', out); bool first = true; @@ -366,9 +368,7 @@ static void print_function_type_post(const function_type_t *type, } fputc(')', out); - /* don't emit braces if we're the toplevel type... */ - if (!top) - fputc(')', out); + intern_print_type_post(type->return_type, false); } /**