diff options
author | hubertf <hubertf@NetBSD.org> | 1999-07-28 02:12:33 +0000 |
---|---|---|
committer | hubertf <hubertf@NetBSD.org> | 1999-07-28 02:12:33 +0000 |
commit | 64a9fe90774294d537557da69be1f73ad32090d5 (patch) | |
tree | 8bb941afa3e9f5f31c9372195ab8470df38b0e19 /bcd | |
parent | 1430fa634c93a746fc61f514f1f986bb312c54c0 (diff) | |
download | bsdgames-darwin-64a9fe90774294d537557da69be1f73ad32090d5.tar.gz bsdgames-darwin-64a9fe90774294d537557da69be1f73ad32090d5.tar.zst bsdgames-darwin-64a9fe90774294d537557da69be1f73ad32090d5.zip |
This patch makes bcd(6) use `const' where appropriate, and use
unsigned char rather than char for values that end up passed to
isascii() and also used as array indices.
Patch submitted by Joseph Myers <jsm28@cam.ac.uk> in PR 8093.
Diffstat (limited to 'bcd')
-rw-r--r-- | bcd/bcd.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: bcd.c,v 1.8 1999/07/21 03:59:41 hubertf Exp $ */ +/* $NetBSD: bcd.c,v 1.9 1999/07/28 02:12:33 hubertf Exp $ */ /* * Copyright (c) 1989, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)bcd.c 8.2 (Berkeley) 3/20/94"; #else -__RCSID("$NetBSD: bcd.c,v 1.8 1999/07/21 03:59:41 hubertf Exp $"); +__RCSID("$NetBSD: bcd.c,v 1.9 1999/07/28 02:12:33 hubertf Exp $"); #endif #endif /* not lint */ @@ -87,7 +87,7 @@ __RCSID("$NetBSD: bcd.c,v 1.8 1999/07/21 03:59:41 hubertf Exp $"); #include <ctype.h> #include <unistd.h> -u_short holes[256] = { +const u_short holes[256] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, @@ -160,9 +160,9 @@ void printcard(str) char *str; { - static char rowchars[] = " 123456789"; + static const char rowchars[] = " 123456789"; int i, row; - char *p; + unsigned char *p; /* ruthlessly remove newlines and truncate at 48 characters. */ if ((p = strchr(str, '\n'))) |