]> Savannah Git Hosting - gnulib.git/commitdiff
intprops: be consistent about +X vs X+0
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 23 Aug 2020 20:14:14 +0000 (13:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 23 Aug 2020 20:15:35 +0000 (13:15 -0700)
* lib/intprops.h (_GL_SIGNED_INT_MAXIMUM): Simplify.

ChangeLog
lib/intprops.h

index a6caef9b04935fbbcc76d0aa073857ee0dc704bc..e51ea41e3934fd45d9790af571481a7e50f8d67f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2020-08-23  Paul Eggert  <eggert@cs.ucla.edu>
 
+       intprops: be consistent about +X vs X+0
+       * lib/intprops.h (_GL_SIGNED_INT_MAXIMUM): Simplify.
+
        intprops: fix INT_MULTIPLY_WRAPV bit-field bug
        The bug occurs when using INT_MULTIPLY_WRAPV (a, b, c) where B
        is a bit-field, on older GCC or non-GCC compilers where we do
index 1bd93d11f953b65d8701ddf996bddb80407965db..df66a3877abbe9e563e2b285297e2702c8106adc 100644 (file)
@@ -70,7 +70,7 @@
    ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
    : _GL_INT_NEGATE_CONVERT (e, 1))
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
-  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
+  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
 
 /* Work around OpenVMS incompatibility with C99.  */
 #if !defined LLONG_MAX && defined __INT64_MAX