From a9d002fead151c4ab5771a2808e2ae5968526dc0 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 20 Mar 2022 21:34:55 -0700 Subject: [PATCH] lib/glcomp: remove unnecessary parens --- lib/glcomp/glcompbutton.c | 2 +- lib/glcomp/glcomppanel.c | 4 ++-- lib/glcomp/glcompset.c | 22 +++++++++++----------- lib/glcomp/glcomptexture.c | 8 ++++---- lib/glcomp/glpangofont.c | 2 +- lib/glcomp/glutils.c | 8 ++++---- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/glcomp/glcompbutton.c b/lib/glcomp/glcompbutton.c index 04c6ba1eb..1328f6a0f 100644 --- a/lib/glcomp/glcompbutton.c +++ b/lib/glcomp/glcompbutton.c @@ -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; } diff --git a/lib/glcomp/glcomppanel.c b/lib/glcomp/glcomppanel.c index df533dfec..7ede96f9d 100644 --- a/lib/glcomp/glcomppanel.c +++ b/lib/glcomp/glcomppanel.c @@ -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); diff --git a/lib/glcomp/glcompset.c b/lib/glcomp/glcompset.c index 7cb222560..c91c5eca6 100644 --- a/lib/glcomp/glcompset.c +++ b/lib/glcomp/glcompset.c @@ -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); } diff --git a/lib/glcomp/glcomptexture.c b/lib/glcomp/glcomptexture.c index bbb9ec7c3..429a91244 100644 --- a/lib/glcomp/glcomptexture.c +++ b/lib/glcomp/glcomptexture.c @@ -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]; } diff --git a/lib/glcomp/glpangofont.c b/lib/glcomp/glpangofont.c index 28e8271a4..02943df07 100644 --- a/lib/glcomp/glpangofont.c +++ b/lib/glcomp/glpangofont.c @@ -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] = ' '; diff --git a/lib/glcomp/glutils.c b/lib/glcomp/glutils.c index a5cb52453..90a22f0f7 100644 --- a/lib/glcomp/glutils.c +++ b/lib/glcomp/glutils.c @@ -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; -- 2.40.0