summaryrefslogtreecommitdiffstats
path: root/bcd/bcd.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-10 09:54:16 +0000
committerlukem <lukem@NetBSD.org>1997-10-10 09:54:16 +0000
commit7016350ffcce57245468046bd3e36559e2684dca (patch)
tree5d7edd251a7e8f16c94194895408e33173d1613f /bcd/bcd.c
parent244d471f6ba4df112e98e6bfb1c58e8f51969bef (diff)
downloadbsdgames-darwin-7016350ffcce57245468046bd3e36559e2684dca.tar.gz
bsdgames-darwin-7016350ffcce57245468046bd3e36559e2684dca.tar.zst
bsdgames-darwin-7016350ffcce57245468046bd3e36559e2684dca.zip
WARNSify, fixup .Nm usage
Diffstat (limited to 'bcd/bcd.c')
-rw-r--r--bcd/bcd.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/bcd/bcd.c b/bcd/bcd.c
index 69ee9a13..f0d90f04 100644
--- a/bcd/bcd.c
+++ b/bcd/bcd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bcd.c,v 1.6 1995/04/24 12:22:23 cgd Exp $ */
+/* $NetBSD: bcd.c,v 1.7 1997/10/10 09:54:18 lukem Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -36,14 +36,18 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char copyright[] =
-"@(#) Copyright (c) 1989, 1993\n\
- The Regents of the University of California. All rights reserved.\n";
+__COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)bcd.c 8.2 (Berkeley) 3/20/94";
+#else
+__RCSID("$NetBSD: bcd.c,v 1.7 1997/10/10 09:54:18 lukem Exp $");
+#endif
#endif /* not lint */
/*
@@ -122,6 +126,9 @@ u_short holes[256] = {
*/
#define bit(w,i) ((w)&(1<<(i)))
+int main __P((int, char *[]));
+void printcard __P((char *));
+
int
main(argc, argv)
int argc;
@@ -145,16 +152,16 @@ main(argc, argv)
#define COLUMNS 48
+void
printcard(str)
- register char *str;
+ char *str;
{
static char rowchars[] = " 123456789";
- register int i, row;
- register char *p;
- char *index();
+ int i, row;
+ char *p;
/* ruthlessly remove newlines and truncate at 48 characters. */
- if ((p = index(str, '\n')))
+ if ((p = strchr(str, '\n')))
*p = '\0';
if (strlen(str) > COLUMNS)
@@ -178,7 +185,7 @@ printcard(str)
p = str;
putchar('/');
for (i = 1; *p; i++, p++)
- if (holes[*p])
+ if (holes[(int)*p])
putchar(*p);
else
putchar(' ');
@@ -196,7 +203,7 @@ printcard(str)
for (row = 0; row <= 11; ++row) {
putchar('|');
for (i = 0, p = str; *p; i++, p++) {
- if (bit(holes[*p], 11 - row))
+ if (bit(holes[(int)*p], 11 - row))
putchar(']');
else
putchar(rowchars[row]);