]> granicus.if.org Git - graphviz/commitdiff
lib/glcomp: remove unnecessary parens
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 21 Mar 2022 04:34:55 +0000 (21:34 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Mar 2022 05:31:13 +0000 (22:31 -0700)
lib/glcomp/glcompbutton.c
lib/glcomp/glcomppanel.c
lib/glcomp/glcompset.c
lib/glcomp/glcomptexture.c
lib/glcomp/glpangofont.c
lib/glcomp/glutils.c

index 04c6ba1eb66ac228e011bddf5d6333a56d97b2bb..1328f6a0f5293fe30d9e082723f5669f84b1beb2 100644 (file)
@@ -152,7 +152,7 @@ void glCompButtonClick(glCompObj * o, GLfloat x, GLfloat y,
     {
        for (; ind < s->objcnt; ind++) {
            obj = s->obj[ind];
-           if ((obj->objType == glButtonObj)&&(obj!=o)) {
+           if (obj->objType == glButtonObj && obj != o) {
                if (((glCompButton *) obj)->groupid == p->groupid)
                    ((glCompButton *) obj)->status = 0;
            }
index df533dfec1e9495b046949c2abc7c6005b5a46f7..7ede96f9df891334fbbc2274a9a5c108b8d24c00 100644 (file)
@@ -77,8 +77,8 @@ int glCompPanelDraw(glCompObj * o)
     r.pos.z = -0.001f;
     glCompDrawRectangle(&r);
     /*draw panel */
-    glCompDrawRectPrism(&(ref.pos), ref.width, ref.height,
-                       p->common.borderWidth, 0.01f, &(ref.color), 1);
+    glCompDrawRectPrism(&ref.pos, ref.width, ref.height,
+                       p->common.borderWidth, 0.01f, &ref.color, 1);
     /*draw image if there is */
     if (p->image) {
        p->image->common.callbacks.draw((void *) p->image);
index 7cb222560b5bec6b462ff116d4800b7bb91dc3db..c91c5eca61e632cba5df47619bbba2e4f0306a77 100644 (file)
@@ -22,10 +22,10 @@ static GLfloat startX, startY;
 
 static int glCompPointInObject(glCompObj * p, float x, float y)
 {
-    return ((x > p->common.refPos.x)
-           && (x < p->common.refPos.x + p->common.width)
-           && (y > p->common.refPos.y)
-           && (y < p->common.refPos.y + p->common.height));
+  return x > p->common.refPos.x
+           && x < p->common.refPos.x + p->common.width
+           && y > p->common.refPos.y
+           && y < p->common.refPos.y + p->common.height;
 }
 
 glCompObj *glCompGetObjByMouse(glCompSet * s, glCompMouse * m,
@@ -36,12 +36,12 @@ glCompObj *glCompGetObjByMouse(glCompSet * s, glCompMouse * m,
     if (!s || !m)
        return NULL;
     for (ind = 0; ind < s->objcnt; ind++) {
-       if ((s->obj[ind]->common.visible)
-           && (glCompPointInObject(s->obj[ind], m->pos.x, m->pos.y))) {
-           if ((!rv) || (s->obj[ind]->common.layer >= rv->common.layer)) {
-               if (((onlyClickable)
-                    && (s->obj[ind]->common.functions.click))
-                   || (!onlyClickable))
+       if (s->obj[ind]->common.visible
+           && glCompPointInObject(s->obj[ind], m->pos.x, m->pos.y)) {
+           if (!rv || s->obj[ind]->common.layer >= rv->common.layer) {
+               if ((onlyClickable
+                    && s->obj[ind]->common.functions.click)
+                   || !onlyClickable)
                    rv = s->obj[ind];
            }
        }
@@ -123,7 +123,7 @@ static void glCompSetMouseUp(void *obj, GLfloat x, GLfloat y,
     if (((glCompSet *) obj)->common.callbacks.mouseup)
        ((glCompSet *) obj)->common.callbacks.mouseup(obj, x, y, t);
     /*check if mouse is clicked or dragged */
-    if ((startX == (int) tempX) && (startY == tempY))
+    if (startX == (int)tempX && startY == tempY)
        glCompSetMouseClick(obj, x, y, t);
 }
 
index bbb9ec7c39d4df85f091d91f4c0cbd63c21aa668..429a91244f5a9297f44cbf3bc903f9d1c7df8cf4 100644 (file)
@@ -111,10 +111,10 @@ glCompTex *glCompSetAddNewTexLabel(glCompSet * s, char *def, int fs,
      */
     for (ind = 0; ind < s->textureCount; ind++) {
        if (s->textures[ind]->type == glTexLabel) {
-           if ((strcmp(def, s->textures[ind]->def) == 0)
-               && (s->textures[ind]->type == glTexLabel)
-               && (strcmp(text, s->textures[ind]->text) == 0)
-               && (s->textures[ind]->fontSize==fs)) {
+           if (strcmp(def, s->textures[ind]->def) == 0
+               && s->textures[ind]->type == glTexLabel
+               && strcmp(text, s->textures[ind]->text) == 0
+               && s->textures[ind]->fontSize==fs) {
                s->textures[ind]->userCount++;
                return s->textures[ind];
            }
index 28e8271a4d053553c40398228f4b15e2192661cc..02943df071fb899c423d337c1ecacfb13aec01e5 100644 (file)
@@ -122,7 +122,7 @@ int glCompCreateFontFile(char *fontdescription, int fs, char *fontfile,
 
     for (c = 0; c < 256; c++) {
        counter++;
-       if ((c != 38) && (c != 60) && (c != 128) && (c < 129))
+       if (c != 38 && c != 60 && c != 128 && c < 129)
            buf[0] = (char)c;
        else
            buf[0] = ' ';
index a5cb52453679468ae6915a16db49740436351152..90a22f0f71bb68b57a081b0537ca852ccdc72d91 100644 (file)
@@ -123,7 +123,7 @@ void to3D(int x, int y, GLfloat * X, GLfloat * Y, GLfloat * Z)
                 GL_DEPTH_COMPONENT, GL_FLOAT, &winZ);
     comp = -9999999;
     for (idx = 0; idx < WIDTH * WIDTH; idx++) {
-       if ((winZ[idx] > comp) && (winZ[idx] < 1))
+       if (winZ[idx] > comp && winZ[idx] < 1)
            comp = winZ[idx];
     }
 
@@ -148,7 +148,7 @@ static glCompPoint sub(glCompPoint p, glCompPoint q)
 
 static double dot(glCompPoint p, glCompPoint q)
 {
-    return (p.x * q.x + p.y * q.y + p.z * q.z);
+    return p.x * q.x + p.y * q.y + p.z * q.z;
 }
 
 static double len(glCompPoint p)
@@ -168,7 +168,7 @@ static glCompPoint blend(glCompPoint p, glCompPoint q, float m)
 
 static double dist(glCompPoint p, glCompPoint q)
 {
-    return (len(sub(p, q)));
+    return len(sub(p, q));
 }
 
 /*
@@ -395,7 +395,7 @@ GLfloat distBetweenPts(glCompPoint A,glCompPoint B,float R)
 
 int is_point_in_rectangle(float X, float Y, float RX, float RY, float RW,float RH)
 {
-    if ((X >= RX) && (X <= (RX + RW)) && (Y >= RY) && (Y <= (RY + RH)))
+    if (X >= RX && X <= RX + RW && Y >= RY && Y <= RY + RH)
        return 1;
     else
        return 0;