]> Savannah Git Hosting - gnulib.git/commitdiff
intprops: minor clarification of code
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 8 Sep 2018 00:13:59 +0000 (17:13 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 8 Sep 2018 00:14:31 +0000 (17:14 -0700)
* lib/intprops.h (_GL_BINARY_OP_OVERFLOW):
Use _GL_INT_CONVERT rather than reinventing it.

ChangeLog
lib/intprops.h

index cc3a8581a7fc4ad1fdccfb84d46f447d1afd3954..8d6f99f53a2ae7b047690c22f41803d5f1fc9160 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       intprops: minor clarification of code
+       * lib/intprops.h (_GL_BINARY_OP_OVERFLOW):
+       Use _GL_INT_CONVERT rather than reinventing it.
+
 2018-09-07  Bruno Haible  <bruno@clisp.org>
 
        Fix a comment.
index a4be30b8d0fd3684d837d22dabcee2e000b42ad6..9702aec4c6e3c80ae01e6ef0053ac4ac55df3ca4 100644 (file)
    Arguments should be free of side effects.  */
 #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow)        \
   op_result_overflow (a, b,                                     \
-                      _GL_INT_MINIMUM ((1 ? 0 : (b)) + (a)),    \
-                      _GL_INT_MAXIMUM ((1 ? 0 : (b)) + (a)))
+                      _GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \
+                      _GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b)))
 
 /* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
    Return 1 if the result overflows.  See above for restrictions.  */