X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=types.c;h=ff45f8abaa502be1fd221aa45d43c13e42b51317;hb=688d947320fffe9930ea01d84f57d261baea6d2a;hp=3f095c03b3360e4830e4c6d505c41cae5cb3857c;hpb=62c3fec4c8a371167ad7be3b4cd08c563c21e121;p=cparser diff --git a/types.c b/types.c index 3f095c0..ff45f8a 100644 --- a/types.c +++ b/types.c @@ -13,12 +13,12 @@ type_t *type_long_long; type_t *type_long; type_t *type_short; type_t *type_signed_char; -type_t *type_string; type_t *type_unsigned_int; type_t *type_unsigned_long_long; type_t *type_unsigned_long; type_t *type_void; +type_t *type_char_ptr; type_t *type_int_ptr; type_t *type_long_long_ptr; type_t *type_long_ptr; @@ -26,6 +26,8 @@ type_t *type_short_ptr; type_t *type_signed_char_ptr; type_t *type_void_ptr; +type_t *type_char_ptr_ptr; + type_t *type_intmax_t; type_t *type_ptrdiff_t; type_t *type_size_t; @@ -43,8 +45,9 @@ type_t *type_wchar_t_ptr; void init_basic_types(void) { - static const type_kind_t error = TYPE_ERROR; - type_error_type = (type_t *)&error; + static const type_base_t error = { TYPE_ERROR, TYPE_QUALIFIER_NONE, { NULL, 0 }, NULL }; + + type_error_type = (type_t*)&error; type_signed_char = make_atomic_type(ATOMIC_TYPE_SCHAR, TYPE_QUALIFIER_NONE); type_short = make_atomic_type(ATOMIC_TYPE_SHORT, TYPE_QUALIFIER_NONE); type_int = make_atomic_type(ATOMIC_TYPE_INT, TYPE_QUALIFIER_NONE); @@ -60,10 +63,12 @@ void init_basic_types(void) type_void = make_atomic_type(ATOMIC_TYPE_VOID, TYPE_QUALIFIER_NONE); type_void_ptr = make_pointer_type(type_void, TYPE_QUALIFIER_NONE); - type_string = make_pointer_type(type_char, TYPE_QUALIFIER_NONE); + type_char_ptr = make_pointer_type(type_char, TYPE_QUALIFIER_NONE); type_signed_char_ptr = make_pointer_type(type_signed_char, TYPE_QUALIFIER_NONE); type_short_ptr = make_pointer_type(type_short, TYPE_QUALIFIER_NONE); type_int_ptr = make_pointer_type(type_int, TYPE_QUALIFIER_NONE); type_long_ptr = make_pointer_type(type_long, TYPE_QUALIFIER_NONE); type_long_long_ptr = make_pointer_type(type_long_long, TYPE_QUALIFIER_NONE); + + type_char_ptr_ptr = make_pointer_type(type_char_ptr, TYPE_QUALIFIER_NONE); }