isl_printer_print_aff: only print () when needed in C format
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 3 Jan 2012 10:30:04 +0000 (11:30 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 3 Jan 2012 11:01:17 +0000 (12:01 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_output.c

index 6883e7f..cc91245 100644 (file)
@@ -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]);
        }