From: Paul Eggert Date: Sat, 8 Sep 2018 00:13:59 +0000 (-0700) Subject: intprops: minor clarification of code X-Git-Tag: v1.0~5432 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=448d38da356ace2b415513d06cd98d95fe92d959;p=gnulib.git intprops: minor clarification of code * lib/intprops.h (_GL_BINARY_OP_OVERFLOW): Use _GL_INT_CONVERT rather than reinventing it. --- diff --git a/ChangeLog b/ChangeLog index cc3a8581a7..8d6f99f53a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-09-07 Paul Eggert + + 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 Fix a comment. diff --git a/lib/intprops.h b/lib/intprops.h index a4be30b8d0..9702aec4c6 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -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. */