diff options
author | dholland <dholland@NetBSD.org> | 2009-08-25 06:04:17 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2009-08-25 06:04:17 +0000 |
commit | 90f6a570a99c8ececaa0448d7112b09eaab1605b (patch) | |
tree | d0c2cf29a462ea119a462529ffbbf8e4e0f645b4 /adventure | |
parent | df2ff83b8d06bdf49e72c595985c77d5b4ae7582 (diff) | |
download | bsdgames-darwin-90f6a570a99c8ececaa0448d7112b09eaab1605b.tar.gz bsdgames-darwin-90f6a570a99c8ececaa0448d7112b09eaab1605b.tar.zst bsdgames-darwin-90f6a570a99c8ececaa0448d7112b09eaab1605b.zip |
ANSIfy a leftover function.
Also note some unportable code with a comment. Can't change it because
it'd break save files, though.
Diffstat (limited to 'adventure')
-rw-r--r-- | adventure/crc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/adventure/crc.c b/adventure/crc.c index c43297a1..d429e912 100644 --- a/adventure/crc.c +++ b/adventure/crc.c @@ -1,4 +1,4 @@ -/* $NetBSD: crc.c,v 1.10 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: crc.c,v 1.11 2009/08/25 06:04:17 dholland Exp $ */ /*- * Copyright (c) 1993 @@ -38,7 +38,7 @@ 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.10 2009/08/12 04:28:27 dholland Exp $"); +__RCSID("$NetBSD: crc.c,v 1.11 2009/08/25 06:04:17 dholland Exp $"); #endif #endif /* not lint */ @@ -110,7 +110,7 @@ static unsigned long crcval; static unsigned int step; void -crc_start() +crc_start(void) { crcval = step = 0; } @@ -124,6 +124,12 @@ crc(const char *ptr, int nr) while (nr > 0) for (p = ptr; nr--; ++p) { + /* + * The following is not portable to machines + * where char is unsigned, because of sign + * extension. But it can't be changed without + * breaking save files. Sigh. + */ if (!(i = crcval >> 24 ^ *p)) { i = step++; if (step >= sizeof(crctab) / sizeof(crctab[0])) |