From 042f6d3a18be0b1cae4a34a91d6f60f9450261c3 Mon Sep 17 00:00:00 2001
From: Viktor Szakats <commit@vsz.me>
Date: Mon, 1 Apr 2024 11:59:36 +0000
Subject: [PATCH] silence `-Wparentheses` and `-Wparentheses-equality`

---
 cpp1.c   | 4 ++--
 cpp2.c   | 8 ++++----
 cpp3.c   | 2 +-
 cpp4.c   | 2 +-
 cpp5.c   | 4 ++--
 cpp6.c   | 2 +-
 usecpp.c | 4 ++--
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/cpp1.c b/cpp1.c
index 77556b0..5316f75 100644
--- a/cpp1.c
+++ b/cpp1.c
@@ -288,7 +288,7 @@ ReturnCode cppmain(struct Global *global)
     unget(global);                      /* Reread the char.     */
     for (;;) {                          /* For the whole line,  */
       do {                              /* Token concat. loop   */
-	for (global->chpos = counter = 0; (type[(c = get(global))] == SPA);) {
+	for (global->chpos = counter = 0; type[(c = get(global))] == SPA;) {
 #if COMMENT_INVISIBLE
 	  if (c != COM_SEP)
 	    counter++;
@@ -309,7 +309,7 @@ ReturnCode cppmain(struct Global *global)
 	    Putstring(global, global->spacebuf); /* Output all whitespaces */
 	  }
 	}
-	if(ret=macroid(global, &c))   /* Grab the token       */
+	if((ret=macroid(global, &c))!=0)   /* Grab the token       */
 	  return(ret);
       } while (type[c] == LET && catenate(global, &ret) && !ret);
       if(ret)
diff --git a/cpp2.c b/cpp2.c
index 4310f4d..cdf3afb 100644
--- a/cpp2.c
+++ b/cpp2.c
@@ -205,7 +205,7 @@ ReturnCode control( struct Global *global,
 
             while( c != '\n' && c != EOF_CHAR )
                 {
-                if( ret = save( global, c ) )
+                if( ( ret = save( global, c ) ) != 0 )
                     return(ret);
 
                 c = get( global );
@@ -213,7 +213,7 @@ ReturnCode control( struct Global *global,
 
             unget( global );
 
-            if( ret = save( global, EOS ) )
+            if( ( ret = save( global, EOS ) ) != 0 )
                 return(ret);
 
             /*
@@ -559,7 +559,7 @@ ReturnCode doinclude( struct Global *global )
 
     delim = skipws( global );
 
-    if( ret = macroid( global, &delim ) )
+    if( ( ret = macroid( global, &delim ) ) != 0 )
         return(ret);
 
     if( delim != '<' && delim != '"' )
@@ -575,7 +575,7 @@ ReturnCode doinclude( struct Global *global )
     global->workp = global->work;
 
     while( (c = get(global)) != '\n' && c != EOF_CHAR )
-        if( ret = save( global, c ) )       /* Put it away.                */
+        if( ( ret = save( global, c ) ) != 0 )  /* Put it away.                */
             return( ret );
 
     unget( global );                        /* Force nl after include      */
diff --git a/cpp3.c b/cpp3.c
index 2f77fbc..c789b85 100644
--- a/cpp3.c
+++ b/cpp3.c
@@ -198,7 +198,7 @@ int dooptions(struct Global *global, struct fppTag *tags)
         char *text=(char *)tags->data;
 
         sizp = size_table;
-        if (isdatum = (*text != '*')) /* If it's just -S,     */
+        if ((isdatum = (*text != '*'))!=0) /* If it's just -S,     */
           endtest = T_FPTR;     /* Stop here            */
         else {                  /* But if it's -S*      */
           text++;               /* Step over '*'        */
diff --git a/cpp4.c b/cpp4.c
index 2c64af2..8b89832 100644
--- a/cpp4.c
+++ b/cpp4.c
@@ -143,7 +143,7 @@ ReturnCode dodefine(struct Global *global)
       }
       while (global->workp > global->work && type[global->workp[-1]] == SPA)
 	--global->workp;		/* Erase leading spaces */
-      if(ret=save(global, TOK_SEP))     /* Stuff a delimiter    */
+      if((ret=save(global, TOK_SEP))!=0)     /* Stuff a delimiter    */
 	return(ret);
       c = skipws(global);               /* Eat whitespace       */
       continue;
diff --git a/cpp5.c b/cpp5.c
index c1aa8f4..d0fb32e 100644
--- a/cpp5.c
+++ b/cpp5.c
@@ -394,7 +394,7 @@ ReturnCode evallex(struct Global *global,
     loop=FALSE;
     do {					/* Collect the token	*/
       c = skipws(global);
-      if(ret=macroid(global, &c))
+      if((ret=macroid(global, &c))!=0)
       return(ret);
       if (c == EOF_CHAR || c == '\n') {
 	unget(global);
@@ -535,7 +535,7 @@ ReturnCode dosizeof(struct Global *global, int *result)
    */
   typecode = 0;
   while ((c = skipws(global))) {
-    if(ret=macroid(global, &c))
+    if((ret=macroid(global, &c))!=0)
       return(ret);
     /* (I) return on fail! */
     if (c  == EOF_CHAR || c == '\n') {
diff --git a/cpp6.c b/cpp6.c
index d817c1d..db395b1 100644
--- a/cpp6.c
+++ b/cpp6.c
@@ -193,7 +193,7 @@ ReturnCode macroid(struct Global *global, int *c)
   if (global->infile != NULL && global->infile->fp != NULL)
     global->recursion = 0;
   while (type[*c] == LET && (dp = lookid(global, *c)) != NULL) {
-    if(ret=expand(global, dp))
+    if((ret=expand(global, dp))!=0)
       return(ret);
     *c = get(global);
   }
diff --git a/usecpp.c b/usecpp.c
index 3611ed2..37ac5e6 100644
--- a/usecpp.c
+++ b/usecpp.c
@@ -288,7 +288,7 @@ char GetPrefs(struct fppTag **tagptr, char **string)
     Length_U = ftell(PrefsFile_PF);
     fseek(PrefsFile_PF, 0, SEEK_SET);
 
-    if (*string = (char *)malloc(Length_U+1)) {
+    if ((*string = (char *)malloc(Length_U+1))!=NULL) {
       fread(*string, 1, Length_U, PrefsFile_PF);
       (*string)[Length_U] = '\0';
       
@@ -301,7 +301,7 @@ char GetPrefs(struct fppTag **tagptr, char **string)
     }
   }
 
-  if(environ = getenv("CPP_PREFS")) {
+  if((environ = getenv("CPP_PREFS"))!=NULL) {
     ret= !DoString(tagptr, environ);
     if(ret && *string)
       free( *string );