Skip to content

Commit 4e1357c

Browse files
hubertfhubertf
hubertf
authored and
hubertf
committed
constify, per PR 6041 by Joseph Myers <jsm28@cam.ac.uk>
1 parent 6d6da27 commit 4e1357c

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

games/adventure/crc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: crc.c,v 1.5 1997/10/11 01:53:21 lukem Exp $ */
1+
/* $NetBSD: crc.c,v 1.6 1998/09/13 00:07:24 hubertf Exp $ */
22

33
/*-
44
* Copyright (c) 1993
@@ -42,7 +42,7 @@
4242
static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 5/31/93";
4343
static char ORIGINAL_sccsid[] = "@(#)crc.c 5.2 (Berkeley) 4/4/91";
4444
#else
45-
__RCSID("$NetBSD: crc.c,v 1.5 1997/10/11 01:53:21 lukem Exp $");
45+
__RCSID("$NetBSD: crc.c,v 1.6 1998/09/13 00:07:24 hubertf Exp $");
4646
#endif
4747
#endif /* not lint */
4848

@@ -121,11 +121,11 @@ crc_start()
121121

122122
unsigned long
123123
crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
124-
char *ptr;
124+
const char *ptr;
125125
int nr;
126126
{
127127
int i;
128-
char *p;
128+
const char *p;
129129

130130
while (nr > 0)
131131
for (p = ptr; nr--; ++p) {

games/adventure/extern.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: extern.h,v 1.7 1998/09/11 12:46:26 hubertf Exp $ */
1+
/* $NetBSD: extern.h,v 1.8 1998/09/13 00:07:24 hubertf Exp $ */
22

33
/*
44
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -33,7 +33,7 @@
3333

3434
/* crc.c */
3535
void crc_start __P((void));
36-
unsigned long crc __P((char *, int));
36+
unsigned long crc __P((const char *, int));
3737

3838
/* done.c */
3939
int score __P((void));
@@ -67,12 +67,12 @@ void rhints __P((void));
6767
void rspeak __P((int));
6868
void mspeak __P((int));
6969
struct text;
70-
void speak __P((struct text *));
70+
void speak __P((const struct text *));
7171
void pspeak __P((int, int));
7272

7373
/* save.c */
74-
int save __P((char *));
75-
int restore __P((char *));
74+
int save __P((const char *));
75+
int restore __P((const char *));
7676

7777
/* subr.c */
7878
int toting __P((int));
@@ -112,7 +112,7 @@ void move __P((int, int));
112112
int put __P((int, int, int));
113113
void carry __P((int, int));
114114
void drop __P((int, int));
115-
int vocab __P((char *, int, int));
115+
int vocab __P((const char *, int, int));
116116

117117
/* These three used to be functions in vocab.c */
118118
#define copystr(src, dest) strcpy((dest), (src))

games/adventure/io.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: io.c,v 1.7 1998/08/29 22:40:07 hubertf Exp $ */
1+
/* $NetBSD: io.c,v 1.8 1998/09/13 00:07:24 hubertf Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
4343
#if 0
4444
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
4545
#else
46-
__RCSID("$NetBSD: io.c,v 1.7 1998/08/29 22:40:07 hubertf Exp $");
46+
__RCSID("$NetBSD: io.c,v 1.8 1998/09/13 00:07:24 hubertf Exp $");
4747
#endif
4848
#endif /* not lint */
4949

@@ -155,8 +155,8 @@ char *inptr; /* Pointer into virtual disk */
155155

156156
int outsw = 0; /* putting stuff to data file? */
157157

158-
char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l";
159-
char *tape = iotape; /* pointer to encryption tape */
158+
const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l";
159+
const char *tape = iotape; /* pointer to encryption tape */
160160

161161
int
162162
next()
@@ -508,7 +508,7 @@ mspeak(msg)
508508
void
509509
speak(msg) /* read, decrypt, and print a message (not
510510
* ptext) */
511-
struct text *msg; /* msg is a pointer to seek address and length
511+
const struct text *msg; /* msg is a pointer to seek address and length
512512
* of mess */
513513
{
514514
char *s, nonfirst;

games/adventure/save.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: save.c,v 1.4 1997/10/11 01:53:33 lukem Exp $ */
1+
/* $NetBSD: save.c,v 1.5 1998/09/13 00:07:24 hubertf Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
4343
#if 0
4444
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
4545
#else
46-
__RCSID("$NetBSD: save.c,v 1.4 1997/10/11 01:53:33 lukem Exp $");
46+
__RCSID("$NetBSD: save.c,v 1.5 1998/09/13 00:07:24 hubertf Exp $");
4747
#endif
4848
#endif /* not lint */
4949

@@ -126,7 +126,7 @@ struct savestruct save_array[] =
126126
int
127127
save(outfile) /* Two passes on data: first to get checksum,
128128
* second */
129-
char *outfile; /* to output the data using checksum to start
129+
const char *outfile; /* to output the data using checksum to start
130130
* random #s */
131131
{
132132
FILE *out;
@@ -158,7 +158,7 @@ save(outfile) /* Two passes on data: first to get checksum,
158158

159159
int
160160
restore(infile)
161-
char *infile;
161+
const char *infile;
162162
{
163163
FILE *in;
164164
struct savestruct *p;

games/adventure/vocab.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: vocab.c,v 1.6 1998/08/24 22:26:23 hubertf Exp $ */
1+
/* $NetBSD: vocab.c,v 1.7 1998/09/13 00:07:24 hubertf Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
4343
#if 0
4444
static char sccsid[] = "@(#)vocab.c 8.1 (Berkeley) 5/31/93";
4545
#else
46-
__RCSID("$NetBSD: vocab.c,v 1.6 1998/08/24 22:26:23 hubertf Exp $");
46+
__RCSID("$NetBSD: vocab.c,v 1.7 1998/09/13 00:07:24 hubertf Exp $");
4747
#endif
4848
#endif /* not lint */
4949

@@ -137,13 +137,14 @@ drop(object, where)
137137

138138
int
139139
vocab(word, type, value) /* look up or store a word */
140-
char *word;
140+
const char *word;
141141
int type; /* -2 for store, -1 for user word, >=0 for
142142
* canned lookup */
143143
int value; /* used for storing only */
144144
{
145145
int adr;
146-
char *s, *t;
146+
const char *s;
147+
char *t;
147148
int hash, i;
148149
struct hashtab *h;
149150

0 commit comments

Comments
 (0)