[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] intprops: minor clarification of code
From: |
Paul Eggert |
Subject: |
[PATCH] intprops: minor clarification of code |
Date: |
Fri, 7 Sep 2018 17:14:46 -0700 |
* lib/intprops.h (_GL_BINARY_OP_OVERFLOW):
Use _GL_INT_CONVERT rather than reinventing it.
---
ChangeLog | 6 ++++++
lib/intprops.h | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cc3a8581a..8d6f99f53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-07 Paul Eggert <address@hidden>
+
+ 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 <address@hidden>
Fix a comment.
diff --git a/lib/intprops.h b/lib/intprops.h
index a4be30b8d..9702aec4c 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. */
--
2.17.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] intprops: minor clarification of code,
Paul Eggert <=