]> granicus.if.org Git - graphviz/commitdiff
remove unnecessary bracketing
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Feb 2021 04:07:45 +0000 (20:07 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 2 Mar 2021 06:05:11 +0000 (22:05 -0800)
lib/xdot/xdot.c

index df6897af04efdfb2edd140268c16432d29344b84..8f1db086c97040766746e5b2c5053eb04abe463f 100644 (file)
@@ -192,15 +192,15 @@ static char *parseString(char *s, char **sp)
     char *c;
     char *p;
     s = parseInt(s, &i);
-    if (!s || (i <= 0)) return 0;
-    while (*s && (*s != '-')) s++;
+    if (!s || i <= 0) return 0;
+    while (*s && *s != '-') s++;
     if (*s) s++;
     else {
        return 0;
     }
     c = N_NEW(i + 1, char);
     p = c;
-    while ((i > 0) && *s) {
+    while (i > 0 && *s) {
        *p++ = *s++;
        i--;
     }
@@ -434,7 +434,7 @@ xdot *parseXDotFOn (char *s, drawfunc_t fns[], int sz, xdot* x)
        ops = (char*)(x->ops);
        bufsz = initcnt + XDBSIZE;
        ops = realloc(ops, bufsz * sz);
-       memset(ops + (initcnt*sz), '\0', (bufsz - initcnt)*sz);
+       memset(ops + initcnt*sz, '\0', (bufsz - initcnt)*sz);
     }
 
     while ((s = parseOp(&op, s, fns, &error))) {
@@ -442,9 +442,9 @@ xdot *parseXDotFOn (char *s, drawfunc_t fns[], int sz, xdot* x)
            oldsz = bufsz;
            bufsz *= 2;
            ops = realloc(ops, bufsz * sz);
-           memset(ops + (oldsz*sz), '\0', (bufsz - oldsz)*sz);
+           memset(ops + oldsz*sz, '\0', (bufsz - oldsz)*sz);
        }
-       *(xdot_op *) (ops + (x->cnt * sz)) = op;
+       *(xdot_op *) (ops + x->cnt * sz) = op;
        x->cnt++;
     }
     if (error)
@@ -848,7 +848,7 @@ static void _printXDot(xdot * x, pf print, void *info, print_op ofn)
     char *base = (char *) (x->ops);
     for (i = 0; i < x->cnt; i++) {
        op = (xdot_op *) (base + i * x->sz);
-       ofn(op, print, info, (i < x->cnt - 1));
+       ofn(op, print, info, i < x->cnt - 1);
     }
 }