From 79d11c9945e711df054d733ebf3dec290bab03ac Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 3 Jan 2012 11:30:04 +0100 Subject: [PATCH] isl_printer_print_aff: only print () when needed in C format Signed-off-by: Sven Verdoolaege --- isl_output.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/isl_output.c b/isl_output.c index 6883e7f..cc91245 100644 --- a/isl_output.c +++ b/isl_output.c @@ -2189,11 +2189,10 @@ static __isl_give isl_printer *print_aff_c(__isl_take isl_printer *p, unsigned total; total = isl_local_space_dim(aff->ls, isl_dim_all); - p = isl_printer_print_str(p, "("); + if (!isl_int_is_one(aff->v->el[0])) + p = isl_printer_print_str(p, "("); p = print_ls_partial_affine_c(p, aff->ls, aff->v->el + 1, 1 + total); - if (isl_int_is_one(aff->v->el[0])) - p = isl_printer_print_str(p, ")"); - else { + if (!isl_int_is_one(aff->v->el[0])) { p = isl_printer_print_str(p, ")/"); p = isl_printer_print_isl_int(p, aff->v->el[0]); } -- 2.7.4