[Gmp-commit] /var/hg/gmp: 11 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Thu Nov 19 20:37:22 UTC 2020


details:   /var/hg/gmp/rev/0c57dbd25da1
changeset: 18140:0c57dbd25da1
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 13:22:55 2020 +0100
description:
Provide default M_PI definition.

details:   /var/hg/gmp/rev/b6da5180f15f
changeset: 18141:b6da5180f15f
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 13:26:24 2020 +0100
description:
Avoid using non-standard function fileno()

details:   /var/hg/gmp/rev/8ed2f54f36cf
changeset: 18142:8ed2f54f36cf
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 13:30:21 2020 +0100
description:
Avoid using non-standard function fileno().

details:   /var/hg/gmp/rev/e54d7de9a087
changeset: 18143:e54d7de9a087
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 13:32:25 2020 +0100
description:
Add clarifying parens.

details:   /var/hg/gmp/rev/a3f910436542
changeset: 18144:a3f910436542
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 13:35:32 2020 +0100
description:
Amend last change.

details:   /var/hg/gmp/rev/76a1c21700d9
changeset: 18145:76a1c21700d9
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 13:46:25 2020 +0100
description:
Add some {} to suppress warning.

details:   /var/hg/gmp/rev/001a1044f22e
changeset: 18146:001a1044f22e
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 13:53:01 2020 +0100
description:
Use local str_casecmp instead of non-standard strcasecmp.

details:   /var/hg/gmp/rev/ca1fc5ce45b2
changeset: 18147:ca1fc5ce45b2
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 14:21:18 2020 +0100
description:
Use reference parameter for 'catch'.

details:   /var/hg/gmp/rev/6921f9091835
changeset: 18148:6921f9091835
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 21:34:03 2020 +0100
description:
(main): Cast printf args to right type.

details:   /var/hg/gmp/rev/90f2f8c5605f
changeset: 18149:90f2f8c5605f
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 21:34:19 2020 +0100
description:
(main): Cast printf args to right type.

details:   /var/hg/gmp/rev/9003dd9f091a
changeset: 18150:9003dd9f091a
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Nov 19 21:37:20 2020 +0100
description:
ChangeLog

diffstat:

 ChangeLog                                                   |  22 ++++++++++
 mini-gmp/ChangeLog                                          |   4 +
 mini-gmp/tests/t-double.c                                   |   4 +
 mpn/generic/get_d.c                                         |   2 +-
 mpz/mul.c                                                   |  16 ++++---
 tests/cxx/t-assign.cc                                       |  12 ++--
 tests/cxx/t-constr.cc                                       |  28 ++++++------
 tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc |   2 +-
 tests/cxx/t-ops2z.cc                                        |  14 +++---
 tests/cxx/t-rand.cc                                         |   2 +-
 tests/mpf/t-get_d_2exp.c                                    |   2 +-
 tests/mpz/convert.c                                         |  19 ++++++++-
 tests/mpz/reuse.c                                           |   6 +-
 tests/spinner.c                                             |   2 +-
 tune/speed.c                                                |   2 +-
 tune/time.c                                                 |  14 +++--
 16 files changed, 101 insertions(+), 50 deletions(-)

diffs (truncated from 489 to 300 lines):

diff -r 4b185f597c54 -r 9003dd9f091a ChangeLog
--- a/ChangeLog	Thu Nov 19 12:21:06 2020 +0100
+++ b/ChangeLog	Thu Nov 19 21:37:20 2020 +0100
@@ -84,6 +84,28 @@
 
 	* configure.ac: Recognise armcortexa55.
 
+2020-05-25  Torbjörn Granlund  <tg at gmplib.org>
+
+	* tests/cxx/t-assign.cc: Use reference parameter for 'catch'.
+	* tests/cxx/t-constr.cc: Likewise.
+	* tests/cxx/t-ops2z.cc: Likewise.
+	* tests/cxx/t-rand.cc: Likewise.
+	* tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc: Likewise.
+
+2020-05-21  Torbjörn Granlund  <tg at gmplib.org>
+
+	* tune/time.c (speed_endtime): Cast printf args to right type.
+
+	* tune/speed.c (main): Cast printf args to right type.
+
+	* tests/mpz/reuse.c: Avoid using non-standard function fileno().
+	* tests/spinner.c: Likewise.
+
+	* tests/mpz/convert.c (str_casecmp): New function.
+	(main): Use it instead of non-standard strcasecmp.
+
+	* mpn/generic/get_d.c: Add clarifying parens.
+
 2020-05-17 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mpq/cmp.c: Avoid overflow on int even for huge sizes.
diff -r 4b185f597c54 -r 9003dd9f091a mini-gmp/ChangeLog
--- a/mini-gmp/ChangeLog	Thu Nov 19 12:21:06 2020 +0100
+++ b/mini-gmp/ChangeLog	Thu Nov 19 21:37:20 2020 +0100
@@ -1,3 +1,7 @@
+2020-05-21  Torbjörn Granlund  <tg at gmplib.org>
+
+	* tests/t-double.c: Provide default M_PI definition.
+
 2020-11-10 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* tests/run-tests: Update WINEPATH, instead of overwriting it.
diff -r 4b185f597c54 -r 9003dd9f091a mini-gmp/tests/t-double.c
--- a/mini-gmp/tests/t-double.c	Thu Nov 19 12:21:06 2020 +0100
+++ b/mini-gmp/tests/t-double.c	Thu Nov 19 21:37:20 2020 +0100
@@ -118,6 +118,10 @@
   mpz_clear (y);
 }
 
+#ifndef M_PI
+#define M_PI 3.141592653589793238462643383279502884
+#endif
+
 static const struct
 {
   double d;
diff -r 4b185f597c54 -r 9003dd9f091a mpn/generic/get_d.c
--- a/mpn/generic/get_d.c	Thu Nov 19 12:21:06 2020 +0100
+++ b/mpn/generic/get_d.c	Thu Nov 19 21:37:20 2020 +0100
@@ -226,7 +226,7 @@
 	      x <<= GMP_NAIL_BITS;
 	      mhi |= x >> nbits >> 11;
 
-	      mlo = x << GMP_LIMB_BITS - nbits - 11;
+	      mlo = x << (GMP_LIMB_BITS - nbits - 11);
 	      nbits = nbits + 11 - GMP_NAIL_BITS;
 	    }
 	  else
diff -r 4b185f597c54 -r 9003dd9f091a mpz/mul.c
--- a/mpz/mul.c	Thu Nov 19 12:21:06 2020 +0100
+++ b/mpz/mul.c	Thu Nov 19 21:37:20 2020 +0100
@@ -104,13 +104,15 @@
   if (ALLOC (w) < wsize)
     {
       if (ALLOC (w) != 0)
-	if (wp == up || wp == vp)
-	  {
-	    free_me = wp;
-	    free_me_size = ALLOC (w);
-	  }
-	else
-	  (*__gmp_free_func) (wp, (size_t) ALLOC (w) * GMP_LIMB_BYTES);
+	{
+	  if (wp == up || wp == vp)
+	    {
+	      free_me = wp;
+	      free_me_size = ALLOC (w);
+	    }
+	  else
+	    (*__gmp_free_func) (wp, (size_t) ALLOC (w) * GMP_LIMB_BYTES);
+	}
 
       ALLOC (w) = wsize;
       wp = __GMP_ALLOCATE_FUNC_LIMBS (wsize);
diff -r 4b185f597c54 -r 9003dd9f091a tests/cxx/t-assign.cc
--- a/tests/cxx/t-assign.cc	Thu Nov 19 12:21:06 2020 +0100
+++ b/tests/cxx/t-assign.cc	Thu Nov 19 21:37:20 2020 +0100
@@ -171,7 +171,7 @@
       mpz_class b;
       b = a;
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -182,7 +182,7 @@
       mpz_class b;
       b = a;
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -357,7 +357,7 @@
       mpq_class b;
       b = a;
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -368,7 +368,7 @@
       mpq_class b;
       b = a;
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -543,7 +543,7 @@
       mpf_class b;
       b = a;
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -554,7 +554,7 @@
       mpf_class b;
       b = a;
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
diff -r 4b185f597c54 -r 9003dd9f091a tests/cxx/t-constr.cc
--- a/tests/cxx/t-constr.cc	Thu Nov 19 12:21:06 2020 +0100
+++ b/tests/cxx/t-constr.cc	Thu Nov 19 21:37:20 2020 +0100
@@ -154,7 +154,7 @@
       const char *a = "ABC";
       mpz_class b(a);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -165,7 +165,7 @@
       int base = 16;
       mpz_class b(a, base);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -175,7 +175,7 @@
       string a("abc");
       mpz_class b(a);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -186,7 +186,7 @@
       int base = 8;
       mpz_class b(a, base);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -341,7 +341,7 @@
       const char *a = "abc";
       mpq_class b(a);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -352,7 +352,7 @@
       int base = 16;
       mpq_class b (a, base);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -362,7 +362,7 @@
       string a("abc");
       mpq_class b(a);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -373,7 +373,7 @@
       int base = 8;
       mpq_class b (a, base);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -635,7 +635,7 @@
       const char *a = "abc";
       mpf_class b(a);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -646,7 +646,7 @@
       int prec = 256;
       mpf_class b(a, prec); ASSERT_ALWAYS(b == 1234567890L);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
   {
@@ -655,7 +655,7 @@
       int prec = 64, base = 8;
       mpf_class b(a, prec, base); ASSERT_ALWAYS(b == 262143L);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -665,7 +665,7 @@
       string a("abc");
       mpf_class b(a); ASSERT_ALWAYS(b == 1234567890L);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
@@ -676,7 +676,7 @@
       int prec = 128;
       mpf_class b(a, prec); ASSERT_ALWAYS(b == 1234567890L);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
   {
@@ -685,7 +685,7 @@
       int prec = 256, base = 16;
       mpf_class b(a, prec, base); ASSERT_ALWAYS(b == 65535u);
       ASSERT_ALWAYS (0);  /* should not be reached */
-    } catch (invalid_argument) {
+    } catch (invalid_argument&) {
     }
   }
 
diff -r 4b185f597c54 -r 9003dd9f091a tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc
--- a/tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc	Thu Nov 19 12:21:06 2020 +0100
+++ b/tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc	Thu Nov 19 21:37:20 2020 +0100
@@ -34,5 +34,5 @@
   {
     throw_expr();
   }
-  catch (invalid_argument) { }
+  catch (invalid_argument&) { }
 }
diff -r 4b185f597c54 -r 9003dd9f091a tests/cxx/t-ops2z.cc
--- a/tests/cxx/t-ops2z.cc	Thu Nov 19 12:21:06 2020 +0100
+++ b/tests/cxx/t-ops2z.cc	Thu Nov 19 21:37:20 2020 +0100
@@ -89,22 +89,22 @@
   ASSERT_ALWAYS(mpz_class::factorial(3.f)==6);
   mpz_class ret;
   try { ret=factorial(-mpz_class(3)); ASSERT_ALWAYS(0); }
-  catch (std::domain_error) {}
+  catch (std::domain_error&) {}



More information about the gmp-commit mailing list