X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=wrappergen%2Fwrite_fluffy.c;h=05c4f9c9616ef2fb77825389ad7f0363ec431d1a;hb=b8f4fc13774d296a361e9e80e813a7eb906fc54b;hp=236e625dfe200e22cdb3fe1b83606665edc7dfab;hpb=1b580cf22ca849edc62afa24304ff0432954877a;p=cparser diff --git a/wrappergen/write_fluffy.c b/wrappergen/write_fluffy.c index 236e625..05c4f9c 100644 --- a/wrappergen/write_fluffy.c +++ b/wrappergen/write_fluffy.c @@ -43,7 +43,7 @@ static const char *get_atomic_type_string(const atomic_type_kind_t type) case ATOMIC_TYPE_CHAR: return "byte"; case ATOMIC_TYPE_SCHAR: return "byte"; case ATOMIC_TYPE_UCHAR: return "unsigned byte"; - case ATOMIC_TYPE_SHORT: return "short"; + case ATOMIC_TYPE_SHORT: return "short"; case ATOMIC_TYPE_USHORT: return "unsigned short"; case ATOMIC_TYPE_INT: return "int"; case ATOMIC_TYPE_UINT: return "unsigned int"; @@ -173,8 +173,6 @@ static void write_type(const type_t *type) case TYPE_FUNCTION: write_function_type(&type->function); return; - case TYPE_INVALID: - panic("invalid type found"); case TYPE_COMPLEX: case TYPE_IMAGINARY: default: @@ -223,18 +221,11 @@ static void write_unary_expression(const unary_expression_t *expression) static void write_expression(const expression_t *expression) { - const const_expression_t *constant; - /* TODO */ switch(expression->kind) { - case EXPR_CONST: - constant = &expression->conste; - if(is_type_integer(expression->base.type)) { - fprintf(out, "%lld", constant->v.int_value); - } else { - fprintf(out, "%Lf", constant->v.float_value); - } + case EXPR_LITERAL_INTEGER: + fprintf(out, "%s", expression->literal.value.begin); break; - EXPR_UNARY_CASES + case EXPR_UNARY_CASES: write_unary_expression((const unary_expression_t*) expression); break; default: