Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/bcd This patch makes bcd(6) use `const' where appropri...



details:   https://anonhg.NetBSD.org/src/rev/6f5758542053
branches:  trunk
changeset: 474972:6f5758542053
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Wed Jul 28 02:12:33 1999 +0000

description:
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@localhost> in PR 8093.

diffstat:

 games/bcd/bcd.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r dcb01faf5cf1 -r 6f5758542053 games/bcd/bcd.c
--- a/games/bcd/bcd.c   Wed Jul 28 02:07:39 1999 +0000
+++ b/games/bcd/bcd.c   Wed Jul 28 02:12:33 1999 +0000
@@ -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 @@
 #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 @@
 #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 @@
 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')))



Home | Main Index | Thread Index | Old Index