summaryrefslogtreecommitdiff
path: root/test/c/nsievebits.c
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2006-09-17 15:51:40 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2006-09-17 15:51:40 +0000
commit4559f4d7bef85915f5cb7f11b4156dacf120a52e (patch)
tree081ce1169744115dfb25d9197c54018f9c777469 /test/c/nsievebits.c
parent6f80e78eb73b7427d86a60859ace39781d6b115c (diff)
Nettoyages
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@108 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/c/nsievebits.c')
-rw-r--r--test/c/nsievebits.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/c/nsievebits.c b/test/c/nsievebits.c
index ad96011..9ce6aaa 100644
--- a/test/c/nsievebits.c
+++ b/test/c/nsievebits.c
@@ -13,10 +13,10 @@
typedef unsigned int bits;
#define NBITS (8 * sizeof(bits))
-static unsigned long
-nsieve(unsigned long m)
+static unsigned int
+nsieve(unsigned int m)
{
- unsigned long count, i, j;
+ unsigned int count, i, j;
bits * a;
a = malloc((m / NBITS) * sizeof(bits));
memset(a, (1 << 8) - 1, (m / NBITS) * sizeof(bits));
@@ -31,22 +31,21 @@ nsieve(unsigned long m)
}
static void
-test(unsigned long n)
+test(unsigned int n)
{
- unsigned long count, m;
+ unsigned int count, m;
m = (1 << n) * 10000;
count = nsieve(m);
- printf("Primes up to %8ju %8ju\n", m, count);
+ printf("Primes up to %8u %8u\n", m, count);
}
int
main(int ac, char **av)
{
- unsigned long n;
- char *cp;
+ unsigned int n;
- n = ac < 2 ? 9 : strtoul(av[1], &cp, 10);
+ n = ac < 2 ? 9 : atoi(av[1]);
test(n);
if (n >= 1)
test(n - 1);