[Gmp-commit] /var/hg/gmp: Protect umul_ppmm with do ... while (0) as recommen...
mercurial at gmplib.org
mercurial at gmplib.org
Mon Aug 22 21:16:03 UTC 2016
details: /var/hg/gmp/rev/f9a7bfced8d0
changeset: 17070:f9a7bfced8d0
user: Marc Glisse <marc.glisse at inria.fr>
date: Mon Aug 22 23:15:56 2016 +0200
description:
Protect umul_ppmm with do ... while (0) as recommended by Vincent Lefevre.
diffstat:
ChangeLog | 9 +++++++--
longlong.h | 4 ++--
2 files changed, 9 insertions(+), 4 deletions(-)
diffs (47 lines):
diff -r 1d7e1bd08532 -r f9a7bfced8d0 ChangeLog
--- a/ChangeLog Mon Aug 22 21:49:01 2016 +0200
+++ b/ChangeLog Mon Aug 22 23:15:56 2016 +0200
@@ -1,3 +1,8 @@
+2016-08-22 Marc Glisse <marc.glisse at inria.fr>
+
+ * longlong.h (umul_ppmm from __umulsidi3): Protect with do ...
+ while (0).
+
2016-08-22 Niels Möller <nisse at lysator.liu.se>
* mini-gmp/mini-gmp.c (mpn_set_str_other): Always return size >=
@@ -8,7 +13,7 @@
failure for inputs string with no digits, i.e., empty except for
optional sign, base prefix and white space.
-2015-04-07 Marc Glisse <marc.glisse at inria.fr>
+2016-04-07 Marc Glisse <marc.glisse at inria.fr>
* gmp-h.in (__GMP_NOTHROW): Prefer noexcept to throw().
(mpz_init, mpz_inits): Mark as __GMP_NOTHROW.
@@ -49,7 +54,7 @@
* configure.ac: Support many arm64 processors.
-2015-03-20 Marc Glisse <marc.glisse at inria.fr>
+2016-03-20 Marc Glisse <marc.glisse at inria.fr>
* configure.ac (WANT_ASSEMBLY): Remove.
(NO_ASM): Remove from CFLAGS, add to AC_DEFINE.
diff -r 1d7e1bd08532 -r f9a7bfced8d0 longlong.h
--- a/longlong.h Mon Aug 22 21:49:01 2016 +0200
+++ b/longlong.h Mon Aug 22 23:15:56 2016 +0200
@@ -1895,11 +1895,11 @@
/* FIXME: "sidi" here is highly doubtful, should sometimes be "diti". */
#if !defined (umul_ppmm) && defined (__umulsidi3)
#define umul_ppmm(ph, pl, m0, m1) \
- { \
+ do { \
UDWtype __ll = __umulsidi3 (m0, m1); \
ph = (UWtype) (__ll >> W_TYPE_SIZE); \
pl = (UWtype) __ll; \
- }
+ } while (0)
#endif
#if !defined (__umulsidi3)
More information about the gmp-commit
mailing list