X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=type_t.h;h=dd7fcfd3e419cf758f192ec0ef6a02faf23005fc;hb=57569ce27c909aa9cda1d4e1b405c83ae0ef29cb;hp=efc97b650a2c755a51150cda9238ab4c2608f523;hpb=087130404a59dcdd95aa0d7ac7feec2793e9ce87;p=cparser diff --git a/type_t.h b/type_t.h index efc97b6..dd7fcfd 100644 --- a/type_t.h +++ b/type_t.h @@ -27,8 +27,10 @@ typedef enum { TYPE_TYPEOF } type_type_t; +/* note that the constant values represent the rank of the types as defined + * in § 6.3.1 */ typedef enum { - ATOMIC_TYPE_INVALID, + ATOMIC_TYPE_INVALID = 0, ATOMIC_TYPE_VOID, ATOMIC_TYPE_CHAR, ATOMIC_TYPE_SCHAR, @@ -49,8 +51,6 @@ typedef enum { ATOMIC_TYPE_FLOAT_COMPLEX, ATOMIC_TYPE_DOUBLE_COMPLEX, ATOMIC_TYPE_LONG_DOUBLE_COMPLEX, -#endif -#ifdef PROVIDE_IMAGINARY ATOMIC_TYPE_FLOAT_IMAGINARY, ATOMIC_TYPE_DOUBLE_IMAGINARY, ATOMIC_TYPE_LONG_DOUBLE_IMAGINARY, @@ -58,10 +58,10 @@ typedef enum { } atomic_type_type_t; typedef enum { + TYPE_QUALIFIER_NONE = 0, TYPE_QUALIFIER_CONST = 1 << 0, TYPE_QUALIFIER_RESTRICT = 1 << 1, TYPE_QUALIFIER_VOLATILE = 1 << 2, - TYPE_QUALIFIER_INLINE = 1 << 3, } type_qualifier_t; struct type_t { @@ -101,16 +101,16 @@ struct function_parameter_t { }; struct function_type_t { - type_t type; - type_t *result_type; + type_t type; + type_t *result_type; function_parameter_t *parameters; - bool variadic; - bool unspecified_parameters; + bool variadic; + bool unspecified_parameters; }; struct compound_type_t { type_t type; - /** the declaration of the compound type, it's context field + /** the declaration of the compound type, its context field * contains the compound entries. */ declaration_t *declaration; }; @@ -118,7 +118,7 @@ struct compound_type_t { struct enum_type_t { type_t type; /** the declaration of the enum type. You can find the enum entries by - * walking the declaration->context_next list until you don't find + * walking the declaration->next list until you don't find * STORAGE_CLASS_ENUM_ENTRY declarations anymore */ declaration_t *declaration; };