X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=type.c;h=a35aa4477c3e46087f99107fb39d05b76fd4b423;hb=f5a27af44212805f4a00d645e8b8b9c868846a39;hp=99c73a96d9d35ab7cc65672d8e71276f95e99a4b;hpb=6aad82682d63799b99ee7803deaed589f8ecc69b;p=cparser diff --git a/type.c b/type.c index 99c73a9..a35aa44 100644 --- a/type.c +++ b/type.c @@ -435,7 +435,7 @@ static void print_array_type_post(const array_type_t *type) static void print_bitfield_type_post(const bitfield_type_t *type) { fputs(" : ", out); - print_expression(type->size); + print_expression(type->size_expression); intern_print_type_post(type->base_type, false); } @@ -747,6 +747,8 @@ type_t *duplicate_type(const type_t *type) */ type_t *get_unqualified_type(type_t *type) { + assert(!is_typeref(type)); + if (type->base.qualifiers == TYPE_QUALIFIER_NONE) return type; @@ -931,9 +933,8 @@ bool is_type_arithmetic(const type_t *type) */ bool is_type_real(const type_t *type) { - /* 6.2.5.17 */ - return is_type_integer(type) - || (type->kind == TYPE_ATOMIC && is_type_float(type)); + /* 6.2.5 (17) */ + return is_type_integer(type) || is_type_float(type); } /** @@ -1024,6 +1025,9 @@ static bool function_types_compatible(const function_type_t *func1, if (!types_compatible(ret1, ret2)) return false; + if (func1->calling_convention != func2->calling_convention) + return false; + /* can parameters be compared? */ if (func1->unspecified_parameters || func2->unspecified_parameters) return true; @@ -1031,9 +1035,6 @@ static bool function_types_compatible(const function_type_t *func1, if (func1->variadic != func2->variadic) return false; - if (func1->calling_convention != func2->calling_convention) - return false; - /* TODO: handling of unspecified parameters not correct yet */ /* all argument types must be compatible */