X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=types.c;h=ad35a19a3e13cc7b0b473ae8c8058c935d78e371;hb=9d5d648529676b3d0f51d635109d5fcf6c7bf719;hp=53b78b5a5bbef99d06942c30f38f87778ad6bb3b;hpb=b6896812e8b666bd893a13948a838dedb011282b;p=cparser diff --git a/types.c b/types.c index 53b78b5..ad35a19 100644 --- a/types.c +++ b/types.c @@ -1,6 +1,8 @@ #include "type_t.h" #include "types.h" +/** The error type. */ +type_t *type_error_type; type_t *type_char; type_t *type_double; @@ -24,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; @@ -41,6 +45,9 @@ type_t *type_wchar_t_ptr; void init_basic_types(void) { + static const type_base_t error = { TYPE_ERROR, TYPE_QUALIFIER_NONE, 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); @@ -62,4 +69,6 @@ void init_basic_types(void) 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_string, TYPE_QUALIFIER_NONE); }