Skip to content

Commit 52449e2

Browse files
author
Torbjorn Granlund
committed
Add casts for C++ compatibility.
1 parent 9d0b56b commit 52449e2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

gen-psqr.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ int
135135
f_cmp_divisor (const void *parg, const void *qarg)
136136
{
137137
const struct factor_t *p, *q;
138-
p = parg;
139-
q = qarg;
138+
p = (const struct factor_t *) parg;
139+
q = (const struct factor_t *) qarg;
140140
if (p->divisor > q->divisor)
141141
return 1;
142142
else if (p->divisor < q->divisor)
@@ -149,8 +149,8 @@ int
149149
f_cmp_fraction (const void *parg, const void *qarg)
150150
{
151151
const struct factor_t *p, *q;
152-
p = parg;
153-
q = qarg;
152+
p = (const struct factor_t *) parg;
153+
q = (const struct factor_t *) qarg;
154154
if (p->fraction > q->fraction)
155155
return 1;
156156
else if (p->fraction < q->fraction)
@@ -212,7 +212,7 @@ generate_sq_res_0x100 (int limb_bits)
212212
int i, res;
213213

214214
nsq_res_0x100 = (0x100 + limb_bits - 1) / limb_bits;
215-
sq_res_0x100 = xmalloc (nsq_res_0x100 * sizeof (*sq_res_0x100));
215+
sq_res_0x100 = (mpz_t *) xmalloc (nsq_res_0x100 * sizeof (*sq_res_0x100));
216216

217217
for (i = 0; i < nsq_res_0x100; i++)
218218
mpz_init_set_ui (sq_res_0x100[i], 0L);
@@ -243,8 +243,8 @@ generate_mod (int limb_bits, int nail_bits)
243243
/* no more than limb_bits many factors in a one limb modulus (and of
244244
course in reality nothing like that many) */
245245
factor_alloc = limb_bits;
246-
factor = xmalloc (factor_alloc * sizeof (*factor));
247-
rawfactor = xmalloc (factor_alloc * sizeof (*rawfactor));
246+
factor = (struct factor_t *) xmalloc (factor_alloc * sizeof (*factor));
247+
rawfactor = (struct rawfactor_t *) xmalloc (factor_alloc * sizeof (*rawfactor));
248248

249249
if (numb_bits % 4 != 0)
250250
{

0 commit comments

Comments
 (0)