]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - primes/pattern.c
don't use char values for functions that can return -1; chars are not always
[bsdgames-darwin.git] / primes / pattern.c
index c770791ced8cf8cc69fa123ed3d235db66328aed..11960567d1b22117ceccd620543b6535af5cf06e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: pattern.c,v 1.3 1995/03/23 08:35:47 cgd Exp $  */
+/*     $NetBSD: pattern.c,v 1.6 2003/08/07 09:37:33 agc Exp $  */
 
 /*
  * Copyright (c) 1989, 1993
  * 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.
  *
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)pattern.c  8.1 (Berkeley) 5/31/93";
 #else
-static char rcsid[] = "$NetBSD: pattern.c,v 1.3 1995/03/23 08:35:47 cgd Exp $";
+__RCSID("$NetBSD: pattern.c,v 1.6 2003/08/07 09:37:33 agc Exp $");
 #endif
 #endif /* not lint */
 
@@ -56,7 +53,7 @@ static char rcsid[] = "$NetBSD: pattern.c,v 1.3 1995/03/23 08:35:47 cgd Exp $";
  * 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,
@@ -443,4 +440,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 int pattern_size = (sizeof(pattern)/sizeof(pattern[0]));