- fixed some "enumerated type mixed with another type" warnings on icc
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 31 Aug 2008 09:59:40 +0000 (09:59 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 31 Aug 2008 09:59:40 +0000 (09:59 +0000)
[r21573]

ast2firm.c
parser.c

index 127498d..839f75a 100644 (file)
@@ -1067,7 +1067,7 @@ static ir_entity *get_function_entity(declaration_t *declaration)
         * extern inline             => local
         * inline without definition => local
         * inline with definition    => external_visible */
-       storage_class_tag_t const storage_class = declaration->storage_class;
+       storage_class_tag_t const storage_class = (storage_class_tag_t)declaration->storage_class;
        bool                const is_inline     = declaration->is_inline;
        bool                const has_body      = declaration->init.statement != NULL;
        if (is_inline && storage_class == STORAGE_CLASS_NONE && has_body) {
index 6b78426..f41ed52 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -840,7 +840,7 @@ static void label_pop_to(size_t new_top)
 }
 
 
-static int get_rank(const type_t *type)
+static atomic_type_kind_t get_rank(const type_t *type)
 {
        assert(!is_typeref(type));
        /* The C-standard allows promoting enums to int or unsigned int (see ยง 7.2.2
@@ -3233,10 +3233,10 @@ static void parse_declaration_specifiers(declaration_specifiers_t *specifiers)
 
                        type_t *const typedef_type = get_typedef_type(token.v.symbol);
                        if (typedef_type == NULL) {
-                               /* Be somewhat resilient to typos like 'vodi f()' at the beginning of a
+                               /* Be somewhat resilient to typos like 'void f()' at the beginning of a
                                 * declaration, so it doesn't generate 'implicit int' followed by more
                                 * errors later on. */
-                               token_type_t const la1_type = look_ahead(1)->type;
+                               token_type_t const la1_type = (token_type_t)look_ahead(1)->type;
                                switch (la1_type) {
                                        DECLARATION_START
                                        case T_IDENTIFIER:
@@ -7206,16 +7206,16 @@ static type_t *semantic_arithmetic(type_t *type_left, type_t *type_right)
 
        bool const signed_left  = is_type_signed(type_left);
        bool const signed_right = is_type_signed(type_right);
-       int  const rank_left    = get_rank(type_left);
-       int  const rank_right   = get_rank(type_right);
+       atomic_type_kind_t const rank_left  = get_rank(type_left);
+       atomic_type_kind_t const rank_right = get_rank(type_right);
 
        if (signed_left == signed_right)
                return rank_left >= rank_right ? type_left : type_right;
 
-       int     s_rank;
-       int     u_rank;
-       type_t *s_type;
-       type_t *u_type;
+       atomic_type_kind_t  s_rank;
+       atomic_type_kind_t  u_rank;
+       type_t             *s_type;
+       type_t             *u_type;
        if (signed_left) {
                s_rank = rank_left;
                s_type = type_left;