-/* $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
* 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.
*
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,
*/
unsigned long crcval;
-int step;
+unsigned int step;
void
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) {