changeset 39831:47cca1921b32

intprops: minor clarification of code * lib/intprops.h (_GL_BINARY_OP_OVERFLOW): Use _GL_INT_CONVERT rather than reinventing it.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 07 Sep 2018 17:13:59 -0700
parents bce09b317af9
children 8228a72f9f50
files ChangeLog lib/intprops.h
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Sep 07 23:39:37 2018 +0200
+++ b/ChangeLog	Fri Sep 07 17:13:59 2018 -0700
@@ -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.
--- a/lib/intprops.h	Fri Sep 07 23:39:37 2018 +0200
+++ b/lib/intprops.h	Fri Sep 07 17:13:59 2018 -0700
@@ -342,8 +342,8 @@
    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.  */