From 875ac75a204b98090d6a466e6d309699ada2e50b Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 30 Sep 1998 16:07:19 +0000 Subject: [PATCH] Warning fixes: * grant.c (decode_decl_selective): Cast switch's enum argument to an int. (really_grant_this): Add default case in switch. * typeck.c (chill_resulting_class): Add default cases in switch. Also add `break' statements after each case. From-SVN: r22677 --- gcc/ch/ChangeLog | 9 +++++++++ gcc/ch/grant.c | 4 +++- gcc/ch/typeck.c | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog index 994abe24312..afc42796743 100644 --- a/gcc/ch/ChangeLog +++ b/gcc/ch/ChangeLog @@ -1,3 +1,12 @@ +Wed Sep 30 19:03:02 1998 Kaveh R. Ghazi + + * grant.c (decode_decl_selective): Cast switch's enum argument to + an int. + (really_grant_this): Add default case in switch. + + * typeck.c (chill_resulting_class): Add default cases in switch. + Also add `break' statements after each case. + Tue Sep 29 21:37:33 1998 Kaveh R. Ghazi * ch-tree.h (build_compare_expr): Change first argument's type diff --git a/gcc/ch/grant.c b/gcc/ch/grant.c index eb441d86cc1..81162f0eed4 100644 --- a/gcc/ch/grant.c +++ b/gcc/ch/grant.c @@ -2405,7 +2405,7 @@ decode_decl_selective (decl, all_decls) CH_ALREADY_GRANTED (decl) = 1; - switch ((enum chill_tree_code)TREE_CODE (decl)) + switch ((int)TREE_CODE (decl)) { case VAR_DECL: case BASED_DECL: @@ -2789,6 +2789,8 @@ really_grant_this (decl, granted_decls) return search_in_list (DECL_NAME (decl), granted_decls); else return 1; + default: + break; } /* this nerver should happen */ diff --git a/gcc/ch/typeck.c b/gcc/ch/typeck.c index 71d0361b9ec..45bf8df862a 100644 --- a/gcc/ch/typeck.c +++ b/gcc/ch/typeck.c @@ -2036,7 +2036,10 @@ chill_resulting_class (class1, class2) class.mode = CH_ROOT_MODE (CH_RESULTING_MODE (class1.mode, class2.mode)); return class; + default: + break; } + break; case CH_DERIVED_CLASS: switch (class2.kind) { @@ -2052,7 +2055,10 @@ chill_resulting_class (class1, class2) class.kind = CH_DERIVED_CLASS; class.mode = CH_ROOT_MODE (class1.mode); return class; + default: + break; } + break; case CH_ALL_CLASS: switch (class2.kind) { @@ -2068,7 +2074,12 @@ chill_resulting_class (class1, class2) class.kind = CH_DERIVED_CLASS; class.mode = CH_ROOT_MODE (class2.mode); return class; + default: + break; } + break; + default: + break; } error ("internal error in chill_root_resulting_mode"); class.kind = CH_VALUE_CLASS;