[Gmp-commit] /var/hg/gmp: mpz/oddfac_1.c: Initalize size for ASSERT.

mercurial at gmplib.org mercurial at gmplib.org
Mon Apr 2 18:06:01 CEST 2012


details:   /var/hg/gmp/rev/1262d026cdb5
changeset: 14789:1262d026cdb5
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Apr 02 17:43:38 2012 +0200
description:
mpz/oddfac_1.c: Initalize size for ASSERT.

diffstat:

 ChangeLog      |  4 ++++
 mpz/oddfac_1.c |  3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r cf38aec0797e -r 1262d026cdb5 ChangeLog
--- a/ChangeLog	Mon Apr 02 16:43:17 2012 +0200
+++ b/ChangeLog	Mon Apr 02 17:43:38 2012 +0200
@@ -1,3 +1,7 @@
+2012-04-02 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mpz/oddfac_1.c: Initalize size for ASSERT.
+
 2012-04-02  Torbjorn Granlund  <tege at gmplib.org>
 
 	* gmp-h.in (_GMP_H_HAVE_FILE): Test also __STDIO_LOADED (for VMS).
diff -r cf38aec0797e -r 1262d026cdb5 mpz/oddfac_1.c
--- a/mpz/oddfac_1.c	Mon Apr 02 16:43:17 2012 +0200
+++ b/mpz/oddfac_1.c	Mon Apr 02 17:43:38 2012 +0200
@@ -585,6 +585,9 @@
 	  /* 2-multiswing(n) < 2^(n-1)*sqrt(n/pi) < 2^(n+GMP_NUMB_BITS);
 	     one more can be overwritten by mul, another for the sieve */
 	  MPZ_TMP_INIT (mswing, size);
+#if WANT_ASSERT
+	  SIZ(mswing) = 0; /* Initialize size, so that ASSERT can check it correctly. */
+#endif
 	  /* Put the sieve on the second half, it will be overwritten by the last mswing. */
 	  sieve = PTR (mswing) + size / 2 + 1;
 


More information about the gmp-commit mailing list