From 7016350ffcce57245468046bd3e36559e2684dca Mon Sep 17 00:00:00 2001 From: lukem Date: Fri, 10 Oct 1997 09:54:16 +0000 Subject: WARNSify, fixup .Nm usage --- bcd/bcd.6 | 8 +++----- bcd/bcd.c | 29 ++++++++++++++++++----------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/bcd/bcd.6 b/bcd/bcd.6 index 57efb7a5..4e092152 100644 --- a/bcd/bcd.6 +++ b/bcd/bcd.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: bcd.6,v 1.6 1995/03/21 15:08:14 cgd Exp $ +.\" $NetBSD: bcd.6,v 1.7 1997/10/10 09:54:16 lukem Exp $ .\" .\" Copyright (c) 1988, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -42,7 +42,7 @@ .Nm morse .Nd "reformat input as punch cards, paper tape or morse code" .Sh SYNOPSIS -.Nm bcd +.Nm .Op Ar string ... .Nm ppt .Op Ar string ... @@ -50,7 +50,7 @@ .Op Fl s Ar string ... .Sh DESCRIPTION The -.Nm bcd , +.Nm "" , .Nm ppt and .Nm morse @@ -65,5 +65,3 @@ The .Fl s option for morse produces dots and dashes rather than words. .El -.Sh FILES -.SH HISTORY 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 #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]); -- cgit v1.2.3-56-ge451