X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/462fca95471224f85b85be911e72faee16cd1597..0b69138af654e9c0bb6148ef203fc7016ab555f4:/primes/pattern.c diff --git a/primes/pattern.c b/primes/pattern.c index 50e21ab5..52784a5a 100644 --- a/primes/pattern.c +++ b/primes/pattern.c @@ -1,6 +1,8 @@ +/* $NetBSD: pattern.c,v 1.7 2014/10/02 21:36:37 ast Exp $ */ + /* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Landon Curt Noll. @@ -13,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -34,24 +32,27 @@ * SUCH DAMAGE. */ +#include + #ifndef lint -/*static char sccsid[] = "from: @(#)pattern.c 5.2 (Berkeley) 6/1/90";*/ -static char rcsid[] = "$Id: pattern.c,v 1.2 1993/08/01 18:53:08 mycroft Exp $"; +#if 0 +static char sccsid[] = "@(#)pattern.c 8.1 (Berkeley) 5/31/93"; +#else +__RCSID("$NetBSD: pattern.c,v 1.7 2014/10/02 21:36:37 ast Exp $"); +#endif #endif /* not lint */ /* * pattern - the Eratosthenes sieve on odd numbers for 3,5,7,11 and 13 * - * By: Landon Curt Noll chongo@toad.com - * - * chongo /\oo/\ + * By Landon Curt Noll, http://www.isthe.com/chongo/index.html /\oo/\ * * To avoid excessive sieves for small factors, we use the table below to * setup our sieve blocks. Each element represents a odd number starting * with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13. */ -char pattern[] = { +const char pattern[] = { 1,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,0,1,1,0,0,1,0,1,1,0,0, 1,0,1,0,0,1,0,0,0,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,0,1,1,0,0, 1,0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,0,1, @@ -438,4 +439,4 @@ char pattern[] = { 0,0,1,1,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0,0,0,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1, 0,0,1,1,0,1,0,0,1,1,0,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,0,1 }; -int pattern_size = (sizeof(pattern)/sizeof(pattern[0])); +const size_t pattern_size = (sizeof(pattern)/sizeof(pattern[0]));