X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast.c;h=4bf325829c0182c6c19b9d4b7474155ac79f0bc0;hb=c82bb755ba4e0d51d7edfdab7af98bc47eca6f62;hp=b13b7f44d6bc0965e973fd525d6a328eeac71c4c;hpb=9a4380489c081acfc4400860b39b7722f2d31763;p=cparser diff --git a/ast.c b/ast.c index b13b7f4..4bf3258 100644 --- a/ast.c +++ b/ast.c @@ -177,10 +177,14 @@ static void print_const(const const_expression_t *cnst) if(cnst->base.type == NULL) return; - if(is_type_integer(cnst->base.type)) { + const type_t *const type = skip_typeref(cnst->base.type); + + if (is_type_integer(type)) { fprintf(out, "%lld", cnst->v.int_value); - } else if(is_type_float(cnst->base.type)) { + } else if (is_type_float(type)) { fprintf(out, "%Lf", cnst->v.float_value); + } else { + panic("unknown constant"); } }