summaryrefslogtreecommitdiff
path: root/gen-trialdivtab.c
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gmplib.org>2013-03-21 23:03:07 +0100
committerTorbjorn Granlund <tege@gmplib.org>2013-03-21 23:03:07 +0100
commit572bc93638aa09e48685b87b0bd20e5a58f84ca1 (patch)
treedbaab3b37b57e6b36a87efe7f3f9c2629de8bece /gen-trialdivtab.c
parent0374a3ae8b02f0710c74e056e145cbffe4b77dad (diff)
downloadgmp-572bc93638aa09e48685b87b0bd20e5a58f84ca1.tar.gz
Move veriables out from generated file, make them 'const'.
Diffstat (limited to 'gen-trialdivtab.c')
-rw-r--r--gen-trialdivtab.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gen-trialdivtab.c b/gen-trialdivtab.c
index d87265ec4..ccb4ce44e 100644
--- a/gen-trialdivtab.c
+++ b/gen-trialdivtab.c
@@ -2,7 +2,7 @@
Contributed to the GNU project by Torbjorn Granlund.
-Copyright 2009, 2012 Free Software Foundation, Inc.
+Copyright 2009, 2012, 2013 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -98,7 +98,9 @@ main (int argc, char *argv[])
omitted_p = 3;
interval_end = 0;
- printf ("static struct gmp_primes_dtab gmp_primes_dtab[] = {\n");
+/* printf ("static struct gmp_primes_dtab gmp_primes_dtab[] = {\n"); */
+
+ printf ("#ifdef WANT_dtab\n");
for (t = start_p; t <= end_p; t += 2)
{
@@ -120,7 +122,7 @@ main (int argc, char *argv[])
if (! isprime (p))
continue;
- printf (" P(%d,", (int) p);
+ printf (" P(%d,", (int) p);
mpz_invert_ui_2exp (inv, p, limb_bits);
printf ("CNST_LIMB(0x"); mpz_out_str (stdout, 16, inv); printf ("),");
@@ -138,10 +140,12 @@ main (int argc, char *argv[])
}
interval_end = t;
}
- printf (" P(0,0,0)\n};\n");
+ printf ("#define SMALLEST_OMITTED_PRIME %d\n", (int) omitted_p);
+ printf ("#endif\n");
+ printf ("#ifdef WANT_ptab\n");
- printf ("static struct gmp_primes_ptab gmp_primes_ptab[] = {\n");
+/* printf ("static struct gmp_primes_ptab gmp_primes_ptab[] = {\n"); */
endtok = "";
@@ -193,9 +197,9 @@ main (int argc, char *argv[])
interval_end = t;
np++;
}
- printf ("\n};\n");
- printf ("#define SMALLEST_OMITTED_PRIME %d\n", (int) omitted_p);
+ printf ("\n");
+ printf ("#endif\n");
return 0;
}