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

mercurial at gmplib.org mercurial at gmplib.org
Wed Nov 12 19:45:12 UTC 2014


details:   /var/hg/gmp/rev/cdc5e4b4ee99
changeset: 16510:cdc5e4b4ee99
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Nov 12 20:44:15 2014 +0100
description:
Add casts for C++ compatibility.

details:   /var/hg/gmp/rev/5f63eff03e54
changeset: 16511:5f63eff03e54
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Nov 12 20:44:44 2014 +0100
description:
Include config.h early for HAVE_xxx.

details:   /var/hg/gmp/rev/ed2343ef586b
changeset: 16512:ed2343ef586b
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Nov 12 20:45:07 2014 +0100
description:
ChangeLog

diffstat:

 ChangeLog            |   6 ++++++
 gen-psqr.c           |  14 +++++++-------
 tests/misc/t-scanf.c |   1 +
 3 files changed, 14 insertions(+), 7 deletions(-)

diffs (69 lines):

diff -r 48b3df21c477 -r ed2343ef586b ChangeLog
--- a/ChangeLog	Wed Nov 12 17:23:59 2014 +0100
+++ b/ChangeLog	Wed Nov 12 20:45:07 2014 +0100
@@ -1,3 +1,9 @@
+2014-11-12  Torbjörn Granlund  <torbjorng at google.com>
+
+	* gen-psqr.c: Add casts for C++ compatibility.
+
+	* tests/misc/t-scanf.c: Include config.h early for HAVE_xxx.
+
 2014-11-08  Torbjörn Granlund  <torbjorng at google.com>
 
 	* mpn/x86/x86-defs.m4 (LEA, LEAL): Make sure to put eip stub code in
diff -r 48b3df21c477 -r ed2343ef586b gen-psqr.c
--- a/gen-psqr.c	Wed Nov 12 17:23:59 2014 +0100
+++ b/gen-psqr.c	Wed Nov 12 20:45:07 2014 +0100
@@ -135,8 +135,8 @@
 f_cmp_divisor (const void *parg, const void *qarg)
 {
   const struct factor_t *p, *q;
-  p = parg;
-  q = qarg;
+  p = (const struct factor_t *) parg;
+  q = (const struct factor_t *) qarg;
   if (p->divisor > q->divisor)
     return 1;
   else if (p->divisor < q->divisor)
@@ -149,8 +149,8 @@
 f_cmp_fraction (const void *parg, const void *qarg)
 {
   const struct factor_t *p, *q;
-  p = parg;
-  q = qarg;
+  p = (const struct factor_t *) parg;
+  q = (const struct factor_t *) qarg;
   if (p->fraction > q->fraction)
     return 1;
   else if (p->fraction < q->fraction)
@@ -212,7 +212,7 @@
   int  i, res;
 
   nsq_res_0x100 = (0x100 + limb_bits - 1) / limb_bits;
-  sq_res_0x100 = xmalloc (nsq_res_0x100 * sizeof (*sq_res_0x100));
+  sq_res_0x100 = (mpz_t *) xmalloc (nsq_res_0x100 * sizeof (*sq_res_0x100));
 
   for (i = 0; i < nsq_res_0x100; i++)
     mpz_init_set_ui (sq_res_0x100[i], 0L);
@@ -243,8 +243,8 @@
   /* no more than limb_bits many factors in a one limb modulus (and of
      course in reality nothing like that many) */
   factor_alloc = limb_bits;
-  factor = xmalloc (factor_alloc * sizeof (*factor));
-  rawfactor = xmalloc (factor_alloc * sizeof (*rawfactor));
+  factor = (struct factor_t *) xmalloc (factor_alloc * sizeof (*factor));
+  rawfactor = (struct rawfactor_t *) xmalloc (factor_alloc * sizeof (*rawfactor));
 
   if (numb_bits % 4 != 0)
     {
diff -r 48b3df21c477 -r ed2343ef586b tests/misc/t-scanf.c
--- a/tests/misc/t-scanf.c	Wed Nov 12 17:23:59 2014 +0100
+++ b/tests/misc/t-scanf.c	Wed Nov 12 20:45:07 2014 +0100
@@ -28,6 +28,7 @@
    check_f, but enough differences to make a common loop or a set of macros
    seem like too much trouble. */
 
+#include "config.h"	/* needed for the HAVE_, could also move gmp incls */
 
 #include <stdarg.h>
 


More information about the gmp-commit mailing list