X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=type.c;h=365b3fecaeccff31cbe932c7b07c3f91e6c868b6;hb=57569ce27c909aa9cda1d4e1b405c83ae0ef29cb;hp=bcc1b255b8466450f79e214a0c19a1c9433ac594;hpb=9dc06dc8e3e1560d174f728bd2254090dd9c8a5d;p=cparser diff --git a/type.c b/type.c index bcc1b25..365b3fe 100644 --- a/type.c +++ b/type.c @@ -133,8 +133,7 @@ static void print_function_type_post(const function_type_t *type, fputc(')', out); } -static -void print_pointer_type_pre(const pointer_type_t *type) +static void print_pointer_type_pre(const pointer_type_t *type) { intern_print_type_pre(type->points_to); fputs("*", out); @@ -146,8 +145,14 @@ static void print_pointer_type_post(const pointer_type_t *type) intern_print_type_post(type->points_to); } +static void print_array_type_pre(const array_type_t *type) +{ + intern_print_type_pre(type->element_type); +} + static void print_array_type_post(const array_type_t *type) { + intern_print_type_post(type->element_type); fputc('[', out); if(type->is_static) { fputs("static ", out); @@ -173,7 +178,7 @@ void print_enum_definition(const declaration_t *declaration) fprintf(out, "%s", entry->symbol->string); if(entry->init.initializer != NULL) { fprintf(out, " = "); - print_initializer(entry->init.initializer); + print_expression(entry->init.enum_value); } fprintf(out, ",\n"); } @@ -277,6 +282,7 @@ static void intern_print_type_pre(type_t *type) print_pointer_type_pre((pointer_type_t*) type); return; case TYPE_ARRAY: + print_array_type_pre((array_type_t*) type); return; case TYPE_TYPEDEF: print_typedef_type_pre((typedef_type_t*) type); @@ -384,8 +390,6 @@ bool is_type_floating(const type_t *type) case ATOMIC_TYPE_FLOAT_COMPLEX: case ATOMIC_TYPE_DOUBLE_COMPLEX: case ATOMIC_TYPE_LONG_DOUBLE_COMPLEX: -#endif -#ifdef PROVIDE_IMAGINARY case ATOMIC_TYPE_FLOAT_IMAGINARY: case ATOMIC_TYPE_DOUBLE_IMAGINARY: case ATOMIC_TYPE_LONG_DOUBLE_IMAGINARY: @@ -420,8 +424,6 @@ bool is_type_signed(const type_t *type) case ATOMIC_TYPE_FLOAT_COMPLEX: case ATOMIC_TYPE_DOUBLE_COMPLEX: case ATOMIC_TYPE_LONG_DOUBLE_COMPLEX: -#endif -#ifdef PROVIDE_IMAGINARY case ATOMIC_TYPE_FLOAT_IMAGINARY: case ATOMIC_TYPE_DOUBLE_IMAGINARY: case ATOMIC_TYPE_LONG_DOUBLE_IMAGINARY: