summaryrefslogtreecommitdiff
path: root/switch.c
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2007-10-18 02:19:04 -0400
committerSøren Sandmann <sandmann@redhat.com>2007-10-18 02:19:04 -0400
commited7dde2e7514909ef05265a976f4ee861311c632 (patch)
treebbd658274581502f304dce90fe31e527c15b4e7b /switch.c
parent1d6b87c9d06407d2b0983f1b9fd9bd7505931bb4 (diff)
Use report_error in prepare.c
Diffstat (limited to 'switch.c')
-rw-r--r--switch.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/switch.c b/switch.c
index 04c0c57..4a921c4 100644
--- a/switch.c
+++ b/switch.c
@@ -124,9 +124,8 @@ check_constant_case_expressions (ast_t *ast)
if (!constant_expression (ast->case_.expression.expression, &value))
{
- g_print ("Expression in case clause must be constant\n");
-
- return FALSE;
+ return report_error (
+ "Expression in case clause must be constant\n");
}
#if 0
@@ -185,8 +184,7 @@ check_unique_cases (ast_t *ast)
if (case_a->common.type == AST_DEFAULT_CASE &&
case_b->common.type == AST_DEFAULT_CASE)
{
- g_print ("duplicate default case\n");
- return FALSE;
+ return report_error ("duplicate default case\n");
}
else if (case_a->common.type == AST_EXPRESSION_CASE &&
case_b->common.type == AST_EXPRESSION_CASE)
@@ -209,10 +207,7 @@ check_unique_cases (ast_t *ast)
bool, &result);
if (result.bool_val == TRUE)
- {
- g_print ("duplicate case value\n");
- return FALSE;
- }
+ return report_error ("duplicate case value\n");
}
}
}