From e2b89e5b8ee8e3f6f31c8c743504acedb81eb345 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 16 Jan 2022 11:20:35 -0800 Subject: [PATCH] remove comparisons against 'TRUE' literal The variables involved here are all booleans or used exclusively as booleans. --- cmd/lefty/aix_mods/exec.c | 2 +- cmd/lefty/exec.c | 2 +- cmd/lefty/leftyio.h | 2 +- cmd/smyrna/gltemplate.c | 2 +- lib/dotgen/mincross.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/lefty/aix_mods/exec.c b/cmd/lefty/aix_mods/exec.c index c501c032d..8e81a5c3f 100644 --- a/cmd/lefty/aix_mods/exec.c +++ b/cmd/lefty/aix_mods/exec.c @@ -277,7 +277,7 @@ static Tobj eeval(Tobj co, int ci) err(ERRNORHS, ERR4, co, TCgetnext(co, i1)); if (v1o) Mpopmark(m1); - return (orderop(v1o, ctype, v2o) == TRUE) ? Ttrue : Tfalse; + return orderop(v1o, ctype, v2o) ? Ttrue : Tfalse; case C_PLUS: case C_MINUS: case C_MUL: diff --git a/cmd/lefty/exec.c b/cmd/lefty/exec.c index 36f7dc745..f3a79feac 100644 --- a/cmd/lefty/exec.c +++ b/cmd/lefty/exec.c @@ -286,7 +286,7 @@ tailrec: err (ERRNORHS, ERR4, co, TCgetnext (co, i1)); if (v1o) Mpopmark (m1); - return (orderop (v1o, ctype, v2o) == TRUE) ? Ttrue: Tfalse; + return orderop (v1o, ctype, v2o) ? Ttrue: Tfalse; case C_PLUS: case C_MINUS: case C_MUL: diff --git a/cmd/lefty/leftyio.h b/cmd/lefty/leftyio.h index 7fd42d665..2849fb03d 100644 --- a/cmd/lefty/leftyio.h +++ b/cmd/lefty/leftyio.h @@ -49,7 +49,7 @@ typedef struct io_t { } while (0) #endif -#define IOismonitored(ioi) (iop[ioi].ismonitored == TRUE) +#define IOismonitored(ioi) iop[ioi].ismonitored #define IOINCR 5 #define IOSIZE sizeof (io_t) #define IOBUFSIZE 2048 diff --git a/cmd/smyrna/gltemplate.c b/cmd/smyrna/gltemplate.c index 59ed9af88..a7fa339dc 100644 --- a/cmd/smyrna/gltemplate.c +++ b/cmd/smyrna/gltemplate.c @@ -58,7 +58,7 @@ static void print_gl_config_attrib(GdkGLConfig * glconfig, g_print("%s = ", attrib_str); if (gdk_gl_config_get_attrib(glconfig, attrib, &value)) { if (is_boolean) - g_print("%s\n", value == TRUE ? "TRUE" : "FALSE"); + g_print("%s\n", value ? "TRUE" : "FALSE"); else g_print("%d\n", value); } else diff --git a/lib/dotgen/mincross.c b/lib/dotgen/mincross.c index 6b868cf38..43e3d4c6d 100644 --- a/lib/dotgen/mincross.c +++ b/lib/dotgen/mincross.c @@ -1222,7 +1222,7 @@ static void flat_search(graph_t * g, node_t * v) continue; if (ED_weight(e) == 0) continue; - if (ND_onstack(aghead(e)) == TRUE) { + if (ND_onstack(aghead(e))) { assert(flatindex(aghead(e)) < M->nrows); assert(flatindex(agtail(e)) < M->ncols); ELT(M, flatindex(aghead(e)), flatindex(agtail(e))) = 1; -- 2.40.0