X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=types.c;h=82bdd0b080b7dffbeb0dd795558bb1dab68b6745;hb=c58c01e7c180f68d3d3a721997693abcc6e26352;hp=e49a68900964422b73a63b364b7b9cecd35fc2a1;hpb=386eb6028b666dfa460594056562beff9c3cfa37;p=cparser diff --git a/types.c b/types.c index e49a689..82bdd0b 100644 --- a/types.c +++ b/types.c @@ -25,6 +25,7 @@ type_t *type_error_type; type_t *type_char; +type_t *type_const_char; type_t *type_double; type_t *type_float; type_t *type_int; @@ -32,6 +33,7 @@ type_t *type_long_double; type_t *type_long_long; type_t *type_long; type_t *type_short; +type_t *type_unsigned_short; type_t *type_signed_char; type_t *type_unsigned_int; type_t *type_unsigned_long_long; @@ -39,6 +41,7 @@ type_t *type_unsigned_long; type_t *type_void; type_t *type_char_ptr; +type_t *type_const_char_ptr; type_t *type_int_ptr; type_t *type_long_long_ptr; type_t *type_long_ptr; @@ -55,12 +58,14 @@ type_t *type_ssize_t; type_t *type_uintmax_t; type_t *type_uptrdiff_t; type_t *type_wchar_t; +type_t *type_const_wchar_t; type_t *type_wint_t; type_t *type_intmax_t_ptr; type_t *type_ptrdiff_t_ptr; type_t *type_ssize_t_ptr; type_t *type_wchar_t_ptr; +type_t *type_const_wchar_t_ptr; /* microsoft types */ atomic_type_kind_t int8_type_kind = ATOMIC_TYPE_INVALID; @@ -86,11 +91,13 @@ type_t *type_unsigned_int64; void init_basic_types(void) { - static const type_base_t error = { TYPE_ERROR, TYPE_QUALIFIER_NONE, 0, { NULL, 0 }, NULL }; + static const type_base_t error = { TYPE_ERROR, { NULL, 0 }, 0, TYPE_QUALIFIER_NONE, + TYPE_MODIFIER_NONE, 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_unsigned_short = make_atomic_type(ATOMIC_TYPE_USHORT, TYPE_QUALIFIER_NONE); type_int = make_atomic_type(ATOMIC_TYPE_INT, TYPE_QUALIFIER_NONE); type_unsigned_int = make_atomic_type(ATOMIC_TYPE_UINT, TYPE_QUALIFIER_NONE); type_long = make_atomic_type(ATOMIC_TYPE_LONG, TYPE_QUALIFIER_NONE); @@ -133,4 +140,8 @@ void init_basic_types(void) 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); + + /* const character types */ + type_const_char = make_atomic_type(ATOMIC_TYPE_CHAR, TYPE_QUALIFIER_CONST); + type_const_char_ptr = make_pointer_type(type_const_char, TYPE_QUALIFIER_NONE); }