diff options
author | Torbjorn Granlund <torbjorng@google.com> | 2014-11-12 20:44:15 +0100 |
---|---|---|
committer | Torbjorn Granlund <torbjorng@google.com> | 2014-11-12 20:44:15 +0100 |
commit | 0e6fcd37c82a5c307ff580427ed04e51f95784f1 (patch) | |
tree | 289c2b43909ea5bf03260f041147a9d7a8324b00 /gen-psqr.c | |
parent | 1107ec3bf5d78acf06fb75ef07b9447a92351bda (diff) | |
download | gmp-0e6fcd37c82a5c307ff580427ed04e51f95784f1.tar.gz |
Add casts for C++ compatibility.
Diffstat (limited to 'gen-psqr.c')
-rw-r--r-- | gen-psqr.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gen-psqr.c b/gen-psqr.c index 23094b31c..a5054c627 100644 --- a/gen-psqr.c +++ b/gen-psqr.c @@ -135,8 +135,8 @@ int 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 @@ int 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 @@ generate_sq_res_0x100 (int limb_bits) 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 @@ generate_mod (int limb_bits, int nail_bits) /* 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) { |