X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/7a7d157b6dfb2274277e61ea5f1c8a97e88e73ba..2ecbb982b34047188a30b350ca10c8846fc85c3e:/adventure/crc.c diff --git a/adventure/crc.c b/adventure/crc.c index 768882d9..d13bdd42 100644 --- a/adventure/crc.c +++ b/adventure/crc.c @@ -1,4 +1,4 @@ -/* $NetBSD: crc.c,v 1.5 1997/10/11 01:53:21 lukem Exp $ */ +/* $NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */ /*- * Copyright (c) 1993 @@ -15,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. * @@ -42,13 +38,13 @@ static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 5/31/93"; static char ORIGINAL_sccsid[] = "@(#)crc.c 5.2 (Berkeley) 4/4/91"; #else -__RCSID("$NetBSD: crc.c,v 1.5 1997/10/11 01:53:21 lukem Exp $"); +__RCSID("$NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $"); #endif #endif /* not lint */ #include "extern.h" -unsigned long crctab[] = { +const unsigned long crctab[] = { 0x7fffffff, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, @@ -111,7 +107,7 @@ unsigned long crctab[] = { */ unsigned long crcval; -int step; +unsigned int step; void crc_start() @@ -119,13 +115,12 @@ crc_start() crcval = step = 0; } +/* Process nr bytes at a time; ptr points to them */ unsigned long -crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */ - char *ptr; - int nr; +crc(const char *ptr, int nr) { int i; - char *p; + const char *p; while (nr > 0) for (p = ptr; nr--; ++p) {