From c352f3e872a5c707bab0c5de75c1a6e5c4ca9cbb Mon Sep 17 00:00:00 2001 From: hubertf Date: Sun, 13 Sep 1998 00:07:24 +0000 Subject: constify, per PR 6041 by Joseph Myers --- adventure/crc.c | 8 ++++---- adventure/extern.h | 12 ++++++------ adventure/io.c | 10 +++++----- adventure/save.c | 8 ++++---- adventure/vocab.c | 9 +++++---- 5 files changed, 24 insertions(+), 23 deletions(-) (limited to 'adventure') diff --git a/adventure/crc.c b/adventure/crc.c index 768882d9..b80b1263 100644 --- a/adventure/crc.c +++ b/adventure/crc.c @@ -1,4 +1,4 @@ -/* $NetBSD: crc.c,v 1.5 1997/10/11 01:53:21 lukem Exp $ */ +/* $NetBSD: crc.c,v 1.6 1998/09/13 00:07:24 hubertf Exp $ */ /*- * Copyright (c) 1993 @@ -42,7 +42,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.5 1997/10/11 01:53:21 lukem Exp $"); +__RCSID("$NetBSD: crc.c,v 1.6 1998/09/13 00:07:24 hubertf Exp $"); #endif #endif /* not lint */ @@ -121,11 +121,11 @@ crc_start() unsigned long crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */ - char *ptr; + const char *ptr; int nr; { int i; - char *p; + const char *p; while (nr > 0) for (p = ptr; nr--; ++p) { diff --git a/adventure/extern.h b/adventure/extern.h index eeffd936..c1e6bf02 100644 --- a/adventure/extern.h +++ b/adventure/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.7 1998/09/11 12:46:26 hubertf Exp $ */ +/* $NetBSD: extern.h,v 1.8 1998/09/13 00:07:24 hubertf Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -33,7 +33,7 @@ /* crc.c */ void crc_start __P((void)); -unsigned long crc __P((char *, int)); +unsigned long crc __P((const char *, int)); /* done.c */ int score __P((void)); @@ -67,12 +67,12 @@ void rhints __P((void)); void rspeak __P((int)); void mspeak __P((int)); struct text; -void speak __P((struct text *)); +void speak __P((const struct text *)); void pspeak __P((int, int)); /* save.c */ -int save __P((char *)); -int restore __P((char *)); +int save __P((const char *)); +int restore __P((const char *)); /* subr.c */ int toting __P((int)); @@ -112,7 +112,7 @@ void move __P((int, int)); int put __P((int, int, int)); void carry __P((int, int)); void drop __P((int, int)); -int vocab __P((char *, int, int)); +int vocab __P((const char *, int, int)); /* These three used to be functions in vocab.c */ #define copystr(src, dest) strcpy((dest), (src)) diff --git a/adventure/io.c b/adventure/io.c index 2e53cc56..3158991d 100644 --- a/adventure/io.c +++ b/adventure/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.7 1998/08/29 22:40:07 hubertf Exp $ */ +/* $NetBSD: io.c,v 1.8 1998/09/13 00:07:24 hubertf Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: io.c,v 1.7 1998/08/29 22:40:07 hubertf Exp $"); +__RCSID("$NetBSD: io.c,v 1.8 1998/09/13 00:07:24 hubertf Exp $"); #endif #endif /* not lint */ @@ -155,8 +155,8 @@ char *inptr; /* Pointer into virtual disk */ int outsw = 0; /* putting stuff to data file? */ -char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l"; -char *tape = iotape; /* pointer to encryption tape */ +const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l"; +const char *tape = iotape; /* pointer to encryption tape */ int next() @@ -508,7 +508,7 @@ mspeak(msg) void speak(msg) /* read, decrypt, and print a message (not * ptext) */ - struct text *msg; /* msg is a pointer to seek address and length + const struct text *msg; /* msg is a pointer to seek address and length * of mess */ { char *s, nonfirst; diff --git a/adventure/save.c b/adventure/save.c index 8eed7e14..c2dc9215 100644 --- a/adventure/save.c +++ b/adventure/save.c @@ -1,4 +1,4 @@ -/* $NetBSD: save.c,v 1.4 1997/10/11 01:53:33 lukem Exp $ */ +/* $NetBSD: save.c,v 1.5 1998/09/13 00:07:24 hubertf Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: save.c,v 1.4 1997/10/11 01:53:33 lukem Exp $"); +__RCSID("$NetBSD: save.c,v 1.5 1998/09/13 00:07:24 hubertf Exp $"); #endif #endif /* not lint */ @@ -126,7 +126,7 @@ struct savestruct save_array[] = int save(outfile) /* Two passes on data: first to get checksum, * second */ - char *outfile; /* to output the data using checksum to start + const char *outfile; /* to output the data using checksum to start * random #s */ { FILE *out; @@ -158,7 +158,7 @@ save(outfile) /* Two passes on data: first to get checksum, int restore(infile) - char *infile; + const char *infile; { FILE *in; struct savestruct *p; diff --git a/adventure/vocab.c b/adventure/vocab.c index 8b12e51b..d97be635 100644 --- a/adventure/vocab.c +++ b/adventure/vocab.c @@ -1,4 +1,4 @@ -/* $NetBSD: vocab.c,v 1.6 1998/08/24 22:26:23 hubertf Exp $ */ +/* $NetBSD: vocab.c,v 1.7 1998/09/13 00:07:24 hubertf Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)vocab.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: vocab.c,v 1.6 1998/08/24 22:26:23 hubertf Exp $"); +__RCSID("$NetBSD: vocab.c,v 1.7 1998/09/13 00:07:24 hubertf Exp $"); #endif #endif /* not lint */ @@ -137,13 +137,14 @@ drop(object, where) int vocab(word, type, value) /* look up or store a word */ - char *word; + const char *word; int type; /* -2 for store, -1 for user word, >=0 for * canned lookup */ int value; /* used for storing only */ { int adr; - char *s, *t; + const char *s; + char *t; int hash, i; struct hashtab *h; -- cgit v1.2.3-56-ge451