diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2016-01-03 10:17:47 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2016-01-03 10:17:47 +0100 |
commit | 921222da5671975127f861c4a3894de321fa3dbc (patch) | |
tree | 33ceda7bf6eb89c5fe1fa5ccfeea1a7588a6600d /gen-fac.c | |
parent | 5410fe122b979ebc5dcc396671e686aabc177ab0 (diff) | |
download | gmp-921222da5671975127f861c4a3894de321fa3dbc.tar.gz |
gen-fac.c: Use unsigned types for sizes.
Diffstat (limited to 'gen-fac.c')
-rw-r--r-- | gen-fac.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,6 +1,6 @@ /* Generate data for combinatorics: fac_ui, bin_uiui, ... -Copyright 2002, 2011-2015 Free Software Foundation, Inc. +Copyright 2002, 2011-2016 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -43,19 +43,19 @@ mpz_remove_twos (mpz_t x) /* returns 0 on success */ int -gen_consts (int numb, int nail, int limb) +gen_consts (unsigned numb, unsigned limb) { mpz_t x, mask, y, last; unsigned long a, b; unsigned long ofl, ofe; printf ("/* This file is automatically generated by gen-fac.c */\n\n"); - printf ("#if GMP_NUMB_BITS != %d\n", numb); - printf ("Error , error this data is for %d GMP_NUMB_BITS only\n", numb); + printf ("#if GMP_NUMB_BITS != %u\n", numb); + printf ("Error , error this data is for %u GMP_NUMB_BITS only\n", numb); printf ("#endif\n"); #if 0 - printf ("#if GMP_LIMB_BITS != %d\n", limb); - printf ("Error , error this data is for %d GMP_LIMB_BITS only\n", limb); + printf ("#if GMP_LIMB_BITS != %u\n", limb); + printf ("Error , error this data is for %u GMP_LIMB_BITS only\n", limb); printf ("#endif\n"); #endif @@ -101,7 +101,7 @@ gen_consts (int numb, int nail, int limb) ofl = b - 1; printf ("#define ODD_FACTORIAL_TABLE_LIMIT (%lu)\n", ofl); - mpz_init2 (mask, numb + 1); + mpz_init (mask); mpz_setbit (mask, numb); mpz_sub_ui (mask, mask, 1); printf @@ -280,6 +280,6 @@ main (int argc, char *argv[]) nail_bits); exit (1); } - gen_consts (numb_bits, nail_bits, limb_bits); + gen_consts (numb_bits, limb_bits); return 0; } |