summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boggle/boggle/bog.c30
-rw-r--r--boggle/boggle/extern.h26
-rw-r--r--boggle/boggle/mach.c29
-rw-r--r--boggle/boggle/prtable.c16
-rw-r--r--boggle/boggle/word.c8
-rw-r--r--caesar/caesar.c8
-rw-r--r--canfield/canfield/canfield.c46
-rw-r--r--canfield/cfscores/cfscores.c8
-rw-r--r--cribbage/cards.c7
-rw-r--r--cribbage/crib.c6
-rw-r--r--cribbage/cribbage.h36
-rw-r--r--cribbage/io.c24
-rw-r--r--cribbage/score.c24
-rw-r--r--cribbage/support.c24
-rw-r--r--factor/factor.c10
-rw-r--r--fish/fish.c24
-rw-r--r--fortune/fortune/fortune.c64
-rw-r--r--fortune/strfile/strfile.c10
-rw-r--r--gomoku/bdisp.c12
-rw-r--r--gomoku/gomoku.h24
-rw-r--r--gomoku/main.c16
-rw-r--r--gomoku/makemove.c8
-rw-r--r--gomoku/pickmove.c8
-rw-r--r--gomoku/stoc.c14
-rw-r--r--hangman/extern.c9
-rw-r--r--hangman/hangman.h7
-rw-r--r--hangman/setup.c6
-rw-r--r--mille/comp.c8
-rw-r--r--mille/extern.c28
-rw-r--r--mille/mille.h24
-rw-r--r--mille/move.c8
-rw-r--r--mille/print.c6
-rw-r--r--mille/save.c6
-rw-r--r--monop/cards.c8
-rw-r--r--monop/execute.c6
-rw-r--r--monop/getinp.c13
-rw-r--r--monop/houses.c8
-rw-r--r--monop/initdeck.c8
-rw-r--r--monop/misc.c8
-rw-r--r--monop/monop.def12
-rw-r--r--monop/monop.ext6
-rw-r--r--monop/monop.h18
-rw-r--r--monop/morg.c8
-rw-r--r--monop/print.c10
-rw-r--r--monop/spec.c6
-rw-r--r--monop/trade.c6
-rw-r--r--morse/morse.c16
-rw-r--r--number/number.c21
-rw-r--r--phantasia/gamesupport.c4
-rw-r--r--phantasia/interplayer.c4
-rw-r--r--phantasia/io.c4
-rw-r--r--phantasia/main.c4
-rw-r--r--phantasia/misc.c26
-rw-r--r--phantasia/phantglobs.c22
-rw-r--r--phantasia/phantglobs.h36
-rw-r--r--phantasia/phantstruct.h4
-rw-r--r--phantasia/setup.c10
-rw-r--r--primes/pattern.c8
-rw-r--r--primes/pr_tbl.c8
-rw-r--r--primes/primes.c14
-rw-r--r--quiz/quiz.c30
-rw-r--r--quiz/quiz.h6
-rw-r--r--quiz/rxp.c22
-rw-r--r--robots/auto.c16
-rw-r--r--robots/extern.c8
-rw-r--r--robots/init_field.c6
-rw-r--r--robots/main.c8
-rw-r--r--robots/move.c6
-rw-r--r--robots/query.c6
-rw-r--r--robots/robots.h10
-rw-r--r--robots/score.c11
-rw-r--r--sail/assorted.c8
-rw-r--r--sail/dr_1.c16
-rw-r--r--sail/dr_2.c12
-rw-r--r--sail/driver.h4
-rw-r--r--sail/extern.h48
-rw-r--r--sail/globals.c36
-rw-r--r--sail/lo_main.c6
-rw-r--r--sail/pl_3.c6
-rw-r--r--sail/pl_4.c6
-rw-r--r--sail/pl_7.c24
-rw-r--r--snake/snake/move.c16
-rw-r--r--snake/snake/snake.c18
-rw-r--r--snake/snake/snake.h20
-rw-r--r--snake/snscore/snscore.c6
-rw-r--r--tetris/scores.c4
-rw-r--r--tetris/screen.c6
-rw-r--r--tetris/shapes.c8
-rw-r--r--tetris/tetris.c6
-rw-r--r--tetris/tetris.h14
-rw-r--r--trek/getpar.h6
-rw-r--r--worm/worm.c8
92 files changed, 653 insertions, 636 deletions
diff --git a/boggle/boggle/bog.c b/boggle/boggle/bog.c
index 4e6c4c79..6c3b92e2 100644
--- a/boggle/boggle/bog.c
+++ b/boggle/boggle/bog.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bog.c,v 1.11 1999/07/21 04:02:29 hubertf Exp $ */
+/* $NetBSD: bog.c,v 1.12 1999/09/08 21:17:44 jsm Exp $ */
/*-
* Copyright (c) 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\
#if 0
static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: bog.c,v 1.11 1999/07/21 04:02:29 hubertf Exp $");
+__RCSID("$NetBSD: bog.c,v 1.12 1999/09/08 21:17:44 jsm Exp $");
#endif
#endif /* not lint */
@@ -101,10 +101,12 @@ int wordpath[MAXWORDLEN + 1];
int wordlen; /* Length of last word returned by nextword() */
int usedbits;
-char *pword[MAXPWORDS], pwords[MAXPSPACE], *pwordsp;
+const char *pword[MAXPWORDS];
+char pwords[MAXPSPACE], *pwordsp;
int npwords;
-char *mword[MAXMWORDS], mwords[MAXMSPACE], *mwordsp;
+const char *mword[MAXMWORDS];
+char mwords[MAXMSPACE], *mwordsp;
int nmwords;
int ngames = 0;
@@ -415,10 +417,11 @@ timesup: ;
*/
int
checkword(word, prev, path)
- char *word;
+ const char *word;
int prev, *path;
{
- char *p, *q;
+ const char *p;
+ char *q;
int i, *lm;
if (debug) {
@@ -498,10 +501,10 @@ checkword(word, prev, path)
*/
int
validword(word)
- char *word;
+ const char *word;
{
int j;
- char *q, *w;
+ const char *q, *w;
j = word[0] - 'a';
if (dictseek(dictfp, dictindex[j].start, SEEK_SET) < 0) {
@@ -534,7 +537,8 @@ validword(word)
void
checkdict()
{
- char *p, **pw, *w;
+ char *p, *w;
+ const char **pw;
int i;
int prevch, previndex, *pi, *qi, st;
@@ -612,12 +616,12 @@ checkdict()
*/
void
newgame(b)
- char *b;
+ const char *b;
{
int i, p, q;
- char *tmp;
+ const char *tmp;
int *lm[26];
- static char *cubes[16] = {
+ static const char *cubes[16] = {
"ednosw", "aaciot", "acelrs", "ehinps",
"eefhiy", "elpstu", "acdemp", "gilruw",
"egkluy", "ahmors", "abilty", "adenvz",
@@ -684,7 +688,7 @@ int
compar(p, q)
const void *p, *q;
{
- return (strcmp(*(char **)p, *(char **)q));
+ return (strcmp(*(const char *const *)p, *(const char *const *)q));
}
void
diff --git a/boggle/boggle/extern.h b/boggle/boggle/extern.h
index ea27172c..7e9d942a 100644
--- a/boggle/boggle/extern.h
+++ b/boggle/boggle/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.4 1998/09/13 15:27:26 hubertf Exp $ */
+/* $NetBSD: extern.h,v 1.5 1999/09/08 21:17:44 jsm Exp $ */
/*-
* Copyright (c) 1993
@@ -35,11 +35,11 @@
* @(#)extern.h 8.1 (Berkeley) 6/11/93
*/
-void addword __P((char *));
+void addword __P((const char *));
void badword __P((void));
char *batchword __P((FILE *));
void checkdict __P((void));
-int checkword __P((char *, int, int *));
+int checkword __P((const char *, int, int *));
void cleanup __P((void));
void delay __P((int));
long dictseek __P((FILE *, long, int));
@@ -50,24 +50,24 @@ void getword __P((char *));
int help __P((void));
int inputch __P((void));
int loaddict __P((FILE *));
-int loadindex __P((char *));
-void newgame __P((char *));
+int loadindex __P((const char *));
+void newgame __P((const char *));
char *nextword __P((FILE *));
-FILE *opendict __P((char *));
+FILE *opendict __P((const char *));
void playgame __P((void));
-void prompt __P((char *));
-void prtable __P((char *[],
- int, int, int, void (*)(char *[], int), int (*)(char *[], int)));
-void putstr __P((char *));
+void prompt __P((const char *));
+void prtable __P((const char *const [],
+ int, int, int, void (*)(const char *const [], int), int (*)(const char *const [], int)));
+void putstr __P((const char *));
void redraw __P((void));
void results __P((void));
int setup __P((int, time_t));
-void showboard __P((char *));
-void showstr __P((char *, int));
+void showboard __P((const char *));
+void showstr __P((const char *, int));
void showword __P((int));
void starttime __P((void));
void startwords __P((void));
void stoptime __P((void));
int timerch __P((void));
void usage __P((void)) __attribute__((__noreturn__));
-int validword __P((char *));
+int validword __P((const char *));
diff --git a/boggle/boggle/mach.c b/boggle/boggle/mach.c
index e2b3abde..4aa4ce32 100644
--- a/boggle/boggle/mach.c
+++ b/boggle/boggle/mach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mach.c,v 1.8 1997/10/13 21:09:59 cjs Exp $ */
+/* $NetBSD: mach.c,v 1.9 1999/09/08 21:17:44 jsm Exp $ */
/*-
* Copyright (c) 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)mach.c 8.1 (Berkeley) 6/11/93";
#else
-__RCSID("$NetBSD: mach.c,v 1.8 1997/10/13 21:09:59 cjs Exp $");
+__RCSID("$NetBSD: mach.c,v 1.9 1999/09/08 21:17:44 jsm Exp $");
#endif
#endif /* not lint */
@@ -70,16 +70,16 @@ static int colstarts[MAXCOLS], ncolstarts;
static int lastline;
int ncols, nlines;
-extern char *pword[], *mword[];
+extern const char *pword[], *mword[];
extern int ngames, nmwords, npwords, tnmwords, tnpwords;
static void cont_catcher __P((int));
-static int prwidth __P((char *[], int));
-static void prword __P((char *[], int));
+static int prwidth __P((const char *const [], int));
+static void prword __P((const char *const [], int));
static void stop_catcher __P((int));
static void tty_cleanup __P((void));
static int tty_setup __P((void));
-static void tty_showboard __P((char *));
+static void tty_showboard __P((const char *));
static void winch_catcher __P((int));
/*
@@ -150,7 +150,7 @@ results()
static void
prword(base, indx)
- char *base[];
+ const char *const base[];
int indx;
{
printw("%s", base[indx]);
@@ -158,7 +158,7 @@ prword(base, indx)
static int
prwidth(base, indx)
- char *base[];
+ const char *const base[];
int indx;
{
return (strlen(base[indx]));
@@ -339,7 +339,7 @@ startwords()
*/
void
addword(w)
- char *w;
+ const char *w;
{
int n;
@@ -410,7 +410,6 @@ findword()
char buf[MAXWORDLEN + 1];
extern char board[];
extern int usedbits, wordpath[];
- extern char *mword[], *pword[];
extern int nmwords, npwords;
getyx(stdscr, r, c);
@@ -480,7 +479,7 @@ findword()
*/
void
showstr(str, delaysecs)
- char *str;
+ const char *str;
int delaysecs;
{
addstr(str);
@@ -493,7 +492,7 @@ showstr(str, delaysecs)
void
putstr(s)
- char *s;
+ const char *s;
{
addstr(s);
}
@@ -561,14 +560,14 @@ getword(q)
void
showboard(b)
- char *b;
+ const char *b;
{
tty_showboard(b);
}
void
prompt(mesg)
- char *mesg;
+ const char *mesg;
{
move(PROMPT_LINE, PROMPT_COL);
printw("%s", mesg);
@@ -660,7 +659,7 @@ tty_cleanup()
static void
tty_showboard(b)
- char *b;
+ const char *b;
{
int i;
int line;
diff --git a/boggle/boggle/prtable.c b/boggle/boggle/prtable.c
index 2555444a..063d51a0 100644
--- a/boggle/boggle/prtable.c
+++ b/boggle/boggle/prtable.c
@@ -1,4 +1,4 @@
-/* $NetBSD: prtable.c,v 1.4 1997/10/11 02:12:17 lukem Exp $ */
+/* $NetBSD: prtable.c,v 1.5 1999/09/08 21:17:45 jsm Exp $ */
/*-
* Copyright (c) 1993
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: prtable.c,v 1.4 1997/10/11 02:12:17 lukem Exp $");
+__RCSID("$NetBSD: prtable.c,v 1.5 1999/09/08 21:17:45 jsm Exp $");
#endif /* not lint */
#include <curses.h>
@@ -49,7 +49,7 @@ __RCSID("$NetBSD: prtable.c,v 1.4 1997/10/11 02:12:17 lukem Exp $");
#define NCOLS 5
-static int get_maxlen __P((char *[], int, int (*)(char **, int)));
+static int get_maxlen __P((const char *const [], int, int (*)(const char *const *, int)));
/*
* Routine to print a table
@@ -68,10 +68,10 @@ static int get_maxlen __P((char *[], int, int (*)(char **, int)));
*/
void
prtable(base, num, d_cols, width, prentry, length)
- char *base[];
+ const char *const base[];
int num, d_cols, width;
- void (*prentry) __P((char *[], int));
- int (*length) __P((char *[], int));
+ void (*prentry) __P((const char *const [], int));
+ int (*length) __P((const char *const [], int));
{
int c, j;
int a, b, cols, loc, maxlen, nrows, z;
@@ -119,9 +119,9 @@ prtable(base, num, d_cols, width, prentry, length)
static int
get_maxlen(base, num, length)
- char *base[];
+ const char *const base[];
int num;
- int (*length) __P((char **, int));
+ int (*length) __P((const char *const *, int));
{
int i, len, max;
diff --git a/boggle/boggle/word.c b/boggle/boggle/word.c
index dd5fa812..b91f3a7b 100644
--- a/boggle/boggle/word.c
+++ b/boggle/boggle/word.c
@@ -1,4 +1,4 @@
-/* $NetBSD: word.c,v 1.4 1997/10/11 02:12:18 lukem Exp $ */
+/* $NetBSD: word.c,v 1.5 1999/09/08 21:17:45 jsm Exp $ */
/*-
* Copyright (c) 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)word.c 8.1 (Berkeley) 6/11/93";
#else
-__RCSID("$NetBSD: word.c,v 1.4 1997/10/11 02:12:18 lukem Exp $");
+__RCSID("$NetBSD: word.c,v 1.5 1999/09/08 21:17:45 jsm Exp $");
#endif
#endif /* not lint */
@@ -127,7 +127,7 @@ dictseek(fp, offset, ptrname)
FILE *
opendict(dict)
- char *dict;
+ const char *dict;
{
FILE *fp;
@@ -188,7 +188,7 @@ loaddict(fp)
*/
int
loadindex(indexfile)
- char *indexfile;
+ const char *indexfile;
{
int i, j;
char buf[BUFSIZ];
diff --git a/caesar/caesar.c b/caesar/caesar.c
index 3359a067..8209edde 100644
--- a/caesar/caesar.c
+++ b/caesar/caesar.c
@@ -1,4 +1,4 @@
-/* $NetBSD: caesar.c,v 1.8 1999/07/21 04:04:21 hubertf Exp $ */
+/* $NetBSD: caesar.c,v 1.9 1999/09/08 21:17:46 jsm Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -51,7 +51,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)caesar.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: caesar.c,v 1.8 1999/07/21 04:04:21 hubertf Exp $");
+__RCSID("$NetBSD: caesar.c,v 1.9 1999/09/08 21:17:46 jsm Exp $");
#endif
#endif /* not lint */
@@ -81,7 +81,7 @@ double stdf[26] = {
int main __P((int, char *[]));
-void printit __P((char *)) __attribute__((__noreturn__));
+void printit __P((const char *)) __attribute__((__noreturn__));
int
main(argc, argv)
@@ -152,7 +152,7 @@ main(argc, argv)
void
printit(arg)
- char *arg;
+ const char *arg;
{
int ch, rot;
diff --git a/canfield/canfield/canfield.c b/canfield/canfield/canfield.c
index 5be6ed8a..3fac5848 100644
--- a/canfield/canfield/canfield.c
+++ b/canfield/canfield/canfield.c
@@ -1,4 +1,4 @@
-/* $NetBSD: canfield.c,v 1.11 1998/09/13 15:27:27 hubertf Exp $ */
+/* $NetBSD: canfield.c,v 1.12 1999/09/08 21:17:46 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: canfield.c,v 1.11 1998/09/13 15:27:27 hubertf Exp $");
+__RCSID("$NetBSD: canfield.c,v 1.12 1999/09/08 21:17:46 jsm Exp $");
#endif
#endif /* not lint */
@@ -210,11 +210,11 @@ void clearbelowmovebox __P((void));
void clearmsg __P((void));
void clearstat __P((void));
void destinerror __P((void));
-bool diffcolor __P((struct cardtype *, struct cardtype *));
+bool diffcolor __P((const struct cardtype *, const struct cardtype *));
void dumberror __P((void));
bool finish __P((void));
void fndbase __P((struct cardtype **, int, int));
-void getcmd __P((int, int, char *));
+void getcmd __P((int, int, const char *));
void initall __P((void));
void initdeck __P((struct cardtype *[]));
void initgame __P((void));
@@ -225,24 +225,24 @@ void movebox __P((void));
void movecard __P((void));
void movetofound __P((struct cardtype **, int));
void movetotalon __P((void));
-bool notempty __P((struct cardtype *));
+bool notempty __P((const struct cardtype *));
void printbottombettingbox __P((void));
void printbottominstructions __P((void));
-void printcard __P((int, int, struct cardtype *));
-void printrank __P((int, int, struct cardtype *, bool));
+void printcard __P((int, int, const struct cardtype *));
+void printrank __P((int, int, const struct cardtype *, bool));
void printtopbettingbox __P((void));
void printtopinstructions __P((void));
-bool rankhigher __P((struct cardtype *, int));
-bool ranklower __P((struct cardtype *, struct cardtype *));
+bool rankhigher __P((const struct cardtype *, int));
+bool ranklower __P((const struct cardtype *, const struct cardtype *));
void removecard __P((int, int));
-int samesuit __P((struct cardtype *, int));
+int samesuit __P((const struct cardtype *, int));
void showcards __P((void));
void showstat __P((void));
void shuffle __P((struct cardtype *[]));
void simpletableau __P((struct cardtype **, int));
void startgame __P((void));
void suspend __P((void));
-bool tabok __P((struct cardtype *, int));
+bool tabok __P((const struct cardtype *, int));
void tabprint __P((int, int));
void tabtotab __P((int, int));
void transit __P((struct cardtype **, struct cardtype **));
@@ -581,7 +581,7 @@ removecard(a, b)
void
printrank(a, b, cp, inverse)
int a, b;
- struct cardtype *cp;
+ const struct cardtype *cp;
bool inverse;
{
move(b, a);
@@ -616,7 +616,7 @@ printrank(a, b, cp, inverse)
void
printcard(a, b, cp)
int a,b;
- struct cardtype *cp;
+ const struct cardtype *cp;
{
if (cp == NIL)
removecard(a, b);
@@ -831,7 +831,7 @@ destinerror()
*/
bool
notempty(cp)
- struct cardtype *cp;
+ const struct cardtype *cp;
{
if (cp == NIL) {
errmsg = TRUE;
@@ -847,7 +847,7 @@ notempty(cp)
*/
bool
ranklower(cp1, cp2)
- struct cardtype *cp1, *cp2;
+ const struct cardtype *cp1, *cp2;
{
if (cp2->rank == Ace)
if (cp1->rank == King)
@@ -865,7 +865,7 @@ ranklower(cp1, cp2)
*/
bool
diffcolor(cp1, cp2)
- struct cardtype *cp1, *cp2;
+ const struct cardtype *cp1, *cp2;
{
if (cp1->color == cp2->color)
return (FALSE);
@@ -878,7 +878,7 @@ diffcolor(cp1, cp2)
*/
bool
tabok(cp, des)
- struct cardtype *cp;
+ const struct cardtype *cp;
int des;
{
if ((cp == stock) && (tableau[des] == NIL))
@@ -1282,7 +1282,7 @@ tabtotab(sour, des)
*/
bool
rankhigher(cp, let)
- struct cardtype *cp;
+ const struct cardtype *cp;
int let;
{
if (found[let]->rank == King)
@@ -1301,7 +1301,7 @@ rankhigher(cp, let)
*/
int
samesuit(cp, let)
- struct cardtype *cp;
+ const struct cardtype *cp;
int let;
{
if (cp->suit == found[let]->suit)
@@ -1368,7 +1368,7 @@ movetofound(cp, source)
void
getcmd(row, col, cp)
int row, col;
- char *cp;
+ const char *cp;
{
char cmd[2] = { '\0', '\0'}, ch;
int i;
@@ -1588,7 +1588,7 @@ movecard()
} while (!done);
}
-char *basicinstructions[] = {
+const char *const basicinstructions[] = {
"Here are brief instuctions to the game of Canfield:\n\n",
" If you have never played solitaire before, it is recom-\n",
"mended that you consult a solitaire instruction book. In\n",
@@ -1610,7 +1610,7 @@ char *basicinstructions[] = {
"push any key when you are finished: ",
0 };
-char *bettinginstructions[] = {
+const char *const bettinginstructions[] = {
" The rules for betting are somewhat less strict than\n",
"those used in the official version of the game. The initial\n",
"deal costs $13. You may quit at this point or inspect the\n",
@@ -1638,7 +1638,7 @@ char *bettinginstructions[] = {
void
instruct()
{
- char **cp;
+ const char *const *cp;
move(originrow, origincol);
printw("This is the game of solitaire called Canfield. Do\n");
diff --git a/canfield/cfscores/cfscores.c b/canfield/cfscores/cfscores.c
index e5830fef..84216877 100644
--- a/canfield/cfscores/cfscores.c
+++ b/canfield/cfscores/cfscores.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cfscores.c,v 1.6 1998/08/29 22:47:57 hubertf Exp $ */
+/* $NetBSD: cfscores.c,v 1.7 1999/09/08 21:17:46 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)cfscores.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cfscores.c,v 1.6 1998/08/29 22:47:57 hubertf Exp $");
+__RCSID("$NetBSD: cfscores.c,v 1.7 1999/09/08 21:17:46 jsm Exp $");
#endif
#endif /* not lint */
@@ -69,7 +69,7 @@ struct betinfo {
int dbfd;
int main __P((int, char *[]));
-void printuser __P((struct passwd *, int));
+void printuser __P((const struct passwd *, int));
int
main(argc, argv)
@@ -116,7 +116,7 @@ main(argc, argv)
*/
void
printuser(pw, printfail)
- struct passwd *pw;
+ const struct passwd *pw;
int printfail;
{
struct betinfo total;
diff --git a/cribbage/cards.c b/cribbage/cards.c
index e6c52628..c4d2610f 100644
--- a/cribbage/cards.c
+++ b/cribbage/cards.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cards.c,v 1.4 1997/10/10 12:32:22 lukem Exp $ */
+/* $NetBSD: cards.c,v 1.5 1999/09/08 21:17:47 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cards.c,v 1.4 1997/10/10 12:32:22 lukem Exp $");
+__RCSID("$NetBSD: cards.c,v 1.5 1999/09/08 21:17:47 jsm Exp $");
#endif
#endif /* not lint */
@@ -105,7 +105,8 @@ eq(a, b)
*/
int
isone(a, b, n)
- CARD a, b[];
+ CARD a;
+ const CARD b[];
int n;
{
int i;
diff --git a/cribbage/crib.c b/cribbage/crib.c
index e7d9ce3d..83a9e422 100644
--- a/cribbage/crib.c
+++ b/cribbage/crib.c
@@ -1,4 +1,4 @@
-/* $NetBSD: crib.c,v 1.10 1998/08/30 09:19:37 veego Exp $ */
+/* $NetBSD: crib.c,v 1.11 1999/09/08 21:17:47 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)crib.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: crib.c,v 1.10 1998/08/30 09:19:37 veego Exp $");
+__RCSID("$NetBSD: crib.c,v 1.11 1999/09/08 21:17:47 jsm Exp $");
#endif
#endif /* not lint */
@@ -343,7 +343,7 @@ void
discard(mycrib)
BOOLEAN mycrib;
{
- char *prompt;
+ const char *prompt;
CARD crd;
prcrib(mycrib, TRUE);
diff --git a/cribbage/cribbage.h b/cribbage/cribbage.h
index a28b4b06..51dd3764 100644
--- a/cribbage/cribbage.h
+++ b/cribbage/cribbage.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cribbage.h,v 1.4 1998/09/13 15:27:27 hubertf Exp $ */
+/* $NetBSD: cribbage.h,v 1.5 1999/09/08 21:17:47 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -62,14 +62,14 @@ extern BOOLEAN playing; /* currently playing game */
extern char expl[]; /* string for explanation */
void addmsg __P((const char *, ...));
-int adjust __P((CARD [], CARD));
-int anymove __P((CARD [], int, int));
-int anysumto __P((CARD [], int, int, int));
+int adjust __P((const CARD [], CARD));
+int anymove __P((const CARD [], int, int));
+int anysumto __P((const CARD [], int, int, int));
void bye __P((void));
-int cchose __P((CARD [], int, int));
+int cchose __P((const CARD [], int, int));
void cdiscard __P((BOOLEAN));
int chkscr __P((int *, int));
-int comphand __P((CARD [], char *));
+int comphand __P((const CARD [], const char *));
void cremove __P((CARD, CARD [], int));
int cut __P((BOOLEAN, int));
int deal __P((int));
@@ -77,38 +77,38 @@ void discard __P((BOOLEAN));
void do_wait __P((void));
void endmsg __P((void));
int eq __P((CARD, CARD));
-int fifteens __P((CARD [], int));
+int fifteens __P((const CARD [], int));
void game __P((void));
void gamescore __P((void));
char *getline __P((void));
int getuchar __P((void));
int incard __P((CARD *));
-int infrom __P((CARD [], int, char *));
+int infrom __P((const CARD [], int, const char *));
void instructions __P((void));
-int isone __P((CARD, CARD [], int));
+int is_one __P((CARD, const CARD [], int));
void makeboard __P((void));
void makedeck __P((CARD []));
-void makeknown __P((CARD [], int));
+void makeknown __P((const CARD [], int));
void msg __P((const char *, ...));
int msgcard __P((CARD, BOOLEAN));
-int msgcrd __P((CARD, BOOLEAN, char *, BOOLEAN));
-int number __P((int, int, char *));
-int numofval __P((CARD [], int, int));
-int pairuns __P((CARD [], int));
+int msgcrd __P((CARD, BOOLEAN, const char *, BOOLEAN));
+int number __P((int, int, const char *));
+int numofval __P((const CARD [], int, int));
+int pairuns __P((const CARD [], int));
int peg __P((BOOLEAN));
-int pegscore __P((CARD, CARD [], int, int));
+int pegscore __P((CARD, const CARD [], int, int));
int playhand __P((BOOLEAN));
-int plyrhand __P((CARD [], char *));
+int plyrhand __P((const CARD [], const char *));
void prcard __P((WINDOW *, int, int, CARD, BOOLEAN));
void prcrib __P((BOOLEAN, BOOLEAN));
-void prhand __P((CARD [], int, WINDOW *, BOOLEAN));
+void prhand __P((const CARD [], int, WINDOW *, BOOLEAN));
void printcard __P((WINDOW *, int, CARD, BOOLEAN));
void prpeg __P((int, int, BOOLEAN));
void prtable __P((int));
int readchar __P((void));
void rint __P((int)) __attribute__((__noreturn__));
int score __P((BOOLEAN));
-int scorehand __P((CARD [], CARD, int, BOOLEAN, BOOLEAN));
+int scorehand __P((const CARD [], CARD, int, BOOLEAN, BOOLEAN));
void shuffle __P((CARD []));
void sorthand __P((CARD [], int));
void wait_for __P((int));
diff --git a/cribbage/io.c b/cribbage/io.c
index f73fc097..56278b77 100644
--- a/cribbage/io.c
+++ b/cribbage/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.10 1997/10/10 12:32:32 lukem Exp $ */
+/* $NetBSD: io.c,v 1.11 1999/09/08 21:17:47 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: io.c,v 1.10 1997/10/10 12:32:32 lukem Exp $");
+__RCSID("$NetBSD: io.c,v 1.11 1999/09/08 21:17:47 jsm Exp $");
#endif
#endif /* not lint */
@@ -69,18 +69,18 @@ __RCSID("$NetBSD: io.c,v 1.10 1997/10/10 12:32:32 lukem Exp $");
char linebuf[LINESIZE];
-char *rankname[RANKS] = {
+const char *const rankname[RANKS] = {
"ACE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN",
"EIGHT", "NINE", "TEN", "JACK", "QUEEN", "KING"
};
-char *rankchar[RANKS] = {
+const char *const rankchar[RANKS] = {
"A", "2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K"
};
-char *suitname[SUITS] = {"SPADES", "HEARTS", "DIAMONDS", "CLUBS"};
+const char *const suitname[SUITS] = {"SPADES", "HEARTS", "DIAMONDS", "CLUBS"};
-char *suitchar[SUITS] = {"S", "H", "D", "C"};
+const char *const suitchar[SUITS] = {"S", "H", "D", "C"};
/*
* msgcard:
@@ -105,7 +105,7 @@ int
msgcrd(c, brfrank, mid, brfsuit)
CARD c;
BOOLEAN brfrank, brfsuit;
- char *mid;
+ const char *mid;
{
if (c.rank == EMPTY || c.suit == EMPTY)
return (FALSE);
@@ -169,7 +169,7 @@ prcard(win, y, x, c, blank)
*/
void
prhand(h, n, win, blank)
- CARD h[];
+ const CARD h[];
int n;
WINDOW *win;
BOOLEAN blank;
@@ -189,9 +189,9 @@ prhand(h, n, win, blank)
*/
int
infrom(hand, n, prompt)
- CARD hand[];
+ const CARD hand[];
int n;
- char *prompt;
+ const char *prompt;
{
int i, j;
CARD crd;
@@ -348,7 +348,7 @@ getuchar()
int
number(lo, hi, prompt)
int lo, hi;
- char *prompt;
+ const char *prompt;
{
char *p;
int sum;
@@ -496,7 +496,7 @@ endmsg()
void
do_wait()
{
- static char prompt[] = {'-', '-', 'M', 'o', 'r', 'e', '-', '-', '\0'};
+ static const char prompt[] = {'-', '-', 'M', 'o', 'r', 'e', '-', '-', '\0'};
if (Mpos + sizeof prompt < MSG_X)
wmove(Msgwin, Lineno > 0 ? Lineno - 1 : MSG_Y - 1, Mpos);
diff --git a/cribbage/score.c b/cribbage/score.c
index 69c38a7f..00c8bb49 100644
--- a/cribbage/score.c
+++ b/cribbage/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.6 1998/08/30 09:19:37 veego Exp $ */
+/* $NetBSD: score.c,v 1.7 1999/09/08 21:17:47 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.6 1998/08/30 09:19:37 veego Exp $");
+__RCSID("$NetBSD: score.c,v 1.7 1999/09/08 21:17:47 jsm Exp $");
#endif
#endif /* not lint */
@@ -56,7 +56,7 @@ __RCSID("$NetBSD: score.c,v 1.6 1998/08/30 09:19:37 veego Exp $");
* array. the two arrays are for the case where the suits are equal and
* not equal respectively
*/
-long crbescr[169] = {
+const long crbescr[169] = {
-10000, 271827, 278883, 332319, 347769, 261129, 250653, 253203, 248259,
243435, 256275, 237435, 231051, -10000, -10000, 412815, 295707, 349497,
267519, 262521, 259695, 254019, 250047, 262887, 244047, 237663, -10000,
@@ -78,7 +78,7 @@ long crbescr[169] = {
-10000, -10000, -10000, -10000, -10000, -10000, -10000
};
-long crbnescr[169] = {
+const long crbnescr[169] = {
325272, 260772, 267828, 321264, 336714, 250074, 239598, 242148, 237204,
232380, 246348, 226380, 219996, -10000, 342528, 401760, 284652, 338442,
256464, 251466, 248640, 242964, 238992, 252960, 232992, 226608, -10000,
@@ -100,7 +100,7 @@ long crbnescr[169] = {
-10000, -10000, -10000, -10000, -10000, -10000, 295896
};
-static int ichoose2[5] = { 0, 0, 2, 6, 12 };
+static const int ichoose2[5] = { 0, 0, 2, 6, 12 };
static int pairpoints, runpoints; /* Globals from pairuns. */
/*
@@ -110,7 +110,7 @@ static int pairpoints, runpoints; /* Globals from pairuns. */
*/
int
scorehand(hand, starter, n, crb, do_explain)
- CARD hand[];
+ const CARD hand[];
CARD starter;
int n;
BOOLEAN crb; /* true if scoring crib */
@@ -185,12 +185,12 @@ scorehand(hand, starter, n, crb, do_explain)
*/
int
fifteens(hand, n)
- CARD hand[];
+ const CARD hand[];
int n;
{
int *sp, *np;
int i;
- CARD *endp;
+ const CARD *endp;
static int sums[15], nsums[15];
np = nsums;
@@ -228,7 +228,7 @@ fifteens(hand, n)
*/
int
pairuns(h, n)
- CARD h[];
+ const CARD h[];
int n;
{
int i;
@@ -297,7 +297,8 @@ pairuns(h, n)
*/
int
pegscore(crd, tbl, n, sum)
- CARD crd, tbl[];
+ CARD crd;
+ const CARD tbl[];
int n, sum;
{
BOOLEAN got[RANKS];
@@ -352,7 +353,8 @@ pegscore(crd, tbl, n, sum)
*/
int
adjust(cb, tnv)
- CARD cb[], tnv;
+ const CARD cb[];
+ CARD tnv;
{
long scr;
int i, c0, c1;
diff --git a/cribbage/support.c b/cribbage/support.c
index 96ea67ad..2f3c076a 100644
--- a/cribbage/support.c
+++ b/cribbage/support.c
@@ -1,4 +1,4 @@
-/* $NetBSD: support.c,v 1.4 1997/10/10 12:32:36 lukem Exp $ */
+/* $NetBSD: support.c,v 1.5 1999/09/08 21:17:47 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: support.c,v 1.4 1997/10/10 12:32:36 lukem Exp $");
+__RCSID("$NetBSD: support.c,v 1.5 1999/09/08 21:17:47 jsm Exp $");
#endif
#endif /* not lint */
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: support.c,v 1.4 1997/10/10 12:32:36 lukem Exp $");
#define NTV 10 /* number scores to test */
/* score to test reachability of, and order to test them in */
-int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5};
+const int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5};
/*
* computer chooses what to play in pegging...
@@ -60,7 +60,7 @@ int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5};
*/
int
cchose(h, n, s)
- CARD h[];
+ const CARD h[];
int n, s;
{
int i, j, l;
@@ -129,8 +129,8 @@ cchose(h, n, s)
*/
int
plyrhand(hand, s)
- CARD hand[];
- char *s;
+ const CARD hand[];
+ const char *s;
{
static char prompt[BUFSIZ];
int i, j;
@@ -165,8 +165,8 @@ plyrhand(hand, s)
*/
int
comphand(h, s)
- CARD h[];
- char *s;
+ const CARD h[];
+ const char *s;
{
int j;
@@ -299,7 +299,7 @@ cdiscard(mycrib)
*/
int
anymove(hand, n, sum)
- CARD hand[];
+ const CARD hand[];
int n, sum;
{
int i, j;
@@ -320,7 +320,7 @@ anymove(hand, n, sum)
*/
int
anysumto(hand, n, s, t)
- CARD hand[];
+ const CARD hand[];
int n, s, t;
{
int i;
@@ -337,7 +337,7 @@ anysumto(hand, n, s, t)
*/
int
numofval(h, n, v)
- CARD h[];
+ const CARD h[];
int n, v;
{
int i, j;
@@ -355,7 +355,7 @@ numofval(h, n, v)
*/
void
makeknown(h, n)
- CARD h[];
+ const CARD h[];
int n;
{
int i;
diff --git a/factor/factor.c b/factor/factor.c
index 4c41cc81..7567a69c 100644
--- a/factor/factor.c
+++ b/factor/factor.c
@@ -1,4 +1,4 @@
-/* $NetBSD: factor.c,v 1.8 1998/09/13 15:27:27 hubertf Exp $ */
+/* $NetBSD: factor.c,v 1.9 1999/09/08 21:17:48 jsm Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)factor.c 8.4 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: factor.c,v 1.8 1998/09/13 15:27:27 hubertf Exp $");
+__RCSID("$NetBSD: factor.c,v 1.9 1999/09/08 21:17:48 jsm Exp $");
#endif
#endif /* not lint */
@@ -85,8 +85,8 @@ __RCSID("$NetBSD: factor.c,v 1.8 1998/09/13 15:27:27 hubertf Exp $");
* We are able to sieve 2^32-1 because this byte table yields all primes
* up to 65537 and 65537^2 > 2^32-1.
*/
-extern ubig prime[];
-extern ubig *pr_limit; /* largest prime in the prime array */
+extern const ubig prime[];
+extern const ubig *pr_limit; /* largest prime in the prime array */
int main __P((int, char *[]));
void pr_fact __P((ubig)); /* print factors of a value */
@@ -164,7 +164,7 @@ void
pr_fact(val)
ubig val; /* Factor this value. */
{
- ubig *fact; /* The factor found. */
+ const ubig *fact; /* The factor found. */
/* Firewall - catch 0 and 1. */
if (val == 0) /* Historical practice; 0 just exits. */
diff --git a/fish/fish.c b/fish/fish.c
index 3775e50f..1ce39130 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fish.c,v 1.8 1999/07/14 17:30:21 hubertf Exp $ */
+/* $NetBSD: fish.c,v 1.9 1999/09/08 21:17:48 jsm Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993\n\
#if 0
static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fish.c,v 1.8 1999/07/14 17:30:21 hubertf Exp $");
+__RCSID("$NetBSD: fish.c,v 1.9 1999/09/08 21:17:48 jsm Exp $");
#endif
#endif /* not lint */
@@ -70,7 +70,7 @@ __RCSID("$NetBSD: fish.c,v 1.8 1999/07/14 17:30:21 hubertf Exp $");
#define COMPUTER 0
#define OTHER(a) (1 - (a))
-char *cards[] = {
+const char *const cards[] = {
"A", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "J", "Q", "K", NULL,
};
@@ -80,10 +80,10 @@ int promode;
int asked[RANKS], comphand[RANKS], deck[RANKS];
int userasked[RANKS], userhand[RANKS];
-void chkwinner __P((int, int *));
+void chkwinner __P((int, const int *));
int compmove __P((void));
-int countbooks __P((int *));
-int countcards __P((int *));
+int countbooks __P((const int *));
+int countcards __P((const int *));
int drawcard __P((int, int *));
int gofish __P((int, int, int *));
void goodmove __P((int, int, int *, int *));
@@ -91,7 +91,7 @@ void init __P((void));
void instructions __P((void));
int main __P((int, char *[]));
int nrandom __P((int));
-void printhand __P((int *));
+void printhand __P((const int *));
void printplayer __P((int));
int promove __P((void));
void usage __P((void)) __attribute__((__noreturn__));
@@ -155,7 +155,7 @@ int
usermove()
{
int n;
- char **p;
+ const char *const *p;
char buf[256];
(void)printf("\nYour hand is:");
@@ -330,7 +330,7 @@ goodmove(player, move, hand, opphand)
void
chkwinner(player, hand)
int player;
- int *hand;
+ const int *hand;
{
int cb, i, ub;
@@ -373,7 +373,7 @@ printplayer(player)
void
printhand(hand)
- int *hand;
+ const int *hand;
{
int book, i, j;
@@ -394,7 +394,7 @@ printhand(hand)
int
countcards(hand)
- int *hand;
+ const int *hand;
{
int i, count;
@@ -405,7 +405,7 @@ countcards(hand)
int
countbooks(hand)
- int *hand;
+ const int *hand;
{
int i, count;
diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c
index 1ed64301..a2c1075a 100644
--- a/fortune/fortune/fortune.c
+++ b/fortune/fortune/fortune.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fortune.c,v 1.15 1999/08/21 07:02:46 simonb Exp $ */
+/* $NetBSD: fortune.c,v 1.16 1999/09/08 21:17:48 jsm Exp $ */
/*-
* Copyright (c) 1986, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\
#if 0
static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fortune.c,v 1.15 1999/08/21 07:02:46 simonb Exp $");
+__RCSID("$NetBSD: fortune.c,v 1.16 1999/09/08 21:17:48 jsm Exp $");
#endif
#endif /* not lint */
@@ -89,8 +89,8 @@ typedef struct fd {
int fd, datfd;
off_t pos;
FILE *inf;
- char *name;
- char *path;
+ const char *name;
+ const char *path;
char *datfile, *posfile;
bool read_tbl;
bool was_pos_file;
@@ -129,9 +129,9 @@ STRFILE Noprob_tbl; /* sum of data for all no prob files */
int add_dir __P((FILEDESC *));
int add_file __P((int,
- char *, char *, FILEDESC **, FILEDESC **, FILEDESC *));
-void all_forts __P((FILEDESC *, char *));
-char *copy __P((char *, u_int));
+ const char *, const char *, FILEDESC **, FILEDESC **, FILEDESC *));
+void all_forts __P((FILEDESC *, const char *));
+char *copy __P((const char *, u_int));
void display __P((FILEDESC *));
void do_free __P((void *));
void *do_malloc __P((u_int));
@@ -142,14 +142,14 @@ void get_pos __P((FILEDESC *));
void get_tbl __P((FILEDESC *));
void getargs __P((int, char *[]));
void init_prob __P((void));
-int is_dir __P((char *));
-int is_fortfile __P((char *, char **, char **, int));
-int is_off_name __P((char *));
+int is_dir __P((const char *));
+int is_fortfile __P((const char *, char **, char **, int));
+int is_off_name __P((const char *));
int main __P((int, char *[]));
int max __P((int, int));
FILEDESC *
new_fp __P((void));
-char *off_name __P((char *));
+char *off_name __P((const char *));
void open_dat __P((FILEDESC *));
void open_fp __P((FILEDESC *));
FILEDESC *
@@ -409,7 +409,7 @@ form_file_list(files, file_cnt)
int file_cnt;
{
int i, percent;
- char *sp;
+ const char *sp;
if (file_cnt == 0) {
if (Find_files)
@@ -467,29 +467,32 @@ form_file_list(files, file_cnt)
int
add_file(percent, file, dir, head, tail, parent)
int percent;
- char *file;
- char *dir;
+ const char *file;
+ const char *dir;
FILEDESC **head, **tail;
FILEDESC *parent;
{
FILEDESC *fp;
int fd;
- char *path, *offensive;
+ const char *path;
+ char *tpath, *offensive;
bool was_malloc;
bool isdir;
if (dir == NULL) {
path = file;
+ tpath = NULL;
was_malloc = FALSE;
}
else {
- path = do_malloc((unsigned int) (strlen(dir) + strlen(file) + 2));
- (void) strcat(strcat(strcpy(path, dir), "/"), file);
+ tpath = do_malloc((unsigned int) (strlen(dir) + strlen(file) + 2));
+ (void) strcat(strcat(strcpy(tpath, dir), "/"), file);
+ path = tpath;
was_malloc = TRUE;
}
if ((isdir = is_dir(path)) && parent != NULL) {
if (was_malloc)
- free(path);
+ free(tpath);
return FALSE; /* don't recurse */
}
offensive = NULL;
@@ -499,7 +502,7 @@ add_file(percent, file, dir, head, tail, parent)
was_malloc = TRUE;
if (Offend) {
if (was_malloc)
- free(path);
+ free(tpath);
path = offensive;
file = off_name(file);
}
@@ -519,7 +522,7 @@ over:
if (All_forts && offensive != NULL) {
path = offensive;
if (was_malloc)
- free(path);
+ free(tpath);
offensive = NULL;
was_malloc = TRUE;
DPRINTF(1, (stderr, "\ttrying \"%s\"\n", path));
@@ -532,7 +535,7 @@ over:
if (parent == NULL)
warn("Cannot open `%s'", path);
if (was_malloc)
- free(path);
+ free(tpath);
return FALSE;
}
@@ -553,7 +556,7 @@ over:
warnx("`%s' not a fortune file or directory", path);
free((char *) fp);
if (was_malloc)
- free(path);
+ free(tpath);
do_free(fp->datfile);
do_free(fp->posfile);
do_free(offensive);
@@ -617,7 +620,7 @@ new_fp()
*/
char *
off_name(file)
- char *file;
+ const char *file;
{
char *new;
@@ -631,7 +634,7 @@ off_name(file)
*/
int
is_off_name(file)
- char *file;
+ const char *file;
{
int len;
@@ -647,7 +650,7 @@ is_off_name(file)
void
all_forts(fp, offensive)
FILEDESC *fp;
- char *offensive;
+ const char *offensive;
{
char *sp;
FILEDESC *scene, *obscene;
@@ -734,7 +737,7 @@ add_dir(fp)
*/
int
is_dir(file)
- char *file;
+ const char *file;
{
struct stat sbuf;
@@ -753,13 +756,14 @@ is_dir(file)
/* ARGSUSED */
int
is_fortfile(file, datp, posp, check_for_offend)
- char *file, **datp, **posp;
+ const char *file;
+ char **datp, **posp;
int check_for_offend;
{
int i;
- char *sp;
+ const char *sp;
char *datfile;
- static char *suflist[] = { /* list of "illegal" suffixes" */
+ static const char *const suflist[] = { /* list of "illegal" suffixes" */
"dat", "pos", "c", "h", "p", "i", "f",
"pas", "ftn", "ins.c", "ins,pas",
"ins.ftn", "sml",
@@ -822,7 +826,7 @@ is_fortfile(file, datp, posp, check_for_offend)
*/
char *
copy(str, len)
- char *str;
+ const char *str;
unsigned int len;
{
char *new, *sp;
diff --git a/fortune/strfile/strfile.c b/fortune/strfile/strfile.c
index a27c2711..69357391 100644
--- a/fortune/strfile/strfile.c
+++ b/fortune/strfile/strfile.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strfile.c,v 1.9 1999/08/21 07:02:46 simonb Exp $ */
+/* $NetBSD: strfile.c,v 1.10 1999/09/08 21:17:49 jsm Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)strfile.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: strfile.c,v 1.9 1999/08/21 07:02:46 simonb Exp $");
+__RCSID("$NetBSD: strfile.c,v 1.10 1999/09/08 21:17:49 jsm Exp $");
#endif
#endif /* not lint */
@@ -396,12 +396,12 @@ int
cmp_str(vp1, vp2)
const void *vp1, *vp2;
{
- STR *p1, *p2;
+ const STR *p1, *p2;
int c1, c2;
int n1, n2;
- p1 = (STR *)vp1;
- p2 = (STR *)vp2;
+ p1 = (const STR *)vp1;
+ p2 = (const STR *)vp2;
# define SET_N(nf,ch) (nf = (ch == '\n'))
# define IS_END(ch,nf) (ch == Delimch && nf)
diff --git a/gomoku/bdisp.c b/gomoku/bdisp.c
index b530f32a..becce6b7 100644
--- a/gomoku/bdisp.c
+++ b/gomoku/bdisp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bdisp.c,v 1.5 1997/10/10 13:36:02 lukem Exp $ */
+/* $NetBSD: bdisp.c,v 1.6 1999/09/08 21:17:49 jsm Exp $ */
/*
* Copyright (c) 1994
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)bdisp.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: bdisp.c,v 1.5 1997/10/10 13:36:02 lukem Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.6 1999/09/08 21:17:49 jsm Exp $");
#endif
#endif /* not lint */
@@ -211,17 +211,15 @@ bdump(fp)
*/
void
dislog(str)
- char *str;
+ const char *str;
{
if (++lastline >= SCRNH - 1) {
/* move 'em up */
lastline = 1;
}
- if (strlen(str) >= SCRNW - 46)
- str[SCRNW - 46 - 1] = '\0';
move(lastline, 46);
- addstr(str);
+ addnstr(str, SCRNW - 46 - 1);
clrtoeol();
move(lastline + 1, 46);
clrtoeol();
@@ -233,7 +231,7 @@ dislog(str)
void
ask(str)
- char *str;
+ const char *str;
{
int len = strlen(str);
diff --git a/gomoku/gomoku.h b/gomoku/gomoku.h
index 9f304f80..84ccd471 100644
--- a/gomoku/gomoku.h
+++ b/gomoku/gomoku.h
@@ -1,4 +1,4 @@
-/* $NetBSD: gomoku.h,v 1.5 1998/09/13 15:27:28 hubertf Exp $ */
+/* $NetBSD: gomoku.h,v 1.6 1999/09/08 21:17:49 jsm Exp $ */
/*
* Copyright (c) 1994
@@ -248,11 +248,11 @@ struct ovlp_info {
u_char o_frameindex; /* intersection frame index */
};
-extern char *letters;
+extern const char *letters;
extern char fmtbuf[];
-extern char pdir[];
+extern const char pdir[];
-extern int dd[4];
+extern const int dd[4];
extern struct spotstr board[BAREA]; /* info for board */
extern struct combostr frames[FAREA]; /* storage for single frames */
extern struct combostr *sortframes[2]; /* sorted, non-empty frames */
@@ -267,24 +267,24 @@ extern int debug;
void bdinit __P((struct spotstr *));
void init_overlap __P((void));
int getline __P((char *, int));
-void ask __P((char *));
-void dislog __P((char *));
+void ask __P((const char *));
+void dislog __P((const char *));
void bdump __P((FILE *));
void bdisp __P((void));
void bdisp_init __P((void));
void cursfini __P((void));
void cursinit __P((void));
void bdwho __P((int));
-void panic __P((char *)) __attribute__((__noreturn__));
-void log __P((char *));
-void dlog __P((char *));
+void panic __P((const char *)) __attribute__((__noreturn__));
+void log __P((const char *));
+void dlog __P((const char *));
void quit __P((void)) __attribute__((__noreturn__));
void quitsig __P((int)) __attribute__((__noreturn__));
void whatsup __P((int));
int readinput __P((FILE *));
-char *stoc __P((int));
+const char *stoc __P((int));
int lton __P((int));
-int ctos __P((char *));
+int ctos __P((const char *));
void update_overlap __P((struct spotstr *));
int makemove __P((int, int));
int list_eq __P((struct combostr **, struct combostr **, int));
@@ -301,5 +301,5 @@ int checkframes __P((struct combostr *, struct combostr *, struct spotstr *,
int, struct ovlp_info *));
void addframes __P((int));
void scanframes __P((int));
-int better __P((struct spotstr *, struct spotstr *, int));
+int better __P((const struct spotstr *, const struct spotstr *, int));
int pickmove __P((int));
diff --git a/gomoku/main.c b/gomoku/main.c
index 301812c2..5674fb99 100644
--- a/gomoku/main.c
+++ b/gomoku/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.5 1998/02/03 05:40:45 perry Exp $ */
+/* $NetBSD: main.c,v 1.6 1999/09/08 21:17:49 jsm Exp $ */
/*
* Copyright (c) 1994
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1994\n\
#if 0
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: main.c,v 1.5 1998/02/03 05:40:45 perry Exp $");
+__RCSID("$NetBSD: main.c,v 1.6 1999/09/08 21:17:49 jsm Exp $");
#endif
#endif /* not lint */
@@ -71,7 +71,7 @@ char *prog; /* name of program */
FILE *debugfp; /* file for debug output */
FILE *inputfp; /* file for debug input */
-char pdir[4] = "-\\|/";
+const char pdir[4] = "-\\|/";
char fmtbuf[128];
struct spotstr board[BAREA]; /* info for board */
@@ -81,7 +81,7 @@ u_char overlap[FAREA * FAREA]; /* true if frame [a][b] overlap */
short intersect[FAREA * FAREA]; /* frame [a][b] intersection */
int movelog[BSZ * BSZ]; /* log of all the moves */
int movenum; /* current move number */
-char *plyr[2]; /* who's who */
+const char *plyr[2]; /* who's who */
int main __P((int, char *[]));
@@ -93,7 +93,7 @@ main(argc, argv)
char buf[128];
int color, curmove, i, ch;
int input[2];
- static char *fmt[2] = {
+ static const char *const fmt[2] = {
"%3d %-6s",
"%3d %-6s"
};
@@ -497,7 +497,7 @@ syntax:
*/
void
dlog(str)
- char *str;
+ const char *str;
{
if (debugfp)
@@ -510,7 +510,7 @@ dlog(str)
void
log(str)
- char *str;
+ const char *str;
{
if (debugfp)
@@ -543,7 +543,7 @@ quitsig(dummy)
*/
void
panic(str)
- char *str;
+ const char *str;
{
fprintf(stderr, "%s: %s\n", prog, str);
fputs("resign\n", stdout);
diff --git a/gomoku/makemove.c b/gomoku/makemove.c
index ca270068..4b23ba9c 100644
--- a/gomoku/makemove.c
+++ b/gomoku/makemove.c
@@ -1,4 +1,4 @@
-/* $NetBSD: makemove.c,v 1.4 1997/10/10 13:36:05 lukem Exp $ */
+/* $NetBSD: makemove.c,v 1.5 1999/09/08 21:17:49 jsm Exp $ */
/*
* Copyright (c) 1994
@@ -41,18 +41,18 @@
#if 0
static char sccsid[] = "@(#)makemove.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: makemove.c,v 1.4 1997/10/10 13:36:05 lukem Exp $");
+__RCSID("$NetBSD: makemove.c,v 1.5 1999/09/08 21:17:49 jsm Exp $");
#endif
#endif /* not lint */
#include "gomoku.h"
/* direction deltas */
-int dd[4] = {
+const int dd[4] = {
MRIGHT, MRIGHT+MDOWN, MDOWN, MDOWN+MLEFT
};
-int weight[5] = { 0, 1, 7, 22, 100 };
+const int weight[5] = { 0, 1, 7, 22, 100 };
/*
* Return values:
diff --git a/gomoku/pickmove.c b/gomoku/pickmove.c
index 4a762927..1ddf29bf 100644
--- a/gomoku/pickmove.c
+++ b/gomoku/pickmove.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pickmove.c,v 1.5 1997/10/10 13:36:06 lukem Exp $ */
+/* $NetBSD: pickmove.c,v 1.6 1999/09/08 21:17:49 jsm Exp $ */
/*
* Copyright (c) 1994
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)pickmove.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: pickmove.c,v 1.5 1997/10/10 13:36:06 lukem Exp $");
+__RCSID("$NetBSD: pickmove.c,v 1.6 1999/09/08 21:17:49 jsm Exp $");
#endif
#endif /* not lint */
@@ -171,8 +171,8 @@ pickmove(us)
*/
int
better(sp, sp1, us)
- struct spotstr *sp;
- struct spotstr *sp1;
+ const struct spotstr *sp;
+ const struct spotstr *sp1;
int us;
{
int them, s, s1;
diff --git a/gomoku/stoc.c b/gomoku/stoc.c
index c5d62e94..ccfd164a 100644
--- a/gomoku/stoc.c
+++ b/gomoku/stoc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: stoc.c,v 1.4 1997/10/10 13:36:07 lukem Exp $ */
+/* $NetBSD: stoc.c,v 1.5 1999/09/08 21:17:50 jsm Exp $ */
/*
* Copyright (c) 1994
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)stoc.c 8.1 (Berkeley) 7/24/94";
#else
-__RCSID("$NetBSD: stoc.c,v 1.4 1997/10/10 13:36:07 lukem Exp $");
+__RCSID("$NetBSD: stoc.c,v 1.5 1999/09/08 21:17:50 jsm Exp $");
#endif
#endif /* not lint */
@@ -49,13 +49,13 @@ __RCSID("$NetBSD: stoc.c,v 1.4 1997/10/10 13:36:07 lukem Exp $");
#include <stdlib.h>
#include "gomoku.h"
-char *letters = "<ABCDEFGHJKLMNOPQRST>";
+const char *letters = "<ABCDEFGHJKLMNOPQRST>";
struct mvstr {
int m_code;
- char *m_text;
+ const char *m_text;
};
-static struct mvstr mv[] = {
+static const struct mvstr mv[] = {
{ RESIGN, "resign" },
{ RESIGN, "quit" },
{ SAVE, "save" },
@@ -65,7 +65,7 @@ static struct mvstr mv[] = {
/*
* Turn the spot number form of a move into the character form.
*/
-char *
+const char *
stoc(s)
int s;
{
@@ -84,7 +84,7 @@ stoc(s)
*/
int
ctos(mp)
- char *mp;
+ const char *mp;
{
int i;
diff --git a/hangman/extern.c b/hangman/extern.c
index 59a310fa..a412fe9b 100644
--- a/hangman/extern.c
+++ b/hangman/extern.c
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.c,v 1.4 1997/10/11 01:16:27 lukem Exp $ */
+/* $NetBSD: extern.c,v 1.5 1999/09/08 21:17:50 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: extern.c,v 1.4 1997/10/11 01:16:27 lukem Exp $");
+__RCSID("$NetBSD: extern.c,v 1.5 1999/09/08 21:17:50 jsm Exp $");
#endif
#endif /* not lint */
@@ -46,7 +46,8 @@ __RCSID("$NetBSD: extern.c,v 1.4 1997/10/11 01:16:27 lukem Exp $");
bool Guessed[26];
-char Word[BUFSIZ], Known[BUFSIZ], *Noose_pict[] = {
+char Word[BUFSIZ], Known[BUFSIZ];
+const char *const Noose_pict[] = {
" ______",
" | |",
" |",
@@ -63,7 +64,7 @@ int Errors, Wordnum = 0;
double Average = 0.0;
-ERR_POS Err_pos[MAXERRS] = {
+const ERR_POS Err_pos[MAXERRS] = {
{2, 10, 'O'},
{3, 10, '|'},
{4, 10, '|'},
diff --git a/hangman/hangman.h b/hangman/hangman.h
index 10ade2a9..e9aa4f57 100644
--- a/hangman/hangman.h
+++ b/hangman/hangman.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hangman.h,v 1.7 1998/09/11 13:42:03 hubertf Exp $ */
+/* $NetBSD: hangman.h,v 1.8 1999/09/08 21:17:50 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -69,13 +69,14 @@ typedef struct {
extern bool Guessed[];
-extern char Word[], Known[], *Noose_pict[];
+extern char Word[], Known[];
+extern const char *const Noose_pict[];
extern int Errors, Wordnum;
extern double Average;
-extern ERR_POS Err_pos[];
+extern const ERR_POS Err_pos[];
extern FILE *Dict;
diff --git a/hangman/setup.c b/hangman/setup.c
index a0f003b2..4ba9f7df 100644
--- a/hangman/setup.c
+++ b/hangman/setup.c
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.5 1997/10/11 08:01:06 lukem Exp $ */
+/* $NetBSD: setup.c,v 1.6 1999/09/08 21:17:50 jsm Exp $ */
/*-
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: setup.c,v 1.5 1997/10/11 08:01:06 lukem Exp $");
+__RCSID("$NetBSD: setup.c,v 1.6 1999/09/08 21:17:50 jsm Exp $");
#endif
#endif /* not lint */
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: setup.c,v 1.5 1997/10/11 08:01:06 lukem Exp $");
void
setup()
{
- char **sp;
+ const char *const *sp;
static struct stat sbuf;
noecho();
diff --git a/mille/comp.c b/mille/comp.c
index 6ca5ad76..02be40f7 100644
--- a/mille/comp.c
+++ b/mille/comp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: comp.c,v 1.5 1997/10/12 00:53:45 lukem Exp $ */
+/* $NetBSD: comp.c,v 1.6 1999/09/08 21:17:50 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: comp.c,v 1.5 1997/10/12 00:53:45 lukem Exp $");
+__RCSID("$NetBSD: comp.c,v 1.6 1999/09/08 21:17:50 jsm Exp $");
#endif
#endif /* not lint */
@@ -408,7 +408,7 @@ play_it:
*/
int
onecard(pp)
- PLAY *pp;
+ const PLAY *pp;
{
CARD bat, spd, card;
@@ -441,7 +441,7 @@ onecard(pp)
int
canplay(pp, op, card)
- PLAY *pp, *op;
+ const PLAY *pp, *op;
CARD card;
{
switch (card) {
diff --git a/mille/extern.c b/mille/extern.c
index 64ae3e6b..81039ff0 100644
--- a/mille/extern.c
+++ b/mille/extern.c
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.c,v 1.5 1997/10/12 00:53:55 lukem Exp $ */
+/* $NetBSD: extern.c,v 1.6 1999/09/08 21:17:50 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: extern.c,v 1.5 1997/10/12 00:53:55 lukem Exp $");
+__RCSID("$NetBSD: extern.c,v 1.6 1999/09/08 21:17:50 jsm Exp $");
#endif
#endif /* not lint */
@@ -55,10 +55,10 @@ bool Debug, /* set if debugging code on */
Order, /* set if hand should be sorted */
Saved; /* set if game just saved */
-char *C_fmt = "%-18.18s", /* format for printing cards */
+char Initstr[100]; /* initial string for error field */
+const char *C_fmt = "%-18.18s", /* format for printing cards */
*Fromfile = NULL, /* startup file for game */
- Initstr[100], /* initial string for error field */
- *_cn[NUM_CARDS] = { /* Card name buffer */
+ *const _cn[NUM_CARDS] = { /* Card name buffer */
"",
"25",
"50",
@@ -80,7 +80,7 @@ char *C_fmt = "%-18.18s", /* format for printing cards */
"Driving Ace",
"Right of Way"
},
- **C_name = &_cn[1]; /* Card names */
+ *const *C_name = &_cn[1]; /* Card names */
int Card_no, /* Card number for current move */
End, /* End value for current hand */
@@ -89,8 +89,8 @@ int Card_no, /* Card number for current move */
Play, /* Current player */
Numgos, /* Number of Go cards used by computer */
Window = W_SMALL, /* Current window wanted */
- Numseen[NUM_CARDS], /* Number of cards seen in current hand */
- Value[NUM_MILES] = { /* Value of mileage cards */
+ Numseen[NUM_CARDS]; /* Number of cards seen in current hand */
+const int Value[NUM_MILES] = { /* Value of mileage cards */
25, 50, 75, 100, 200
},
Numcards[NUM_CARDS] = { /* Number of cards in deck */
@@ -114,8 +114,8 @@ int Card_no, /* Card number for current move */
1, /* C_DRIVE_SAFE */
1, /* C_RIGHT_WAY */
0 /* C_INIT */
- },
- Numneed[NUM_CARDS] = { /* number of cards needed per hand */
+ };
+int Numneed[NUM_CARDS] = { /* number of cards needed per hand */
0, /* C_25 */
0, /* C_50 */
0, /* C_75 */
@@ -140,13 +140,13 @@ int Card_no, /* Card number for current move */
CARD Discard, /* Top of discard pile */
Sh_discard, /* Last discard card shown */
- *Topcard, /* Pointer to next card to be picked */
- Opposite[NUM_CARDS] = { /* Opposites of each card */
+ *Topcard; /* Pointer to next card to be picked */
+const CARD Opposite[NUM_CARDS] = { /* Opposites of each card */
C_25, C_50, C_75, C_100, C_200, C_GAS, C_SPARE,
C_REPAIRS, C_GO, C_END_LIMIT, C_EMPTY, C_FLAT, C_CRASH,
C_STOP, C_LIMIT, C_EMPTY, C_FLAT, C_CRASH, C_STOP, C_INIT
- },
- Deck[DECK_SZ] = { /* Current deck */
+ };
+CARD Deck[DECK_SZ] = { /* Current deck */
C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25,
C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50,
C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75,
diff --git a/mille/mille.h b/mille/mille.h
index 416e9f0d..c110c6b2 100644
--- a/mille/mille.h
+++ b/mille/mille.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mille.h,v 1.9 1998/09/13 15:27:29 hubertf Exp $ */
+/* $NetBSD: mille.h,v 1.10 1999/09/08 21:17:50 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -207,13 +207,15 @@ typedef struct {
extern bool Debug, Finished, Next, On_exit, Order, Saved;
-extern char *C_fmt, **C_name, *Fromfile, Initstr[];
+extern char Initstr[];
+extern const char *C_fmt, *const *C_name, *Fromfile;
-extern int Card_no, End, Handstart, Movetype, Numcards[], Numgos,
- Numneed[], Numseen[NUM_CARDS], Play, Value[], Window;
+extern int Card_no, End, Handstart, Movetype, Numgos,
+ Numneed[], Numseen[NUM_CARDS], Play, Window;
+extern const int Numcards[], Value[];
-extern CARD Deck[DECK_SZ], Discard, Opposite[NUM_CARDS], Sh_discard,
- *Topcard;
+extern CARD Deck[DECK_SZ], Discard, Sh_discard, *Topcard;
+extern const CARD Opposite[NUM_CARDS];
extern FILE *outf;
@@ -227,7 +229,7 @@ extern WINDOW *Board, *Miles, *Score;
void account __P((CARD));
void calcmove __P((void));
-int canplay __P((PLAY *, PLAY *, CARD));
+int canplay __P((const PLAY *, const PLAY *, CARD));
int check_ext __P((bool));
void check_go __P((void));
void check_more __P((void));
@@ -239,19 +241,19 @@ void finalscore __P((PLAY *));
CARD getcard __P((void));
void getmove __P((void));
int getyn __P((int));
-int haspicked __P((PLAY *));
+int haspicked __P((const PLAY *));
void init __P((void));
int isrepair __P((CARD));
int main __P((int, char **));
void newboard __P((void));
void newscore __P((void));
-int onecard __P((PLAY *));
+int onecard __P((const PLAY *));
int playcard __P((PLAY *));
void prboard __P((void));
void prompt __P((int));
-void prscore __P((int));
+void prscore __P((bool));
int readch __P((void));
-bool rest_f __P((char *));
+bool rest_f __P((const char *));
int roll __P((int, int));
void rub __P((int));
int safety __P((CARD));
diff --git a/mille/move.c b/mille/move.c
index 38d82846..afc3acb6 100644
--- a/mille/move.c
+++ b/mille/move.c
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.9 1999/09/08 20:43:48 jsm Exp $ */
+/* $NetBSD: move.c,v 1.10 1999/09/08 21:17:51 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: move.c,v 1.9 1999/09/08 20:43:48 jsm Exp $");
+__RCSID("$NetBSD: move.c,v 1.10 1999/09/08 21:17:51 jsm Exp $");
#endif
#endif /* not lint */
@@ -475,7 +475,7 @@ ret:
*/
int
haspicked(pp)
- PLAY *pp;
+ const PLAY *pp;
{
int card;
@@ -523,7 +523,7 @@ void
prompt(promptno)
int promptno;
{
- static char *names[] = {
+ static const char *const names[] = {
">>:Move:",
"Really?",
"Another hand?",
diff --git a/mille/print.c b/mille/print.c
index dee19d4a..042b8162 100644
--- a/mille/print.c
+++ b/mille/print.c
@@ -1,4 +1,4 @@
-/* $NetBSD: print.c,v 1.6 1997/10/12 00:54:24 lukem Exp $ */
+/* $NetBSD: print.c,v 1.7 1999/09/08 21:17:51 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: print.c,v 1.6 1997/10/12 00:54:24 lukem Exp $");
+__RCSID("$NetBSD: print.c,v 1.7 1999/09/08 21:17:51 jsm Exp $");
#endif
#endif /* not lint */
@@ -70,7 +70,7 @@ prboard()
show_card(14, temp, pp->battle, &pp->sh_battle);
show_card(16, temp, pp->speed, &pp->sh_speed);
for (i = C_25; i <= C_200; i++) {
- char *name;
+ const char *name;
int end;
if (pp->nummiles[i] == pp->sh_nummiles[i])
diff --git a/mille/save.c b/mille/save.c
index 3715f7b0..3d9d17c2 100644
--- a/mille/save.c
+++ b/mille/save.c
@@ -1,4 +1,4 @@
-/* $NetBSD: save.c,v 1.7 1999/03/29 05:12:39 mrg Exp $ */
+/* $NetBSD: save.c,v 1.8 1999/09/08 21:17:51 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.7 1999/03/29 05:12:39 mrg Exp $");
+__RCSID("$NetBSD: save.c,v 1.8 1999/09/08 21:17:51 jsm Exp $");
#endif
#endif /* not lint */
@@ -144,7 +144,7 @@ over:
*/
bool
rest_f(file)
- char *file;
+ const char *file;
{
char *sp;
diff --git a/monop/cards.c b/monop/cards.c
index fc7bde48..489f25ee 100644
--- a/monop/cards.c
+++ b/monop/cards.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cards.c,v 1.7 1999/08/21 10:40:03 simonb Exp $ */
+/* $NetBSD: cards.c,v 1.8 1999/09/08 21:17:51 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cards.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
+__RCSID("$NetBSD: cards.c,v 1.8 1999/09/08 21:17:51 jsm Exp $");
#endif
#endif /* not lint */
@@ -54,9 +54,9 @@ __RCSID("$NetBSD: cards.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
#define GOJF 'F' /* char for get-out-of-jail-free cards */
#ifndef DEV
-static char *cardfile = _PATH_CARDS;
+static const char *cardfile = _PATH_CARDS;
#else
-static char *cardfile = "cards.pck";
+static const char *cardfile = "cards.pck";
#endif
static FILE *deckf;
diff --git a/monop/execute.c b/monop/execute.c
index 505bbc4e..42f23797 100644
--- a/monop/execute.c
+++ b/monop/execute.c
@@ -1,4 +1,4 @@
-/* $NetBSD: execute.c,v 1.6 1999/08/21 10:40:03 simonb Exp $ */
+/* $NetBSD: execute.c,v 1.7 1999/09/08 21:17:51 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)execute.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: execute.c,v 1.6 1999/08/21 10:40:03 simonb Exp $");
+__RCSID("$NetBSD: execute.c,v 1.7 1999/09/08 21:17:51 jsm Exp $");
#endif
#endif /* not lint */
@@ -240,7 +240,7 @@ restore()
*/
int
rest_f(file)
- char *file;
+ const char *file;
{
char *sp;
int inf, num;
diff --git a/monop/getinp.c b/monop/getinp.c
index 84d4548c..8976ba2f 100644
--- a/monop/getinp.c
+++ b/monop/getinp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getinp.c,v 1.7 1999/08/21 10:40:03 simonb Exp $ */
+/* $NetBSD: getinp.c,v 1.8 1999/09/08 21:17:51 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: getinp.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
+__RCSID("$NetBSD: getinp.c,v 1.8 1999/09/08 21:17:51 jsm Exp $");
#endif
#endif /* not lint */
@@ -51,11 +51,11 @@ __RCSID("$NetBSD: getinp.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
static char buf[257];
-static int comp __P((char *));
+static int comp __P((const char *));
int
getinp(prompt, list)
- char *prompt, *list[];
+ const char *prompt, *const list[];
{
int i, n_match, match = 0;
char *sp;
@@ -112,9 +112,10 @@ inter:
static int
comp(s1)
- char *s1;
+ const char *s1;
{
- char *sp, *tsp, c;
+ const char *sp, *tsp;
+ char c;
if (buf[0] != '\0')
for (sp = buf, tsp = s1; *sp; ) {
diff --git a/monop/houses.c b/monop/houses.c
index 79a9703d..27dacc72 100644
--- a/monop/houses.c
+++ b/monop/houses.c
@@ -1,4 +1,4 @@
-/* $NetBSD: houses.c,v 1.5 1999/08/21 10:40:03 simonb Exp $ */
+/* $NetBSD: houses.c,v 1.6 1999/09/08 21:17:51 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,14 +38,14 @@
#if 0
static char sccsid[] = "@(#)houses.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: houses.c,v 1.5 1999/08/21 10:40:03 simonb Exp $");
+__RCSID("$NetBSD: houses.c,v 1.6 1999/09/08 21:17:51 jsm Exp $");
#endif
#endif /* not lint */
#include "monop.ext"
-static char *names[N_MON+2],
- cur_prop[80];
+static const char *names[N_MON+2];
+static char cur_prop[80];
static MON *monops[N_MON];
diff --git a/monop/initdeck.c b/monop/initdeck.c
index 9474f43d..99b2fb2a 100644
--- a/monop/initdeck.c
+++ b/monop/initdeck.c
@@ -1,4 +1,4 @@
-/* $NetBSD: initdeck.c,v 1.7 1999/08/21 10:40:03 simonb Exp $ */
+/* $NetBSD: initdeck.c,v 1.8 1999/09/08 21:17:52 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)initdeck.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: initdeck.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
+__RCSID("$NetBSD: initdeck.c,v 1.8 1999/09/08 21:17:52 jsm Exp $");
#endif
#endif /* not lint */
@@ -69,8 +69,8 @@ __RCSID("$NetBSD: initdeck.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
#define bool char
-char *infile = "cards.inp", /* input file */
- *outfile = "cards.pck"; /* "packed" file */
+const char *infile = "cards.inp", /* input file */
+ *outfile = "cards.pck"; /* "packed" file */
DECK deck[2];
diff --git a/monop/misc.c b/monop/misc.c
index f659cac1..14fb4ca7 100644
--- a/monop/misc.c
+++ b/monop/misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.7 1999/08/21 10:40:03 simonb Exp $ */
+/* $NetBSD: misc.c,v 1.8 1999/09/08 21:17:52 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: misc.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
+__RCSID("$NetBSD: misc.c,v 1.8 1999/09/08 21:17:52 jsm Exp $");
#endif
#endif /* not lint */
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: misc.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
*/
int
getyn(prompt)
- char *prompt;
+ const char *prompt;
{
int com;
@@ -96,7 +96,7 @@ next_play()
*/
int
get_int(prompt)
- char *prompt;
+ const char *prompt;
{
int num;
char *sp;
diff --git a/monop/monop.def b/monop/monop.def
index 08700bb2..4bca6372 100644
--- a/monop/monop.def
+++ b/monop/monop.def
@@ -1,4 +1,4 @@
-/* $NetBSD: monop.def,v 1.5 1999/08/21 10:40:04 simonb Exp $ */
+/* $NetBSD: monop.def,v 1.6 1999/09/08 21:17:52 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -43,8 +43,8 @@ bool fixing, /* set if fixing up debt */
told_em, /* set if told user he's out of debt */
spec; /* set if moving by card to RR or UTIL */
-char *name_list[MAX_PL+2], /* list of players' names */
- *comlist[] = { /* list of normal commands */
+const char *name_list[MAX_PL+2], /* list of players' names */
+ *const comlist[] = { /* list of normal commands */
"quit", /* 0 */ "print", /* 1 */
"where", /* 2 */ "own holdings", /* 3 */
"holdings", /* 4 */ "mortgage", /* 5 */
@@ -56,14 +56,14 @@ char *name_list[MAX_PL+2], /* list of players' names */
"", /* 16 */
0
},
- *yn[] = { /* list of commands for yes/no answers */
+ *const yn[] = { /* list of commands for yes/no answers */
"yes", /* 0 */ "no", /* 1 */
"quit", /* 2 */ "print", /* 3 */
"where", /* 4 */ "own holdings", /* 5 */
"holdings", /* 6 */
0
},
- *lucky_mes[] = { /* "got lucky" messages */
+ *const lucky_mes[] = { /* "got lucky" messages */
"You lucky stiff", "You got lucky",
"What a lucky person!", "You must have a 4-leaf clover",
"My, my! Aren't we lucky!", "Luck smiles upon you",
@@ -80,7 +80,7 @@ int player, /* current player number */
num_luck = sizeof lucky_mes / sizeof (char *);
/* list of command functions */
-void (*func[]) __P((void)) = { /* array of function calls for commands */
+void (*const func[]) __P((void)) = { /* array of function calls for commands */
quit, /* quit game |* 0 *| */
printboard, /* print board |* 1 *| */
where, /* where players are |* 2 *| */
diff --git a/monop/monop.ext b/monop/monop.ext
index a83fee42..5903f3d9 100644
--- a/monop/monop.ext
+++ b/monop/monop.ext
@@ -1,4 +1,4 @@
-/* $NetBSD: monop.ext,v 1.3 1997/10/12 17:45:19 christos Exp $ */
+/* $NetBSD: monop.ext,v 1.4 1999/09/08 21:17:52 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -40,11 +40,11 @@
extern bool trading, spec, fixing, told_em;
-extern char *yn[], *comlist[], *name_list[], *lucky_mes[];
+extern const char *const yn[], *const comlist[], *name_list[], *const lucky_mes[];
extern int num_play, player, num_doub, num_luck;
-extern void (*func[]) __P((void));
+extern void (*const func[]) __P((void));
extern DECK deck[2];
diff --git a/monop/monop.h b/monop/monop.h
index 4618cefa..98db7e02 100644
--- a/monop/monop.h
+++ b/monop/monop.h
@@ -1,4 +1,4 @@
-/* $NetBSD: monop.h,v 1.7 1999/08/21 10:40:04 simonb Exp $ */
+/* $NetBSD: monop.h,v 1.8 1999/09/08 21:17:52 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -76,7 +76,7 @@
}
struct sqr_st { /* structure for square */
- char *name; /* place name */
+ const char *name; /* place name */
short owner; /* owner number */
short type; /* place type */
struct prp_st *desc; /* description struct */
@@ -86,13 +86,13 @@ struct sqr_st { /* structure for square */
typedef struct sqr_st SQUARE;
struct mon_st { /* monopoly description structure */
- char *name; /* monop. name (color) */
+ const char *name; /* monop. name (color) */
short owner; /* owner of monopoly */
short num_in; /* # in monopoly */
short num_own; /* # owned (-1: not poss. monop)*/
short h_cost; /* price of houses */
- char *not_m; /* name if not monopoly */
- char *mon_n; /* name if a monopoly */
+ const char *not_m; /* name if not monopoly */
+ const char *mon_n; /* name if a monopoly */
unsigned char sqnums[3]; /* Square numbers (used to init)*/
SQUARE *sq[3]; /* list of squares in monop */
};
@@ -146,10 +146,10 @@ void do_move __P((void));
void move __P((int));
void save __P((void));
void restore __P((void));
-int rest_f __P((char *));
+int rest_f __P((const char *));
/* getinp.c */
-int getinp __P((char *, char *[]));
+int getinp __P((const char *, const char *const []));
/* houses.c */
void buy_houses __P((void));
@@ -163,10 +163,10 @@ int move_jail __P((int, int ));
void printturn __P((void));
/* misc.c */
-int getyn __P((char *));
+int getyn __P((const char *));
void notify __P((void));
void next_play __P((void));
-int get_int __P((char *));
+int get_int __P((const char *));
void set_ownlist __P((int));
void is_monop __P((MON *, int));
void isnot_monop __P((MON *));
diff --git a/monop/morg.c b/monop/morg.c
index 80860f63..2c74f917 100644
--- a/monop/morg.c
+++ b/monop/morg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: morg.c,v 1.7 1999/08/21 10:40:04 simonb Exp $ */
+/* $NetBSD: morg.c,v 1.8 1999/09/08 21:17:52 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)morg.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: morg.c,v 1.7 1999/08/21 10:40:04 simonb Exp $");
+__RCSID("$NetBSD: morg.c,v 1.8 1999/09/08 21:17:52 jsm Exp $");
#endif
#endif /* not lint */
@@ -48,8 +48,8 @@ __RCSID("$NetBSD: morg.c,v 1.7 1999/08/21 10:40:04 simonb Exp $");
* These routines deal with mortgaging.
*/
-static char *names[MAX_PRP+2],
- *morg_coms[] = {
+static const char *names[MAX_PRP+2],
+ *const morg_coms[] = {
"quit", /* 0 */
"print", /* 1 */
"where", /* 2 */
diff --git a/monop/print.c b/monop/print.c
index a55434f1..5f0dcd22 100644
--- a/monop/print.c
+++ b/monop/print.c
@@ -1,4 +1,4 @@
-/* $NetBSD: print.c,v 1.5 1999/08/21 10:40:04 simonb Exp $ */
+/* $NetBSD: print.c,v 1.6 1999/09/08 21:17:52 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,15 +38,15 @@
#if 0
static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: print.c,v 1.5 1999/08/21 10:40:04 simonb Exp $");
+__RCSID("$NetBSD: print.c,v 1.6 1999/09/08 21:17:52 jsm Exp $");
#endif
#endif /* not lint */
#include "monop.ext"
-static char *header = "Name Own Price Mg # Rent";
+static const char *header = "Name Own Price Mg # Rent";
-static void printmorg __P((SQUARE *));
+static void printmorg __P((const SQUARE *));
/*
* This routine prints out the current board
@@ -168,7 +168,7 @@ printsq(sqn, eoln)
*/
static void
printmorg(sqp)
- SQUARE *sqp;
+ const SQUARE *sqp;
{
if (sqp->desc->morg)
printf(" * ");
diff --git a/monop/spec.c b/monop/spec.c
index 37d04271..702faaa4 100644
--- a/monop/spec.c
+++ b/monop/spec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: spec.c,v 1.5 1999/08/21 10:40:04 simonb Exp $ */
+/* $NetBSD: spec.c,v 1.6 1999/09/08 21:17:52 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,13 +38,13 @@
#if 0
static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: spec.c,v 1.5 1999/08/21 10:40:04 simonb Exp $");
+__RCSID("$NetBSD: spec.c,v 1.6 1999/09/08 21:17:52 jsm Exp $");
#endif
#endif /* not lint */
#include "monop.ext"
-static char *perc[] = {
+static const char *const perc[] = {
"10%", "ten percent", "%", "$200", "200", 0
};
diff --git a/monop/trade.c b/monop/trade.c
index 322d880b..9a9056e4 100644
--- a/monop/trade.c
+++ b/monop/trade.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trade.c,v 1.5 1999/08/21 10:40:04 simonb Exp $ */
+/* $NetBSD: trade.c,v 1.6 1999/09/08 21:17:52 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)trade.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: trade.c,v 1.5 1999/08/21 10:40:04 simonb Exp $");
+__RCSID("$NetBSD: trade.c,v 1.6 1999/09/08 21:17:52 jsm Exp $");
#endif
#endif /* not lint */
@@ -53,7 +53,7 @@ struct trd_st { /* how much to give to other player */
typedef struct trd_st TRADE;
-static char *plist[MAX_PRP+2];
+static const char *plist[MAX_PRP+2];
static int used[MAX_PRP];
diff --git a/morse/morse.c b/morse/morse.c
index c3f2b136..d9086e8e 100644
--- a/morse/morse.c
+++ b/morse/morse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: morse.c,v 1.6 1998/11/18 14:22:32 hubertf Exp $ */
+/* $NetBSD: morse.c,v 1.7 1999/09/08 21:17:53 jsm Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
#if 0
static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: morse.c,v 1.6 1998/11/18 14:22:32 hubertf Exp $");
+__RCSID("$NetBSD: morse.c,v 1.7 1999/09/08 21:17:53 jsm Exp $");
#endif
#endif /* not lint */
@@ -56,8 +56,8 @@ __RCSID("$NetBSD: morse.c,v 1.6 1998/11/18 14:22:32 hubertf Exp $");
#define MORSE_PERIOD ".-.-.-"
-static char
- *digit[] = {
+static const char
+ *const digit[] = {
"-----",
".----",
"..---",
@@ -69,7 +69,7 @@ static char
"---..",
"----.",
},
- *alph[] = {
+ *const alph[] = {
".-",
"-...",
"-.-.",
@@ -101,7 +101,7 @@ static char
int main __P((int, char *[]));
void morse __P((int));
void decode __P((const char *));
-void show __P((char *));
+void show __P((const char *));
static int sflag;
static int dflag;
@@ -188,7 +188,7 @@ decode(s)
putchar('.');
} else {
int found;
- char **a;
+ const char *const *a;
int size;
int i;
@@ -242,7 +242,7 @@ morse(c)
void
show(s)
- char *s;
+ const char *s;
{
if (sflag)
printf(" %s", s);
diff --git a/number/number.c b/number/number.c
index e3727344..97112544 100644
--- a/number/number.c
+++ b/number/number.c
@@ -1,4 +1,4 @@
-/* $NetBSD: number.c,v 1.6 1998/09/13 15:24:57 hubertf Exp $ */
+/* $NetBSD: number.c,v 1.7 1999/09/08 21:17:53 jsm Exp $ */
/*
* Copyright (c) 1988, 1993, 1994
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: number.c,v 1.6 1998/09/13 15:24:57 hubertf Exp $");
+__RCSID("$NetBSD: number.c,v 1.7 1999/09/08 21:17:53 jsm Exp $");
#endif
#endif /* not lint */
@@ -58,19 +58,19 @@ __RCSID("$NetBSD: number.c,v 1.6 1998/09/13 15:24:57 hubertf Exp $");
#define MAXNUM 65 /* Biggest number we handle. */
-static char *name1[] = {
+static const char *const name1[] = {
"", "one", "two", "three",
"four", "five", "six", "seven",
"eight", "nine", "ten", "eleven",
"twelve", "thirteen", "fourteen", "fifteen",
"sixteen", "seventeen", "eighteen", "nineteen",
},
- *name2[] = {
+ *const name2[] = {
"", "ten", "twenty", "thirty",
"forty", "fifty", "sixty", "seventy",
"eighty", "ninety",
},
- *name3[] = {
+ *const name3[] = {
"hundred", "thousand", "million", "billion",
"trillion", "quadrillion", "quintillion", "sextillion",
"septillion", "octillion", "nonillion", "decillion",
@@ -82,10 +82,9 @@ static char *name1[] = {
void convert __P((char *));
int main __P((int, char *[]));
-int number __P((char *, int));
+int number __P((const char *, int));
void pfract __P((int));
-void toobig __P((void));
-int unit __P((int, char *));
+int unit __P((int, const char *));
void usage __P((void)) __attribute__((__noreturn__));
int lflag;
@@ -201,7 +200,7 @@ badnum: errx(1, "illegal number: %s", line);
int
unit(len, p)
int len;
- char *p;
+ const char *p;
{
int off, rval;
@@ -236,7 +235,7 @@ unit(len, p)
int
number(p, len)
- char *p;
+ const char *p;
int len;
{
int val, rval;
@@ -278,7 +277,7 @@ void
pfract(len)
int len;
{
- static char *pref[] = { "", "ten-", "hundred-" };
+ static const char *const pref[] = { "", "ten-", "hundred-" };
switch(len) {
case 1:
diff --git a/phantasia/gamesupport.c b/phantasia/gamesupport.c
index b0ce0d8f..dbb3f0fd 100644
--- a/phantasia/gamesupport.c
+++ b/phantasia/gamesupport.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gamesupport.c,v 1.4 1997/10/13 02:18:16 lukem Exp $ */
+/* $NetBSD: gamesupport.c,v 1.5 1999/09/08 21:17:53 jsm Exp $ */
/*
* gamesupport.c - auxiliary routines for support of Phantasia
@@ -13,7 +13,7 @@ changestats(ingameflag)
static char flag[2] = /* for printing values of bools */
{'F', 'T'};
struct player *playerp; /* pointer to structure to alter */
- char *prompt; /* pointer to prompt string */
+ const char *prompt; /* pointer to prompt string */
int c; /* input */
int today; /* day of year of today */
int temp; /* temporary variable */
diff --git a/phantasia/interplayer.c b/phantasia/interplayer.c
index 8399f914..2344e0e9 100644
--- a/phantasia/interplayer.c
+++ b/phantasia/interplayer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: interplayer.c,v 1.3 1997/10/13 02:18:22 lukem Exp $ */
+/* $NetBSD: interplayer.c,v 1.4 1999/09/08 21:17:53 jsm Exp $ */
/*
* interplayer.c - player to player routines for Phantasia
@@ -656,7 +656,7 @@ void
dotampered()
{
short tamper; /* value for tampering with other players */
- char *option; /* pointer to option description */
+ const char *option; /* pointer to option description */
double temp1 = 0.0, temp2 = 0.0; /* other tampering values */
int ch; /* input */
long loc; /* location in energy void file */
diff --git a/phantasia/io.c b/phantasia/io.c
index 40fd952f..989a67db 100644
--- a/phantasia/io.c
+++ b/phantasia/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.3 1997/10/13 02:18:25 lukem Exp $ */
+/* $NetBSD: io.c,v 1.4 1999/09/08 21:17:54 jsm Exp $ */
/*
* io.c - input/output routines for Phantasia
@@ -153,7 +153,7 @@ interrupt()
int
getanswer(choices, def)
- char *choices;
+ const char *choices;
bool def;
{
int ch; /* input */
diff --git a/phantasia/main.c b/phantasia/main.c
index 11cee82f..efa49e05 100644
--- a/phantasia/main.c
+++ b/phantasia/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.6 1999/08/18 01:39:16 hubertf Exp $ */
+/* $NetBSD: main.c,v 1.7 1999/09/08 21:17:54 jsm Exp $ */
/*
* Phantasia 3.3.2 -- Interterminal fantasy game
@@ -873,7 +873,7 @@ genchar(type)
int type;
{
int subscript; /* used for subscripting into Stattable */
- struct charstats *statptr; /* for pointing into Stattable */
+ const struct charstats *statptr; /* for pointing into Stattable */
subscript = type - '1';
diff --git a/phantasia/misc.c b/phantasia/misc.c
index 4b5dc0f4..89cd940b 100644
--- a/phantasia/misc.c
+++ b/phantasia/misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.4 1998/08/30 09:19:39 veego Exp $ */
+/* $NetBSD: misc.c,v 1.5 1999/09/08 21:17:54 jsm Exp $ */
/*
* misc.c Phantasia miscellaneous support routines
@@ -10,7 +10,7 @@
void
movelevel()
{
- struct charstats *statptr; /* for pointing into Stattable */
+ const struct charstats *statptr; /* for pointing into Stattable */
double new; /* new level */
double inc; /* increment between new and old levels */
@@ -60,15 +60,15 @@ movelevel()
death("Old age");
}
-char *
+const char *
descrlocation(playerp, shortflag)
struct player *playerp;
bool shortflag;
{
double circle; /* corresponding circle for coordinates */
int quadrant; /* quandrant of grid */
- char *label; /* pointer to place name */
- static char *nametable[4][4] = /* names of places */
+ const char *label; /* pointer to place name */
+ static const char *const nametable[4][4] = /* names of places */
{
{"Anorien", "Ithilien", "Rohan", "Lorien"},
{"Gondor", "Mordor", "Dunland", "Rovanion"},
@@ -412,7 +412,7 @@ displaystats()
void
allstatslist()
{
- static char *flags[] = /* to print value of some bools */
+ static const char *const flags[] = /* to print value of some bools */
{
"False",
" True"
@@ -442,13 +442,13 @@ allstatslist()
flags[(int)Player.p_palantir]);
}
-char *
+const char *
descrtype(playerp, shortflag)
struct player *playerp;
bool shortflag;
{
int type; /* for caluculating result subscript */
- static char *results[] =/* description table */
+ static const char *const results[] =/* description table */
{
" Magic User", " MU",
" Fighter", " F ",
@@ -508,7 +508,7 @@ descrtype(playerp, shortflag)
long
findname(name, playerp)
- char *name;
+ const char *name;
struct player *playerp;
{
long loc = 0; /* location in the file */
@@ -576,11 +576,11 @@ leavegame()
void
death(how)
- char *how;
+ const char *how;
{
FILE *fp; /* for updating various files */
int ch; /* input */
- static char *deathmesg[] =
+ static const char *const deathmesg[] =
/* add more messages here, if desired */
{
"You have been wounded beyond repair. ",
@@ -935,7 +935,7 @@ readmessage()
void
error(whichfile)
- char *whichfile;
+ const char *whichfile;
{
int (*funcp) __P((const char *,...));
@@ -973,7 +973,7 @@ ill_sig(whichsig)
/* NOTREACHED */
}
-char *
+const char *
descrstatus(playerp)
struct player *playerp;
{
diff --git a/phantasia/phantglobs.c b/phantasia/phantglobs.c
index 399de146..58769881 100644
--- a/phantasia/phantglobs.c
+++ b/phantasia/phantglobs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: phantglobs.c,v 1.4 1998/07/27 01:12:35 mycroft Exp $ */
+/* $NetBSD: phantglobs.c,v 1.5 1999/09/08 21:17:54 jsm Exp $ */
/*
* phantglobs.c - globals for Phantasia
@@ -30,7 +30,7 @@ jmp_buf Timeoenv; /* used for timing out waiting for input */
long Fileloc; /* location in file of player statistics */
const char *Login; /* pointer to login of player */
-char *Enemyname; /* pointer name of monster/player we are battling*/
+const char *Enemyname; /* pointer name of monster/player we are battling*/
struct player Player; /* stats for player */
struct player Other; /* stats for another player */
@@ -39,10 +39,10 @@ struct monster Curmonster;/* stats for current monster */
struct energyvoid Enrgyvoid;/* energy void buffer */
-struct charstats *Statptr;/* pointer into Stattable[] */
+const struct charstats *Statptr;/* pointer into Stattable[] */
/* lookup table for character type dependent statistics */
-struct charstats Stattable[7] = {
+const struct charstats Stattable[7] = {
/* MAGIC USER */
{
15.0, 200.0, 18.0, 175.0, 10,
@@ -92,7 +92,7 @@ struct charstats Stattable[7] = {
};
/* menu of items for purchase */
-struct menuitem Menu[] = {
+const struct menuitem Menu[] = {
{"Mana", 1},
{"Shield", 5},
{"Book", 200},
@@ -110,9 +110,9 @@ FILE *Energyvoidfp; /* pointer to open energy void file */
char Databuf[SZ_DATABUF]; /* a place to read data into */
/* some canned strings for messages */
-char Illcmd[] = "Illegal command.\n";
-char Illmove[] = "Too far.\n";
-char Illspell[] = "Illegal spell.\n";
-char Nomana[] = "Not enought mana for that spell.\n";
-char Somebetter[] = "But you already have something better.\n";
-char Nobetter[] = "That's no better than what you already have.\n";
+const char Illcmd[] = "Illegal command.\n";
+const char Illmove[] = "Too far.\n";
+const char Illspell[] = "Illegal spell.\n";
+const char Nomana[] = "Not enought mana for that spell.\n";
+const char Somebetter[] = "But you already have something better.\n";
+const char Nobetter[] = "That's no better than what you already have.\n";
diff --git a/phantasia/phantglobs.h b/phantasia/phantglobs.h
index 00077e55..008ae1de 100644
--- a/phantasia/phantglobs.h
+++ b/phantasia/phantglobs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: phantglobs.h,v 1.5 1998/07/27 01:12:35 mycroft Exp $ */
+/* $NetBSD: phantglobs.h,v 1.6 1999/09/08 21:17:54 jsm Exp $ */
/*
* phantglobs.h - global declarations for Phantasia
@@ -28,7 +28,7 @@ extern jmp_buf Timeoenv; /* used for timing out waiting for input */
extern long Fileloc; /* location in file of player statistics */
extern const char *Login; /* pointer to login of current player */
-extern char *Enemyname; /* pointer name of monster/player we are battling*/
+extern const char *Enemyname; /* pointer name of monster/player we are battling*/
extern struct player Player; /* stats for player */
extern struct player Other; /* stats for another player */
@@ -37,11 +37,11 @@ extern struct monster Curmonster;/* stats for current monster */
extern struct energyvoid Enrgyvoid;/* energy void buffer */
-extern struct charstats Stattable[];/* used for rolling and changing player stats*/
+extern const struct charstats Stattable[];/* used for rolling and changing player stats*/
-extern struct charstats *Statptr;/* pointer into Stattable[] */
+extern const struct charstats *Statptr;/* pointer into Stattable[] */
-extern struct menuitem Menu[]; /* menu of items for purchase */
+extern const struct menuitem Menu[]; /* menu of items for purchase */
extern FILE *Playersfp; /* pointer to open player file */
extern FILE *Monstfp; /* pointer to open monster file */
@@ -51,18 +51,18 @@ extern FILE *Energyvoidfp; /* pointer to open energy void file */
extern char Databuf[]; /* a place to read data into */
/* some canned strings for messages */
-extern char Illcmd[];
-extern char Illmove[];
-extern char Illspell[];
-extern char Nomana[];
-extern char Somebetter[];
-extern char Nobetter[];
+extern const char Illcmd[];
+extern const char Illmove[];
+extern const char Illspell[];
+extern const char Nomana[];
+extern const char Somebetter[];
+extern const char Nobetter[];
/* functions which we need to know about */
-char *descrlocation __P((struct player *, bool));
-char *descrstatus __P((struct player *));
-char *descrtype __P((struct player *, bool));
+const char *descrlocation __P((struct player *, bool));
+const char *descrstatus __P((struct player *));
+const char *descrtype __P((struct player *, bool));
void activelist __P((void));
void adjuststats __P((void));
long allocrecord __P((void));
@@ -80,19 +80,19 @@ void checktampered __P((void));
void cleanup __P((int));
void collecttaxes __P((double, double));
void cursedtreasure __P((void));
-void death __P((char *));
+void death __P((const char *));
void displaystats __P((void));
double distance __P((double, double, double, double));
void dotampered __P((void));
double drandom __P((void));
void encounter __P((int));
void enterscore __P((void));
-void error __P((char *));
+void error __P((const char *));
double explevel __P((double));
-long findname __P((char *, struct player *));
+long findname __P((const char *, struct player *));
void freerecord __P((struct player *, long));
void genchar __P((int));
-int getanswer __P((char *, bool));
+int getanswer __P((const char *, bool));
void getstring __P((char *, int));
void hitmonster __P((double));
void ill_sig __P((int));
diff --git a/phantasia/phantstruct.h b/phantasia/phantstruct.h
index c7ada226..948bb232 100644
--- a/phantasia/phantstruct.h
+++ b/phantasia/phantstruct.h
@@ -1,4 +1,4 @@
-/* $NetBSD: phantstruct.h,v 1.2 1995/03/24 04:00:11 cgd Exp $ */
+/* $NetBSD: phantstruct.h,v 1.3 1999/09/08 21:17:55 jsm Exp $ */
/*
* phantstruct.h - structure definitions for Phantasia
@@ -121,6 +121,6 @@ struct charstats /* character type statistics */
struct menuitem /* menu item for purchase */
{
- char *item; /* menu item name */
+ const char *item; /* menu item name */
double cost; /* cost of item */
};
diff --git a/phantasia/setup.c b/phantasia/setup.c
index 6727d265..83a43603 100644
--- a/phantasia/setup.c
+++ b/phantasia/setup.c
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.8 1997/11/24 01:47:26 mrg Exp $ */
+/* $NetBSD: setup.c,v 1.9 1999/09/08 21:17:55 jsm Exp $ */
/*
* setup.c - set up all files for Phantasia
@@ -38,7 +38,7 @@
/
/************************************************************************/
-static char *files[] = { /* all files to create */
+static const char *const files[] = { /* all files to create */
_PATH_MONST,
_PATH_PEOPLE,
_PATH_MESS,
@@ -50,14 +50,14 @@ static char *files[] = { /* all files to create */
NULL,
};
-char *monsterfile="monsters.asc";
+const char *monsterfile = "monsters.asc";
int
main(argc, argv)
int argc;
char *argv[];
{
- register char **filename; /* for pointing to file names */
+ register const char *const *filename; /* for pointing to file names */
register int fd; /* file descriptor */
FILE *fp; /* for opening files */
struct stat fbuf; /* for getting files statistics */
@@ -235,7 +235,7 @@ main(argc, argv)
/************************************************************************/
Error(str, file)
-char *str, *file;
+ const char *str, *file;
{
fprintf(stderr, "Error: ");
fprintf(stderr, str, file);
diff --git a/primes/pattern.c b/primes/pattern.c
index 3f55d240..d960a39e 100644
--- a/primes/pattern.c
+++ b/primes/pattern.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pattern.c,v 1.4 1997/10/12 01:04:43 lukem Exp $ */
+/* $NetBSD: pattern.c,v 1.5 1999/09/08 21:17:55 jsm Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)pattern.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pattern.c,v 1.4 1997/10/12 01:04:43 lukem Exp $");
+__RCSID("$NetBSD: pattern.c,v 1.5 1999/09/08 21:17:55 jsm Exp $");
#endif
#endif /* not lint */
@@ -57,7 +57,7 @@ __RCSID("$NetBSD: pattern.c,v 1.4 1997/10/12 01:04:43 lukem Exp $");
* with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13.
*/
-char pattern[] = {
+const char pattern[] = {
1,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,0,1,1,0,0,1,0,1,1,0,0,
1,0,1,0,0,1,0,0,0,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,0,1,1,0,0,
1,0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,0,1,
@@ -444,4 +444,4 @@ char pattern[] = {
0,0,1,1,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0,0,0,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,
0,0,1,1,0,1,0,0,1,1,0,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,0,1
};
-int pattern_size = (sizeof(pattern)/sizeof(pattern[0]));
+const int pattern_size = (sizeof(pattern)/sizeof(pattern[0]));
diff --git a/primes/pr_tbl.c b/primes/pr_tbl.c
index 4f30541c..25d2132a 100644
--- a/primes/pr_tbl.c
+++ b/primes/pr_tbl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pr_tbl.c,v 1.4 1997/10/12 01:04:50 lukem Exp $ */
+/* $NetBSD: pr_tbl.c,v 1.5 1999/09/08 21:17:55 jsm Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)pr_tbl.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pr_tbl.c,v 1.4 1997/10/12 01:04:50 lukem Exp $");
+__RCSID("$NetBSD: pr_tbl.c,v 1.5 1999/09/08 21:17:55 jsm Exp $");
#endif
#endif /* not lint */
@@ -58,7 +58,7 @@ __RCSID("$NetBSD: pr_tbl.c,v 1.4 1997/10/12 01:04:50 lukem Exp $");
#include "primes.h"
-ubig prime[] = {
+const ubig prime[] = {
2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,
107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,
211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,
@@ -550,4 +550,4 @@ ubig prime[] = {
};
/* pr_limit - largest prime in the prime table */
-unsigned long *pr_limit = &prime[(sizeof(prime)/sizeof(prime[0]))-1];
+const unsigned long *pr_limit = &prime[(sizeof(prime)/sizeof(prime[0]))-1];
diff --git a/primes/primes.c b/primes/primes.c
index ea6f0117..67fa6a4f 100644
--- a/primes/primes.c
+++ b/primes/primes.c
@@ -1,4 +1,4 @@
-/* $NetBSD: primes.c,v 1.8 1998/09/13 15:27:29 hubertf Exp $ */
+/* $NetBSD: primes.c,v 1.9 1999/09/08 21:17:55 jsm Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)primes.c 8.5 (Berkeley) 5/10/95";
#else
-__RCSID("$NetBSD: primes.c,v 1.8 1998/09/13 15:27:29 hubertf Exp $");
+__RCSID("$NetBSD: primes.c,v 1.9 1999/09/08 21:17:55 jsm Exp $");
#endif
#endif /* not lint */
@@ -96,16 +96,16 @@ char table[TABSIZE]; /* Eratosthenes sieve of odd numbers */
* We are able to sieve 2^32-1 because this byte table yields all primes
* up to 65537 and 65537^2 > 2^32-1.
*/
-extern ubig prime[];
-extern ubig *pr_limit; /* largest prime in the prime array */
+extern const ubig prime[];
+extern const ubig *pr_limit; /* largest prime in the prime array */
/*
* To avoid excessive sieves for small factors, we use the table below to
* setup our sieve blocks. Each element represents a odd number starting
* with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13.
*/
-extern char pattern[];
-extern int pattern_size; /* length of pattern array */
+extern const char pattern[];
+extern const int pattern_size; /* length of pattern array */
int main __P((int, char *[]));
void primes __P((ubig, ubig));
@@ -227,7 +227,7 @@ primes(start, stop)
char *q; /* sieve spot */
ubig factor; /* index and factor */
char *tab_lim; /* the limit to sieve on the table */
- ubig *p; /* prime table pointer */
+ const ubig *p; /* prime table pointer */
ubig fact_lim; /* highest prime for current block */
/*
diff --git a/quiz/quiz.c b/quiz/quiz.c
index e9026ba5..96ede113 100644
--- a/quiz/quiz.c
+++ b/quiz/quiz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: quiz.c,v 1.13 1998/09/13 15:27:29 hubertf Exp $ */
+/* $NetBSD: quiz.c,v 1.14 1999/09/08 21:17:56 jsm Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
#if 0
static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: quiz.c,v 1.13 1998/09/13 15:27:29 hubertf Exp $");
+__RCSID("$NetBSD: quiz.c,v 1.14 1999/09/08 21:17:56 jsm Exp $");
#endif
#endif /* not lint */
@@ -69,12 +69,12 @@ static QE qlist;
static int catone, cattwo, tflag;
static u_int qsize;
-char *appdstr __P((char *, char *, size_t));
+char *appdstr __P((char *, const char *, size_t));
void downcase __P((char *));
void get_cats __P((char *, char *));
-void get_file __P((char *));
+void get_file __P((const char *));
int main __P((int, char *[]));
-char *next_cat __P((char *));
+const char *next_cat __P((const char *));
void quiz __P((void));
void score __P((u_int, u_int, u_int));
void show_index __P((void));
@@ -86,7 +86,7 @@ main(argc, argv)
char *argv[];
{
int ch;
- char *indexfile;
+ const char *indexfile;
indexfile = _PATH_QUIZIDX;
while ((ch = getopt(argc, argv, "i:t")) != -1)
@@ -122,7 +122,7 @@ main(argc, argv)
void
get_file(file)
- char *file;
+ const char *file;
{
FILE *fp;
QE *qp;
@@ -164,7 +164,7 @@ void
show_index()
{
QE *qp;
- char *p, *s;
+ const char *p, *s;
FILE *pf;
if ((pf = popen(_PATH_PAGER, "w")) == NULL)
@@ -192,7 +192,7 @@ get_cats(cat1, cat2)
{
QE *qp;
int i;
- char *s;
+ const char *s;
downcase(cat1);
downcase(cat2);
@@ -227,7 +227,8 @@ quiz()
size_t len;
u_int guesses, rights, wrongs;
int next;
- char *answer, *s, *t, question[LINE_SZ];
+ char *answer, *t, question[LINE_SZ];
+ const char *s;
srandom(time(NULL));
guesses = rights = wrongs = 0;
@@ -301,9 +302,9 @@ quiz()
score(rights, wrongs, guesses);
}
-char *
+const char *
next_cat(s)
- char * s;
+ const char * s;
{
int esc;
@@ -328,10 +329,11 @@ next_cat(s)
char *
appdstr(s, tp, len)
char *s;
- char *tp;
+ const char *tp;
size_t len;
{
- char *mp, *sp;
+ char *mp;
+ const char *sp;
int ch;
char *m;
diff --git a/quiz/quiz.h b/quiz/quiz.h
index ff7e4ded..f8123b39 100644
--- a/quiz/quiz.h
+++ b/quiz/quiz.h
@@ -1,4 +1,4 @@
-/* $NetBSD: quiz.h,v 1.4 1995/04/22 10:16:59 cgd Exp $ */
+/* $NetBSD: quiz.h,v 1.5 1999/09/08 21:17:56 jsm Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -58,6 +58,6 @@ typedef struct qentry {
extern char rxperr[];
-int rxp_compile __P((char *));
+int rxp_compile __P((const char *));
char *rxp_expand __P((void));
-int rxp_match __P((char *));
+int rxp_match __P((const char *));
diff --git a/quiz/rxp.c b/quiz/rxp.c
index 19a31bf6..8531718b 100644
--- a/quiz/rxp.c
+++ b/quiz/rxp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rxp.c,v 1.6 1997/09/20 14:28:19 lukem Exp $ */
+/* $NetBSD: rxp.c,v 1.7 1999/09/08 21:17:56 jsm Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)rxp.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: rxp.c,v 1.6 1997/09/20 14:28:19 lukem Exp $");
+__RCSID("$NetBSD: rxp.c,v 1.7 1999/09/08 21:17:56 jsm Exp $");
#endif
#endif /* not lint */
@@ -85,24 +85,24 @@ typedef short Rxp_t; /* type for regexp tokens */
static Rxp_t rxpbuf[RXP_LINE_SZ]; /* compiled regular expression buffer */
char rxperr[128]; /* parser error message */
-static int rxp__compile __P((char *, int));
+static int rxp__compile __P((const char *, int));
static char *rxp__expand __P((int));
-static int rxp__match __P((char *, int, Rxp_t *, Rxp_t *, char *));
+static int rxp__match __P((const char *, int, Rxp_t *, Rxp_t *, const char *));
int
rxp_compile(s)
- char * s;
+ const char * s;
{
return (rxp__compile(s, TRUE));
}
static int
rxp__compile(s, first)
- char *s;
+ const char *s;
int first;
{
static Rxp_t *rp;
- static char *sp;
+ static const char *sp;
Rxp_t *grp_ptr;
Rxp_t *alt_ptr;
int esc, err;
@@ -196,21 +196,21 @@ rxp__compile(s, first)
*/
int
rxp_match(s)
- char * s;
+ const char * s;
{
return (rxp__match(s, TRUE, NULL, NULL, NULL));
}
static int
rxp__match(s, first, j_succ, j_fail, sp_fail)
- char *s;
+ const char *s;
int first;
Rxp_t *j_succ; /* jump here on successful alt match */
Rxp_t *j_fail; /* jump here on failed match */
- char *sp_fail; /* reset sp to here on failed match */
+ const char *sp_fail; /* reset sp to here on failed match */
{
static Rxp_t *rp;
- static char *sp;
+ static const char *sp;
int ch;
Rxp_t *grp_end = NULL;
int err;
diff --git a/robots/auto.c b/robots/auto.c
index 03842278..c0a15bf8 100644
--- a/robots/auto.c
+++ b/robots/auto.c
@@ -1,4 +1,4 @@
-/* $NetBSD: auto.c,v 1.3 1999/05/16 00:15:46 christos Exp $ */
+/* $NetBSD: auto.c,v 1.4 1999/09/08 21:17:56 jsm Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
static int distance __P((int, int, int, int));
static int xinc __P((int));
static int yinc __P((int));
-static char *find_moves __P((void));
+static const char *find_moves __P((void));
static COORD *closest_robot __P((int *));
static COORD *closest_heap __P((int *));
static char move_towards __P((int, int));
@@ -137,13 +137,14 @@ yinc(dir)
/* find_moves():
* Find possible moves
*/
-static char *
+static const char *
find_moves()
{
int x, y;
COORD test;
- char *m, *a;
- static char moves[] = ".hjklyubn";
+ const char *m;
+ char *a;
+ static const char moves[] = ".hjklyubn";
static char ans[sizeof moves];
a = ans;
@@ -167,10 +168,9 @@ find_moves()
}
*a = 0;
if(ans[0])
- a = ans;
+ return ans;
else
- a = "t";
- return a;
+ return "t";
}
/* closest_robot():
diff --git a/robots/extern.c b/robots/extern.c
index 80c2e909..395c021b 100644
--- a/robots/extern.c
+++ b/robots/extern.c
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.c,v 1.5 1999/05/15 23:56:35 christos Exp $ */
+/* $NetBSD: extern.c,v 1.6 1999/09/08 21:17:57 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: extern.c,v 1.5 1999/05/15 23:56:35 christos Exp $");
+__RCSID("$NetBSD: extern.c,v 1.6 1999/09/08 21:17:57 jsm Exp $");
#endif
#endif /* not lint */
@@ -63,8 +63,8 @@ bool Was_bonus = FALSE; /* Was a bonus last level */
char Cnt_move; /* Command which has preceded the count */
char Field[Y_FIELDSIZE][X_FIELDSIZE]; /* the playing field itslef */
-char *Next_move; /* Next move to be used in the pattern */
-char *Move_list = "YHBJNLUK";/* List of moves in the pattern */
+const char *Next_move; /* Next move to be used in the pattern */
+const char *Move_list = "YHBJNLUK";/* List of moves in the pattern */
char Run_ch; /* Character for the direction we are running */
int Count = 0; /* Command count */
diff --git a/robots/init_field.c b/robots/init_field.c
index a5fd9e25..57200a44 100644
--- a/robots/init_field.c
+++ b/robots/init_field.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init_field.c,v 1.5 1997/10/12 14:09:57 lukem Exp $ */
+/* $NetBSD: init_field.c,v 1.6 1999/09/08 21:17:57 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)init_field.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: init_field.c,v 1.5 1997/10/12 14:09:57 lukem Exp $");
+__RCSID("$NetBSD: init_field.c,v 1.6 1999/09/08 21:17:57 jsm Exp $");
#endif
#endif /* not lint */
@@ -54,7 +54,7 @@ init_field()
{
int i;
static bool first = TRUE;
- static char *desc[] = {
+ static const char *const desc[] = {
"Directions:",
"",
"y k u",
diff --git a/robots/main.c b/robots/main.c
index b1c2ff36..ce7f8cf5 100644
--- a/robots/main.c
+++ b/robots/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.8 1999/05/15 23:56:36 christos Exp $ */
+/* $NetBSD: main.c,v 1.9 1999/09/08 21:17:57 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.8 1999/05/15 23:56:36 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.9 1999/09/08 21:17:57 jsm Exp $");
#endif
#endif /* not lint */
@@ -56,10 +56,10 @@ main(ac, av)
int ac;
char **av;
{
- char *sp;
+ const char *sp;
bool bad_arg;
bool show_only;
- extern char *Scorefile;
+ extern const char *Scorefile;
extern int Max_per_uid;
show_only = FALSE;
diff --git a/robots/move.c b/robots/move.c
index db08c84c..a74c6c76 100644
--- a/robots/move.c
+++ b/robots/move.c
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.8 1999/05/15 23:56:36 christos Exp $ */
+/* $NetBSD: move.c,v 1.9 1999/09/08 21:17:57 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: move.c,v 1.8 1999/05/15 23:56:36 christos Exp $");
+__RCSID("$NetBSD: move.c,v 1.9 1999/09/08 21:17:57 jsm Exp $");
#endif
#endif /* not lint */
@@ -274,7 +274,7 @@ do_move(dy, dx)
*/
bool
eaten(pos)
- COORD *pos;
+ const COORD *pos;
{
int x, y;
diff --git a/robots/query.c b/robots/query.c
index e0ca5823..b89535e2 100644
--- a/robots/query.c
+++ b/robots/query.c
@@ -1,4 +1,4 @@
-/* $NetBSD: query.c,v 1.4 1997/10/12 14:10:01 lukem Exp $ */
+/* $NetBSD: query.c,v 1.5 1999/09/08 21:17:57 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)query.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: query.c,v 1.4 1997/10/12 14:10:01 lukem Exp $");
+__RCSID("$NetBSD: query.c,v 1.5 1999/09/08 21:17:57 jsm Exp $");
#endif
#endif /* not lint */
@@ -50,7 +50,7 @@ __RCSID("$NetBSD: query.c,v 1.4 1997/10/12 14:10:01 lukem Exp $");
*/
int
query(prompt)
- char *prompt;
+ const char *prompt;
{
int c, retval;
int y, x;
diff --git a/robots/robots.h b/robots/robots.h
index a93e07b4..3fcf5c1c 100644
--- a/robots/robots.h
+++ b/robots/robots.h
@@ -1,4 +1,4 @@
-/* $NetBSD: robots.h,v 1.10 1999/05/16 00:03:35 christos Exp $ */
+/* $NetBSD: robots.h,v 1.11 1999/09/08 21:17:57 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -105,8 +105,8 @@ extern bool Dead, Full_clear, Jump, Newscore, Real_time, Running,
extern bool Pattern_roll, Stand_still;
#endif
-extern char Cnt_move, Field[Y_FIELDSIZE][X_FIELDSIZE], *Next_move,
- *Move_list, Run_ch;
+extern char Cnt_move, Field[Y_FIELDSIZE][X_FIELDSIZE], Run_ch;
+extern const char *Next_move, *Move_list;
extern int Count, Level, Num_robots, Num_scrap, Num_scores, Score,
Start_level, Wait_bonus, Num_games;
@@ -123,7 +123,7 @@ void add_score __P((int));
bool another __P((void));
int cmp_sc __P((const void *, const void *));
bool do_move __P((int, int));
-bool eaten __P((COORD *));
+bool eaten __P((const COORD *));
void flush_in __P((void));
void get_move __P((void));
void init_field __P((void));
@@ -132,7 +132,7 @@ void make_level __P((void));
void move_robots __P((int));
bool must_telep __P((void));
void play_level __P((void));
-int query __P((char *));
+int query __P((const char *));
void quit __P((int)) __attribute__((__noreturn__));
void reset_count __P((void));
int rnd __P((int));
diff --git a/robots/score.c b/robots/score.c
index aacb07ec..c22a7463 100644
--- a/robots/score.c
+++ b/robots/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.7 1999/05/16 00:03:35 christos Exp $ */
+/* $NetBSD: score.c,v 1.8 1999/09/08 21:17:57 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,14 +38,14 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.7 1999/05/16 00:03:35 christos Exp $");
+__RCSID("$NetBSD: score.c,v 1.8 1999/09/08 21:17:57 jsm Exp $");
#endif
#endif /* not lint */
# include "robots.h"
# include "pathnames.h"
-char *Scorefile = _PATH_SCORE;
+const char *Scorefile = _PATH_SCORE;
int Max_per_uid = MAX_PER_UID;
@@ -199,9 +199,10 @@ set_name(scp)
SCORE *scp;
{
PASSWD *pp;
+ static char unknown[] = "???";
if ((pp = getpwuid(scp->s_uid)) == NULL)
- pp->pw_name = "???";
+ pp->pw_name = unknown;
strncpy(scp->s_name, pp->pw_name, MAXNAME);
}
@@ -213,7 +214,7 @@ int
cmp_sc(s1, s2)
const void *s1, *s2;
{
- return ((SCORE *)s2)->s_score - ((SCORE *)s1)->s_score;
+ return ((const SCORE *)s2)->s_score - ((const SCORE *)s1)->s_score;
}
/*
diff --git a/sail/assorted.c b/sail/assorted.c
index 4a4b143f..5101a207 100644
--- a/sail/assorted.c
+++ b/sail/assorted.c
@@ -1,4 +1,4 @@
-/* $NetBSD: assorted.c,v 1.7 1999/02/10 00:45:45 hubertf Exp $ */
+/* $NetBSD: assorted.c,v 1.8 1999/09/08 21:17:58 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)assorted.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: assorted.c,v 1.7 1999/02/10 00:45:45 hubertf Exp $");
+__RCSID("$NetBSD: assorted.c,v 1.8 1999/09/08 21:17:58 jsm Exp $");
#endif
#endif /* not lint */
@@ -60,8 +60,8 @@ int rig, shot, hittable, roll;
int crew[3];
int n;
int rigg[4];
- char *message;
- struct Tables *tp;
+ const char *message;
+ const struct Tables *tp;
pc = on->file->pcrew;
hull = on->specs->hull;
diff --git a/sail/dr_1.c b/sail/dr_1.c
index f2a5c8a1..69ca2d30 100644
--- a/sail/dr_1.c
+++ b/sail/dr_1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dr_1.c,v 1.8 1999/02/10 00:45:45 hubertf Exp $ */
+/* $NetBSD: dr_1.c,v 1.9 1999/09/08 21:17:58 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dr_1.c,v 1.8 1999/02/10 00:45:45 hubertf Exp $");
+__RCSID("$NetBSD: dr_1.c,v 1.9 1999/09/08 21:17:58 jsm Exp $");
#endif
#endif /* not lint */
@@ -421,11 +421,15 @@ next()
}
}
if (best > 0.0) {
- char *p = getenv("WOTD");
- if (p == 0)
+ char *tp = getenv("WOTD");
+ const char *p;
+ if (tp == 0)
p = "Driver";
- if (islower(*p))
- *p = toupper(*p);
+ else {
+ if (islower(*tp))
+ *tp = toupper(*tp);
+ p = tp;
+ }
(void) strncpy(bestship->file->captain, p,
sizeof bestship->file->captain);
bestship->file->captain
diff --git a/sail/dr_2.c b/sail/dr_2.c
index 53730515..439c3218 100644
--- a/sail/dr_2.c
+++ b/sail/dr_2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dr_2.c,v 1.9 1999/02/10 00:45:45 hubertf Exp $ */
+/* $NetBSD: dr_2.c,v 1.10 1999/09/08 21:17:58 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)dr_2.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dr_2.c,v 1.9 1999/02/10 00:45:45 hubertf Exp $");
+__RCSID("$NetBSD: dr_2.c,v 1.10 1999/09/08 21:17:58 jsm Exp $");
#endif
#endif /* not lint */
@@ -129,9 +129,9 @@ prizecheck()
int
strend(str)
-char *str;
+ const char *str;
{
- char *p;
+ const char *p;
for (p = str; *p; p++)
;
@@ -152,7 +152,7 @@ int ma, ta, af;
try(command, temp, ma, ta, af, ma, from->file->dir, from, to, &high, 0);
}
-int dtab[] = {0,1,1,2,3,4,4,5}; /* diagonal distances in x==y */
+const int dtab[] = {0,1,1,2,3,4,4,5}; /* diagonal distances in x==y */
int
score(movement, ship, to, onlytemp)
@@ -190,7 +190,7 @@ char onlytemp;
void
move_ship(p, ship, dir, row, col, drift)
-char *p;
+const char *p;
struct ship *ship;
unsigned char *dir;
short *row, *col;
diff --git a/sail/driver.h b/sail/driver.h
index 033e1ed0..14385d6c 100644
--- a/sail/driver.h
+++ b/sail/driver.h
@@ -1,4 +1,4 @@
-/* $NetBSD: driver.h,v 1.5 1998/03/29 04:57:19 mrg Exp $ */
+/* $NetBSD: driver.h,v 1.6 1999/09/08 21:17:58 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,4 +37,4 @@
#include "extern.h"
-extern int dtab[];
+extern const int dtab[];
diff --git a/sail/extern.h b/sail/extern.h
index 73c4dded..80a274f5 100644
--- a/sail/extern.h
+++ b/sail/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.9 1999/02/10 00:45:45 hubertf Exp $ */
+/* $NetBSD: extern.h,v 1.10 1999/09/08 21:17:58 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -214,7 +214,7 @@ struct File {
};
struct ship {
- char *shipname; /* 0 */
+ const char *shipname; /* 0 */
struct shipspecs *specs; /* 2 */
unsigned char nationality; /* 4 */
short shiprow; /* 6 */
@@ -228,7 +228,7 @@ struct scenario {
char windspeed; /* 2 */
char windchange; /* 4 */
unsigned char vessels; /* 12 */
- char *name; /* 14 */
+ const char *name; /* 14 */
struct ship ship[NSHIP]; /* 16 */
};
extern struct scenario scene[];
@@ -266,29 +266,29 @@ struct ship *ls; /* &cc->ship[cc->vessels] */
struct windeffects {
char A, B, C, D;
};
-struct windeffects WET[7][6];
+const struct windeffects WET[7][6];
struct Tables {
char H, G, C, R;
};
-struct Tables RigTable[11][6];
-struct Tables HullTable[11][6];
+const struct Tables RigTable[11][6];
+const struct Tables HullTable[11][6];
-char AMMO[9][4];
-char HDT[9][10];
-char HDTrake[9][10];
-char QUAL[9][5];
-char MT[9][3];
+const char AMMO[9][4];
+const char HDT[9][10];
+const char HDTrake[9][10];
+const char QUAL[9][5];
+const char MT[9][3];
-extern char *countryname[];
-extern char *classname[];
-extern char *directionname[];
-extern char *qualname[];
-extern char loadname[];
+extern const char *const countryname[];
+extern const char *const classname[];
+extern const char *const directionname[];
+extern const char *const qualname[];
+extern const char loadname[];
-extern char rangeofshot[];
+extern const char rangeofshot[];
-extern char dr[], dc[];
+extern const char dr[], dc[];
int winddir;
int windspeed;
@@ -314,10 +314,10 @@ int next __P((void));
void thinkofgrapples __P((void));
void checkup __P((void));
void prizecheck __P((void));
-int strend __P((char *));
+int strend __P((const char *));
void closeon __P((struct ship *, struct ship *, char[], int, int, int));
int score __P((char[], struct ship *, struct ship *, int));
-void move_ship __P((char *, struct ship *, unsigned char *, short *, short *, char *));
+void move_ship __P((const char *, struct ship *, unsigned char *, short *, short *, char *));
void try __P((char[], char [], int, int, int, int, int, struct ship *,
struct ship *, int *, int));
void rmend __P((char *));
@@ -383,7 +383,7 @@ void unfoulplayer __P((void));
void changesail __P((void));
void acceptsignal __P((void));
void lookout __P((void));
-char *saywhat __P((struct ship *, int));
+const char *saywhat __P((struct ship *, int));
void eyeball __P((struct ship *));
/* pl_5.c */
@@ -405,10 +405,10 @@ void Signal __P((const char *, struct ship *, ...))
void Msg __P((const char *, ...))
__attribute__((__format__(__printf__,1,2)));
void Scroll __P((void));
-void prompt __P((char *, struct ship *));
+void prompt __P((const char *, struct ship *));
void endprompt __P((int));
-int sgetch __P((char *, struct ship *, int));
-void sgetstr __P((char *, char *, int));
+int sgetch __P((const char *, struct ship *, int));
+void sgetstr __P((const char *, char *, int));
void draw_screen __P((void));
void draw_view __P((void));
void draw_turn __P((void));
diff --git a/sail/globals.c b/sail/globals.c
index 01c1415c..4e84fdce 100644
--- a/sail/globals.c
+++ b/sail/globals.c
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.c,v 1.6 1997/10/13 19:44:17 christos Exp $ */
+/* $NetBSD: globals.c,v 1.7 1999/09/08 21:17:58 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)globals.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: globals.c,v 1.6 1997/10/13 19:44:17 christos Exp $");
+__RCSID("$NetBSD: globals.c,v 1.7 1999/09/08 21:17:58 jsm Exp $");
#endif
#endif /* not lint */
@@ -406,7 +406,7 @@ struct shipspecs specs[] = {
/* class qual crew2 gunL carL rig1 rig3 */
};
-struct windeffects WET[7][6] = {
+const struct windeffects WET[7][6] = {
{ {9,9,9,9}, {9,9,9,9}, {9,9,9,9}, {9,9,9,9}, {9,9,9,9}, {9,9,9,9} },
{ {3,2,2,0}, {3,2,1,0}, {3,2,1,0}, {3,2,1,0}, {2,1,0,0}, {2,1,0,0} },
{ {1,1,1,0}, {1,1,0,0}, {1,0,0,0}, {1,0,0,0}, {1,0,0,0}, {1,0,0,0} },
@@ -416,7 +416,7 @@ struct windeffects WET[7][6] = {
{ {2,1,1,0}, {3,2,1,0}, {3,2,1,0}, {3,2,1,0}, {3,3,2,0}, {3,3,2,0} }
};
-struct Tables RigTable[11][6] = {
+const struct Tables RigTable[11][6] = {
{ {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,1}, {0,0,1,0} },
{ {0,0,0,0}, {0,0,0,0}, {0,0,0,1}, {0,0,1,0}, {1,0,0,1}, {0,1,1,1} },
{ {0,0,0,0}, {0,0,0,1}, {0,0,1,1}, {0,1,0,1}, {0,1,0,1}, {1,0,1,2} },
@@ -429,7 +429,7 @@ struct Tables RigTable[11][6] = {
{ {1,1,0,4}, {1,0,1,4}, {2,0,0,5}, {0,2,1,5}, {0,1,2,6}, {0,2,0,7} },
{ {1,0,1,5}, {0,2,0,6}, {1,2,0,6}, {1,1,1,6}, {2,0,2,6}, {1,1,2,7} }
};
-struct Tables HullTable[11][6] = {
+const struct Tables HullTable[11][6] = {
{ {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {1,0,0,0}, {0,1,0,0} },
{ {0,0,0,0}, {0,0,0,0}, {0,1,0,0}, {1,1,0,0}, {1,0,1,0}, {1,0,1,1} },
{ {0,1,0,0}, {1,0,0,0}, {1,1,0,0}, {1,0,1,0}, {1,0,1,1}, {2,1,0,0} },
@@ -443,7 +443,7 @@ struct Tables HullTable[11][6] = {
{ {2,2,4,0}, {3,3,1,1}, {4,2,1,1}, {5,1,0,2}, {5,1,2,1}, {6,2,2,0} },
};
-char AMMO[9][4] = {
+const char AMMO[9][4] = {
{ -1, 1, 0, 1 },
{ -1, 1, 0, 1 },
{ -1, 1, 0, 1 },
@@ -455,7 +455,7 @@ char AMMO[9][4] = {
{ -3, 2, 0, 3 }
};
-char HDT[9][10] = {
+const char HDT[9][10] = {
{ 1, 0,-1,-2,-3,-3,-4,-4,-4,-4 },
{ 1, 1, 0,-1,-2,-2,-3,-3,-3,-3 },
{ 2, 1, 0,-1,-2,-2,-3,-3,-3,-3 },
@@ -467,7 +467,7 @@ char HDT[9][10] = {
{ 5, 4, 3, 2, 1, 1, 0, 0, 0, 0 }
};
-char HDTrake[9][10] = {
+const char HDTrake[9][10] = {
{ 2, 1, 0,-1,-2,-2,-3,-3,-3,-3 },
{ 2, 2, 1, 0,-1,-1,-2,-2,-2,-2 },
{ 3, 2, 1, 0,-1,-1,-2,-2,-2,-2 },
@@ -479,7 +479,7 @@ char HDTrake[9][10] = {
{ 9, 8, 7, 6, 5, 5, 4, 4, 4, 4 }
};
-char QUAL[9][5] = {
+const char QUAL[9][5] = {
{ -1, 0, 0, 1, 1 },
{ -1, 0, 0, 1, 1 },
{ -1, 0, 0, 1, 2 },
@@ -491,7 +491,7 @@ char QUAL[9][5] = {
{ -2,-1, 0, 2, 3 }
};
-char MT[9][3] = {
+const char MT[9][3] = {
{ 1, 0, 0 },
{ 1, 1, 0 },
{ 2, 1, 0 },
@@ -503,7 +503,7 @@ char MT[9][3] = {
{ 4, 4, 2 }
};
-char rangeofshot[] = {
+const char rangeofshot[] = {
0,
1, /* grape */
3, /* chain */
@@ -511,12 +511,12 @@ char rangeofshot[] = {
1 /* double */
};
-char *countryname[] = {
+const char *const countryname[] = {
"American", "British", "Spanish", "French", "Japanese",
"Federation", "Klingon", "Orion"
};
-char *classname[] = {
+const char *const classname[] = {
"Drift wood",
"Ship of the Line",
"Ship of the Line",
@@ -526,7 +526,7 @@ char *classname[] = {
"Brig"
};
-char *directionname[] = {
+const char *const directionname[] = {
"dead ahead",
"off the starboard bow",
"off the starboard beam",
@@ -538,9 +538,9 @@ char *directionname[] = {
"dead ahead"
};
-char *qualname[] = { "dead", "mutinous", "green", "mundane", "crack", "elite" };
+const char *const qualname[] = { "dead", "mutinous", "green", "mundane", "crack", "elite" };
-char loadname[] = { '-', 'G', 'C', 'R', 'D', 'E' };
+const char loadname[] = { '-', 'G', 'C', 'R', 'D', 'E' };
-char dr[] = { 0, 1, 1, 0, -1, -1, -1, 0, 1 };
-char dc[] = { 0, 0, -1, -1, -1, 0, 1, 1, 1 };
+const char dr[] = { 0, 1, 1, 0, -1, -1, -1, 0, 1 };
+const char dc[] = { 0, 0, -1, -1, -1, 0, 1, 1, 1 };
diff --git a/sail/lo_main.c b/sail/lo_main.c
index 92c50123..71f3f099 100644
--- a/sail/lo_main.c
+++ b/sail/lo_main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lo_main.c,v 1.5 1997/10/13 19:44:24 christos Exp $ */
+/* $NetBSD: lo_main.c,v 1.6 1999/09/08 21:17:59 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)lo_main.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: lo_main.c,v 1.5 1997/10/13 19:44:24 christos Exp $");
+__RCSID("$NetBSD: lo_main.c,v 1.6 1999/09/08 21:17:59 jsm Exp $");
#endif
#endif /* not lint */
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: lo_main.c,v 1.5 1997/10/13 19:44:24 christos Exp $");
#include "extern.h"
#include "pathnames.h"
-char *title[] = {
+const char *const title[] = {
"Admiral", "Commodore", "Captain", "Captain",
"Captain", "Captain", "Captain", "Commander",
"Commander", "Lieutenant"
diff --git a/sail/pl_3.c b/sail/pl_3.c
index 4be189be..be5cbb21 100644
--- a/sail/pl_3.c
+++ b/sail/pl_3.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pl_3.c,v 1.7 1999/02/10 00:45:46 hubertf Exp $ */
+/* $NetBSD: pl_3.c,v 1.8 1999/09/08 21:17:59 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)pl_3.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pl_3.c,v 1.7 1999/02/10 00:45:46 hubertf Exp $");
+__RCSID("$NetBSD: pl_3.c,v 1.8 1999/09/08 21:17:59 jsm Exp $");
#endif
#endif /* not lint */
@@ -181,7 +181,7 @@ acceptcombat()
if (load == L_GRAPE)
chits = hit;
else {
- struct Tables *t;
+ const struct Tables *t;
if (hit > 10)
hit = 10;
t = &(shootat == RIGGING ? RigTable : HullTable)
diff --git a/sail/pl_4.c b/sail/pl_4.c
index 163594d7..37c16446 100644
--- a/sail/pl_4.c
+++ b/sail/pl_4.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pl_4.c,v 1.7 1999/02/10 00:45:46 hubertf Exp $ */
+/* $NetBSD: pl_4.c,v 1.8 1999/09/08 21:17:59 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)pl_4.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pl_4.c,v 1.7 1999/02/10 00:45:46 hubertf Exp $");
+__RCSID("$NetBSD: pl_4.c,v 1.8 1999/09/08 21:17:59 jsm Exp $");
#endif
#endif /* not lint */
@@ -104,7 +104,7 @@ lookout()
}
}
-char *
+const char *
saywhat(sp, flag)
struct ship *sp;
char flag;
diff --git a/sail/pl_7.c b/sail/pl_7.c
index 3091a521..b281cd81 100644
--- a/sail/pl_7.c
+++ b/sail/pl_7.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pl_7.c,v 1.10 1999/02/10 00:45:46 hubertf Exp $ */
+/* $NetBSD: pl_7.c,v 1.11 1999/09/08 21:17:59 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pl_7.c,v 1.10 1999/02/10 00:45:46 hubertf Exp $");
+__RCSID("$NetBSD: pl_7.c,v 1.11 1999/09/08 21:17:59 jsm Exp $");
#endif
#endif /* not lint */
@@ -57,8 +57,8 @@ __RCSID("$NetBSD: pl_7.c,v 1.10 1999/02/10 00:45:46 hubertf Exp $");
*/
static char sc_hasprompt;
-static char *sc_prompt;
-static char *sc_buf;
+static const char *sc_prompt;
+static const char *sc_buf;
static int sc_line;
void
@@ -217,8 +217,8 @@ Scroll()
void
prompt(p, ship)
-char *p;
-struct ship *ship;
+ const char *p;
+ struct ship *ship;
{
static char buf[BUFSIZ];
@@ -240,9 +240,9 @@ char flag;
int
sgetch(p, ship, flag)
-char *p;
-struct ship *ship;
-char flag;
+ const char *p;
+ struct ship *ship;
+ char flag;
{
int c;
prompt(p, ship);
@@ -259,9 +259,9 @@ char flag;
void
sgetstr(pr, buf, n)
-char *pr;
-char *buf;
-int n;
+ const char *pr;
+ char *buf;
+ int n;
{
int c;
char *p = buf;
diff --git a/snake/snake/move.c b/snake/snake/move.c
index 4620e02a..2308aeb5 100644
--- a/snake/snake/move.c
+++ b/snake/snake/move.c
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.16 1999/08/14 16:38:45 tron Exp $ */
+/* $NetBSD: move.c,v 1.17 1999/09/08 21:17:59 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 7/19/93";
#else
-__RCSID("$NetBSD: move.c,v 1.16 1999/08/14 16:38:45 tron Exp $");
+__RCSID("$NetBSD: move.c,v 1.17 1999/09/08 21:17:59 jsm Exp $");
#endif
#endif /* not lint */
@@ -192,7 +192,7 @@ move(sp)
void
gto(sp)
- struct point *sp;
+ const struct point *sp;
{
int distance, f, tfield;
@@ -264,7 +264,7 @@ gto(sp)
void
right(sp)
- struct point *sp;
+ const struct point *sp;
{
int field, tfield;
int tabcol, strlength;
@@ -429,10 +429,10 @@ pch(c)
void
#if __STDC__
-apr(struct point * ps, const char *fmt,...)
+apr(const struct point * ps, const char *fmt,...)
#else
apr(ps, fmt, va_alist)
- struct point *ps;
+ const struct point *ps;
char *fmt;
va_dcl
#endif
@@ -512,7 +512,7 @@ pstring(s)
void
pchar(ps, ch)
- struct point *ps;
+ const struct point *ps;
char ch;
{
struct point p;
@@ -546,7 +546,7 @@ outch(c)
void
putpad(str)
- char *str;
+ const char *str;
{
if (str)
tputs(str, 1, outch);
diff --git a/snake/snake/snake.c b/snake/snake/snake.c
index eaa30b81..49507b59 100644
--- a/snake/snake/snake.c
+++ b/snake/snake/snake.c
@@ -1,4 +1,4 @@
-/* $NetBSD: snake.c,v 1.9 1997/10/12 01:49:28 lukem Exp $ */
+/* $NetBSD: snake.c,v 1.10 1999/09/08 21:17:59 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94";
#else
-__RCSID("$NetBSD: snake.c,v 1.9 1997/10/12 01:49:28 lukem Exp $");
+__RCSID("$NetBSD: snake.c,v 1.10 1999/09/08 21:17:59 jsm Exp $");
#endif
#endif /* not lint */
@@ -547,13 +547,13 @@ flushi()
tcflush(0, TCIFLUSH);
}
-int mx[8] = {
+const int mx[8] = {
0, 1, 1, 1, 0, -1, -1, -1
};
-int my[8] = {
+const int my[8] = {
-1, -1, 0, 1, 1, 1, 0, -1
};
-float absv[8] = {
+const float absv[8] = {
1, 1.4, 1, 1.4, 1, 1.4, 1, 1.4
};
int oldw = 0;
@@ -626,7 +626,7 @@ spacewarp(w)
{
struct point p;
int j;
- char *str;
+ const char *str;
snrand(&you);
point(&p, COLUMNS / 2 - 8, LINES / 2 - 1);
@@ -693,7 +693,7 @@ snap()
int
stretch(ps)
- struct point *ps;
+ const struct point *ps;
{
struct point p;
@@ -771,7 +771,7 @@ surround(ps)
void
win(ps)
- struct point *ps;
+ const struct point *ps;
{
struct point x;
int j, k;
@@ -854,7 +854,7 @@ pushsnake()
int
chk(sp)
- struct point *sp;
+ const struct point *sp;
{
int j;
diff --git a/snake/snake/snake.h b/snake/snake/snake.h
index 1952385d..0199ff52 100644
--- a/snake/snake/snake.h
+++ b/snake/snake/snake.h
@@ -1,4 +1,4 @@
-/* $NetBSD: snake.h,v 1.11 1999/08/14 16:38:46 tron Exp $ */
+/* $NetBSD: snake.h,v 1.12 1999/09/08 21:18:00 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -81,10 +81,10 @@ struct termios orig, new;
#define same(s1, s2) ((s1)->line == (s2)->line && (s1)->col == (s2)->col)
-void apr __P((struct point *, const char *, ...));
+void apr __P((const struct point *, const char *, ...));
void bs __P((void));
void chase __P((struct point *, struct point *));
-int chk __P((struct point *));
+int chk __P((const struct point *));
void clear __P((void));
void cook __P((void));
void cr __P((void));
@@ -94,7 +94,7 @@ void down __P((void));
void drawbox __P((void));
void flushi __P((void));
void getcap __P((void));
-void gto __P((struct point *));
+void gto __P((const struct point *));
void home __P((void));
void length __P((int));
void ll __P((void));
@@ -104,25 +104,23 @@ void move __P((struct point *));
void nd __P((void));
void outch __P((int));
void pch __P((int));
-void pchar __P((struct point *, char));
+void pchar __P((const struct point *, char));
struct point *point __P((struct point *, int, int));
int post __P((int, int));
void pr __P((const char *, ...));
void pstring __P((const char *));
int pushsnake __P((void));
-void putpad __P((char *));
+void putpad __P((const char *));
void raw __P((void));
-void right __P((struct point *));
+void right __P((const struct point *));
void setup __P((void));
void snap __P((void));
-void snap __P((void));
void snrand __P((struct point *));
void spacewarp __P((int));
void stop __P((int)) __attribute__((__noreturn__));
-int stretch __P((struct point *));
-int stretch __P((struct point *));
+int stretch __P((const struct point *));
void surround __P((struct point *));
void suspend __P((void));
void up __P((void));
-void win __P((struct point *));
+void win __P((const struct point *));
void winnings __P((int));
diff --git a/snake/snscore/snscore.c b/snake/snscore/snscore.c
index 48d99f78..b5f57cf3 100644
--- a/snake/snscore/snscore.c
+++ b/snake/snscore/snscore.c
@@ -1,4 +1,4 @@
-/* $NetBSD: snscore.c,v 1.8 1998/09/11 14:25:22 hubertf Exp $ */
+/* $NetBSD: snscore.c,v 1.9 1999/09/08 21:18:00 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)snscore.c 8.1 (Berkeley) 7/19/93";
#else
-__RCSID("$NetBSD: snscore.c,v 1.8 1998/09/11 14:25:22 hubertf Exp $");
+__RCSID("$NetBSD: snscore.c,v 1.9 1999/09/08 21:18:00 jsm Exp $");
#endif
#endif /* not lint */
@@ -55,7 +55,7 @@ __RCSID("$NetBSD: snscore.c,v 1.8 1998/09/11 14:25:22 hubertf Exp $");
#include <string.h>
#include "pathnames.h"
-char *recfile = _PATH_RAWSCORES;
+const char *recfile = _PATH_RAWSCORES;
#define MAXPLAYERS 256
struct player {
diff --git a/tetris/scores.c b/tetris/scores.c
index 6afb1115..a93c2ef5 100644
--- a/tetris/scores.c
+++ b/tetris/scores.c
@@ -1,4 +1,4 @@
-/* $NetBSD: scores.c,v 1.4 1997/10/14 01:14:20 lukem Exp $ */
+/* $NetBSD: scores.c,v 1.5 1999/09/08 21:18:00 jsm Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -96,7 +96,7 @@ getscores(fpp)
FILE **fpp;
{
int sd, mint, lck;
- char *mstr, *human;
+ const char *mstr, *human;
FILE *sf;
if (fpp != NULL) {
diff --git a/tetris/screen.c b/tetris/screen.c
index 007705e9..c4a49fab 100644
--- a/tetris/screen.c
+++ b/tetris/screen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.10 1999/08/14 16:40:23 tron Exp $ */
+/* $NetBSD: screen.c,v 1.11 1999/09/08 21:18:00 jsm Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -339,7 +339,7 @@ scr_end()
void
stop(why)
- char *why;
+ const char *why;
{
if (isset)
@@ -376,7 +376,7 @@ scr_update()
register regcell so, cur_so = 0;
register int i, ccol, j;
sigset_t sigset, osigset;
- static struct shape *lastshape;
+ static const struct shape *lastshape;
sigemptyset(&sigset);
sigaddset(&sigset, SIGTSTP);
diff --git a/tetris/shapes.c b/tetris/shapes.c
index 86309e24..86f249cc 100644
--- a/tetris/shapes.c
+++ b/tetris/shapes.c
@@ -1,4 +1,4 @@
-/* $NetBSD: shapes.c,v 1.3 1997/10/12 02:03:47 lukem Exp $ */
+/* $NetBSD: shapes.c,v 1.4 1999/09/08 21:18:01 jsm Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -56,7 +56,7 @@
#define BC B_COLS /* bottom center */
#define BR B_COLS+1 /* bottom right */
-struct shape shapes[] = {
+const struct shape shapes[] = {
/* 0*/ { 7, { TL, TC, MR, } },
/* 1*/ { 8, { TC, TR, ML, } },
/* 2*/ { 9, { ML, MR, BC, } },
@@ -84,7 +84,7 @@ struct shape shapes[] = {
*/
int
fits_in(shape, pos)
- struct shape *shape;
+ const struct shape *shape;
register int pos;
{
register int *o = shape->off;
@@ -101,7 +101,7 @@ fits_in(shape, pos)
*/
void
place(shape, pos, onoff)
- struct shape *shape;
+ const struct shape *shape;
register int pos, onoff;
{
register int *o = shape->off;
diff --git a/tetris/tetris.c b/tetris/tetris.c
index 82517b2c..3ffbe8ff 100644
--- a/tetris/tetris.c
+++ b/tetris/tetris.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.c,v 1.9 1999/03/22 06:12:23 abs Exp $ */
+/* $NetBSD: tetris.c,v 1.10 1999/09/08 21:18:01 jsm Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -117,7 +117,7 @@ main(argc, argv)
char *argv[];
{
register int pos, c;
- register char *keys;
+ register const char *keys;
register int level = 2;
char key_write[6][10];
int ch, i, j;
@@ -258,7 +258,7 @@ main(argc, argv)
}
if (c == keys[1]) {
/* turn */
- struct shape *new = &shapes[curshape->rot];
+ const struct shape *new = &shapes[curshape->rot];
if (fits_in(new, pos))
curshape = new;
diff --git a/tetris/tetris.h b/tetris/tetris.h
index d3aebd2c..97a28234 100644
--- a/tetris/tetris.h
+++ b/tetris/tetris.h
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.h,v 1.5 1999/01/03 17:13:51 hubertf Exp $ */
+/* $NetBSD: tetris.h,v 1.6 1999/09/08 21:18:01 jsm Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -129,11 +129,11 @@ struct shape {
int off[3]; /* offsets to other blots if center is at (0,0) */
};
-extern struct shape shapes[];
+extern const struct shape shapes[];
#define randshape() (&shapes[random() % 7])
-struct shape *curshape;
-struct shape *nextshape;
+const struct shape *curshape;
+const struct shape *nextshape;
/*
* Shapes fall at a rate faster than once per second.
@@ -170,6 +170,6 @@ int score; /* the obvious thing */
char key_msg[100];
int showpreview;
-int fits_in __P((struct shape *, int));
-void place __P((struct shape *, int, int));
-void stop __P((char *)) __attribute__((__noreturn__));
+int fits_in __P((const struct shape *, int));
+void place __P((const struct shape *, int, int));
+void stop __P((const char *)) __attribute__((__noreturn__));
diff --git a/trek/getpar.h b/trek/getpar.h
index abee7536..dbb83146 100644
--- a/trek/getpar.h
+++ b/trek/getpar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: getpar.h,v 1.5 1999/07/21 13:19:10 hubertf Exp $ */
+/* $NetBSD: getpar.h,v 1.6 1999/09/08 21:18:01 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,8 +38,8 @@
typedef void (*cmdfun) __P((int));
struct cvntab /* used for getcodpar() paramater list */
{
- char *abrev;
- char *full;
+ const char *abrev;
+ const char *full;
cmdfun value;
int value2;
};
diff --git a/worm/worm.c b/worm/worm.c
index 20a82dc7..53002881 100644
--- a/worm/worm.c
+++ b/worm/worm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: worm.c,v 1.12 1999/08/10 21:52:43 hubertf Exp $ */
+/* $NetBSD: worm.c,v 1.13 1999/09/08 21:18:01 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)worm.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: worm.c,v 1.12 1999/08/10 21:52:43 hubertf Exp $");
+__RCSID("$NetBSD: worm.c,v 1.13 1999/09/08 21:18:01 jsm Exp $");
#endif
#endif /* not lint */
@@ -83,7 +83,7 @@ char lastch;
char outbuf[BUFSIZ];
void crash __P((void)) __attribute__((__noreturn__));
-void display __P((struct body *, char));
+void display __P((const struct body *, char));
int main __P((int, char **));
void leave __P((int)) __attribute__((__noreturn__));
void life __P((void));
@@ -169,7 +169,7 @@ life()
void
display(pos, chr)
- struct body *pos;
+ const struct body *pos;
char chr;
{
wmove(tv, pos->y, pos->x);