X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=types.c;h=0c71f81cbf72a0cb2b2c4c0bb2e08b2f88eb97e3;hb=48aeb18bc128123e52b63b85a35615f81e68583b;hp=812dc68c860bc210d15f59bfd790e313eda2b0c6;hpb=e719b76791b19aaf3264cc8505172c655bff22b4;p=cparser diff --git a/types.c b/types.c index 812dc68..0c71f81 100644 --- a/types.c +++ b/types.c @@ -1,6 +1,6 @@ /* * This file is part of cparser. - * Copyright (C) 2007-2008 Matthias Braun + * Copyright (C) 2007-2009 Matthias Braun * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -44,7 +44,9 @@ type_t *type_unsigned_long; type_t *type_void; type_t *type_char_ptr; +type_t *type_char_ptr_restrict; type_t *type_const_char_ptr; +type_t *type_const_char_ptr_restrict; type_t *type_int_ptr; type_t *type_long_long_ptr; type_t *type_long_ptr; @@ -52,6 +54,8 @@ type_t *type_unsigned_long_ptr; type_t *type_short_ptr; type_t *type_signed_char_ptr; type_t *type_void_ptr; +type_t *type_const_void_ptr; +type_t *type_void_ptr_restrict; type_t *type_char_ptr_ptr; @@ -71,6 +75,8 @@ type_t *type_ssize_t_ptr; type_t *type_wchar_t_ptr; type_t *type_const_wchar_t_ptr; +type_t *type_valist; + /* microsoft types */ atomic_type_kind_t int8_type_kind = ATOMIC_TYPE_INVALID; atomic_type_kind_t int16_type_kind = ATOMIC_TYPE_INVALID; @@ -96,8 +102,7 @@ type_t *type_int64_ptr; void init_basic_types(void) { - static const type_base_t error = { TYPE_ERROR, 0, TYPE_QUALIFIER_NONE, - TYPE_MODIFIER_NONE, 0, NULL }; + static const type_base_t error = { TYPE_ERROR, TYPE_QUALIFIER_NONE, NULL }; type_error_type = (type_t*)&error; type_bool = make_atomic_type(ATOMIC_TYPE_BOOL, TYPE_QUALIFIER_NONE); @@ -142,7 +147,10 @@ void init_basic_types(void) /* pointer types */ type_void_ptr = make_pointer_type(type_void, TYPE_QUALIFIER_NONE); + type_const_void_ptr = make_pointer_type(type_void, TYPE_QUALIFIER_CONST); + type_void_ptr_restrict = make_pointer_type(type_void, TYPE_QUALIFIER_RESTRICT); type_char_ptr = make_pointer_type(type_char, TYPE_QUALIFIER_NONE); + type_char_ptr_restrict = make_pointer_type(type_char, TYPE_QUALIFIER_RESTRICT); 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); @@ -155,6 +163,7 @@ void init_basic_types(void) /* 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); + type_const_char_ptr_restrict = make_pointer_type(type_const_char, TYPE_QUALIFIER_RESTRICT); /* other types */ type_intmax_t = type_long_long;