]> Savannah Git Hosting - gnulib.git/commitdiff
maint: parenthesize macro definiens
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 10 Aug 2022 07:17:58 +0000 (00:17 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 10 Aug 2022 07:22:10 +0000 (00:22 -0700)
* lib/intprops.h (INT_ADD_OK, INT_SUBTRACT_OK, INT_MULTIPLY_OK):
* lib/pipe-filter-ii.c (GetLastError):
* lib/thread-optim.h (gl_multithreaded): Parenthesize
function-like macro definiens beginning with a unary operator;
needed for weird invocations like ‘m (...)[p]’.

ChangeLog
lib/intprops.h
lib/pipe-filter-ii.c
lib/thread-optim.h

index 5293fc104f8f18f315f3160fb7eb4b6ac4b52442..f9499921ddbb11a7f3015915fc4b18f467c2bae8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-08-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       maint: parenthesize macro definiens
+       * lib/intprops.h (INT_ADD_OK, INT_SUBTRACT_OK, INT_MULTIPLY_OK):
+       * lib/pipe-filter-ii.c (GetLastError):
+       * lib/thread-optim.h (gl_multithreaded): Parenthesize
+       function-like macro definiens beginning with a unary operator;
+       needed for weird invocations like ‘m (...)[p]’.
+
 2022-08-09  Paul Eggert  <eggert@cs.ucla.edu>
 
        stdckdint: prefer to intprops when easy
index b9113845329f5b3efbb6237920566f5fa2268058..f182ddc1fe6142bc23e8975f8d165abf8b6e68f6 100644 (file)
 
    These macros are tuned for B being a constant.  */
 
-#define INT_ADD_OK(a, b, r) ! INT_ADD_WRAPV (a, b, r)
-#define INT_SUBTRACT_OK(a, b, r) ! INT_SUBTRACT_WRAPV (a, b, r)
-#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r)
+#define INT_ADD_OK(a, b, r) (! INT_ADD_WRAPV (a, b, r))
+#define INT_SUBTRACT_OK(a, b, r) (! INT_SUBTRACT_WRAPV (a, b, r))
+#define INT_MULTIPLY_OK(a, b, r) (! INT_MULTIPLY_WRAPV (a, b, r))
 
 #endif /* _GL_INTPROPS_H */
index 8f547791c6a1b0e9ff701b2314a233aad300a848..06729584f011dbc58aa7b555bdd1fc2eee335dbd 100644 (file)
@@ -98,7 +98,7 @@ CloseHandle (HANDLE h)
 # define _endthreadex(x) return (x)
 # define TerminateThread(h, e) DosKillThread (h->tid)
 
-# define GetLastError()  -1
+# define GetLastError()  (-1)
 
 # ifndef ERROR_NO_DATA
 #  define ERROR_NO_DATA 232
index daf887fda9adc314f779ded7359af09f2d321600..dc1ad8622c50b75e6dcf9839a702adf4b6e48076 100644 (file)
@@ -52,7 +52,7 @@
 
 #if HAVE_SYS_SINGLE_THREADED_H /* glibc >= 2.32 */
 # include <sys/single_threaded.h>
-# define gl_multithreaded()  !__libc_single_threaded
+# define gl_multithreaded()  (!__libc_single_threaded)
 #else
 # define gl_multithreaded()  1
 #endif