From d91aeebe629b8428e564df33c93bb69195d28cc3 Mon Sep 17 00:00:00 2001 From: hubertf Date: Wed, 21 Jul 1999 13:19:10 +0000 Subject: const poisoning Patch submitted in PR 8039 by Joseph Myers --- trek/computer.c | 6 +++--- trek/externs.c | 8 ++++---- trek/getpar.c | 32 ++++++++++++++++---------------- trek/getpar.h | 12 ++++++------ trek/help.c | 6 +++--- trek/kill.c | 6 +++--- trek/lose.c | 6 +++--- trek/out.c | 6 +++--- trek/phaser.c | 6 +++--- trek/play.c | 8 ++++---- trek/setup.c | 10 +++++----- trek/shield.c | 10 +++++----- trek/srscan.c | 10 +++++----- trek/systemname.c | 10 +++++----- trek/trek.h | 18 +++++++++--------- trek/win.c | 6 +++--- 16 files changed, 80 insertions(+), 80 deletions(-) (limited to 'trek') diff --git a/trek/computer.c b/trek/computer.c index 7c661236..cb08ae6d 100644 --- a/trek/computer.c +++ b/trek/computer.c @@ -1,4 +1,4 @@ -/* $NetBSD: computer.c,v 1.5 1997/10/12 21:24:34 christos Exp $ */ +/* $NetBSD: computer.c,v 1.6 1999/07/21 13:19:10 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)computer.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: computer.c,v 1.5 1997/10/12 21:24:34 christos Exp $"); +__RCSID("$NetBSD: computer.c,v 1.6 1999/07/21 13:19:10 hubertf Exp $"); #endif #endif /* not lint */ @@ -118,7 +118,7 @@ computer(v) int ix, iy; int i, j; int tqx, tqy; - struct cvntab *r; + const struct cvntab *r; int cost; int course; double dist, time; diff --git a/trek/externs.c b/trek/externs.c index 00b61408..cc00600c 100644 --- a/trek/externs.c +++ b/trek/externs.c @@ -1,4 +1,4 @@ -/* $NetBSD: externs.c,v 1.4 1997/10/12 21:24:48 christos Exp $ */ +/* $NetBSD: externs.c,v 1.5 1999/07/21 13:19:10 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)externs.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: externs.c,v 1.4 1997/10/12 21:24:48 christos Exp $"); +__RCSID("$NetBSD: externs.c,v 1.5 1999/07/21 13:19:10 hubertf Exp $"); #endif #endif /* not lint */ @@ -48,7 +48,7 @@ __RCSID("$NetBSD: externs.c,v 1.4 1997/10/12 21:24:48 christos Exp $"); ** global variable definitions */ -struct device Device[NDEV] = +const struct device Device[NDEV] = { { "warp drive", "Scotty" }, { "S.R. scanners", "Scotty" }, @@ -68,7 +68,7 @@ struct device Device[NDEV] = { "*ERR 15*", "Nobody" } }; -char *Systemname[NINHAB] = +const char *const Systemname[NINHAB] = { "ERROR", "Talos IV", diff --git a/trek/getpar.c b/trek/getpar.c index c35cd90d..df0c820b 100644 --- a/trek/getpar.c +++ b/trek/getpar.c @@ -1,4 +1,4 @@ -/* $NetBSD: getpar.c,v 1.6 1997/10/13 22:12:01 cjs Exp $ */ +/* $NetBSD: getpar.c,v 1.7 1999/07/21 13:19:10 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)getpar.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getpar.c,v 1.6 1997/10/13 22:12:01 cjs Exp $"); +__RCSID("$NetBSD: getpar.c,v 1.7 1999/07/21 13:19:10 hubertf Exp $"); #endif #endif /* not lint */ @@ -55,7 +55,7 @@ static int testterm __P((void)); int getintpar(s) -char *s; + const char *s; { int i; int n; @@ -79,7 +79,7 @@ char *s; **/ double getfltpar(s) -char *s; + const char *s; { int i; double d; @@ -102,7 +102,7 @@ char *s; ** get yes/no parameter **/ -struct cvntab Yntab[] = +const struct cvntab Yntab[] = { { "y", "es", (cmdfun)1, 1 }, { "n", "o", (cmdfun)0, 0 }, @@ -111,9 +111,9 @@ struct cvntab Yntab[] = int getynpar(s) -char *s; + const char *s; { - struct cvntab *r; + const struct cvntab *r; r = getcodpar(s, Yntab); return r->value2; @@ -124,14 +124,14 @@ char *s; ** get coded parameter **/ -struct cvntab *getcodpar(s, tab) -char *s; -struct cvntab tab[]; +const struct cvntab *getcodpar(s, tab) + const char *s; + const struct cvntab tab[]; { char input[100]; - struct cvntab *r; + const struct cvntab *r; int flag; - char *p, *q; + const char *p, *q; int c; int f; @@ -204,10 +204,10 @@ struct cvntab tab[]; void getstrpar(s, r, l, t) -char *s; -char *r; -int l; -char *t; + const char *s; + char *r; + int l; + const char *t; { int i; char format[20]; diff --git a/trek/getpar.h b/trek/getpar.h index e0e480fa..abee7536 100644 --- a/trek/getpar.h +++ b/trek/getpar.h @@ -1,4 +1,4 @@ -/* $NetBSD: getpar.h,v 1.4 1997/10/12 21:24:51 christos Exp $ */ +/* $NetBSD: getpar.h,v 1.5 1999/07/21 13:19:10 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -44,11 +44,11 @@ struct cvntab /* used for getcodpar() paramater list */ int value2; }; -int getintpar __P((char *)); -double getfltpar __P((char *)); -int getynpar __P((char *)); -struct cvntab *getcodpar __P((char *, struct cvntab[])); -void getstrpar __P((char *, char *, int, char *)); +int getintpar __P((const char *)); +double getfltpar __P((const char *)); +int getynpar __P((const char *)); +const struct cvntab *getcodpar __P((const char *, const struct cvntab[])); +void getstrpar __P((const char *, char *, int, const char *)); int testnl __P((void)); void skiptonl __P((int)); int readdelim __P((int)); diff --git a/trek/help.c b/trek/help.c index bedafcfd..d2696a22 100644 --- a/trek/help.c +++ b/trek/help.c @@ -1,4 +1,4 @@ -/* $NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $ */ +/* $NetBSD: help.c,v 1.5 1999/07/21 13:19:10 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)help.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $"); +__RCSID("$NetBSD: help.c,v 1.5 1999/07/21 13:19:10 hubertf Exp $"); #endif #endif /* not lint */ @@ -67,7 +67,7 @@ __RCSID("$NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $"); ** to drop you. After that, it's your problem. */ -char *Cntvect[3] = +const char *const Cntvect[3] = {"first", "second", "third"}; /*ARGSUSED*/ diff --git a/trek/kill.c b/trek/kill.c index 745ccfc6..1cf12a37 100644 --- a/trek/kill.c +++ b/trek/kill.c @@ -1,4 +1,4 @@ -/* $NetBSD: kill.c,v 1.5 1998/08/30 09:19:40 veego Exp $ */ +/* $NetBSD: kill.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kill.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: kill.c,v 1.5 1998/08/30 09:19:40 veego Exp $"); +__RCSID("$NetBSD: kill.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -158,7 +158,7 @@ int f; /* f != 0 -- this quad; f < 0 -- Enterprise's fault */ { struct quad *q; struct event *e; - char *name; + const char *name; if (f) { diff --git a/trek/lose.c b/trek/lose.c index 4f0fac76..7dcf9ce4 100644 --- a/trek/lose.c +++ b/trek/lose.c @@ -1,4 +1,4 @@ -/* $NetBSD: lose.c,v 1.4 1997/10/12 21:24:58 christos Exp $ */ +/* $NetBSD: lose.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)lose.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: lose.c,v 1.4 1997/10/12 21:24:58 christos Exp $"); +__RCSID("$NetBSD: lose.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -56,7 +56,7 @@ __RCSID("$NetBSD: lose.c,v 1.4 1997/10/12 21:24:58 christos Exp $"); ** actions which need be taken are taken. */ -char *Losemsg[] = +const char *const Losemsg[] = { "You ran out of time", "You ran out of energy", diff --git a/trek/out.c b/trek/out.c index 1e6dc0c0..c7ac084d 100644 --- a/trek/out.c +++ b/trek/out.c @@ -1,4 +1,4 @@ -/* $NetBSD: out.c,v 1.5 1997/10/13 22:20:35 cjs Exp $ */ +/* $NetBSD: out.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)out.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: out.c,v 1.5 1997/10/13 22:20:35 cjs Exp $"); +__RCSID("$NetBSD: out.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -54,7 +54,7 @@ void out(dev) int dev; { - struct device *d; + const struct device *d; d = &Device[dev]; printf("%s reports %s ", d->person, d->name); diff --git a/trek/phaser.c b/trek/phaser.c index 8c06ff2e..8273fe8b 100644 --- a/trek/phaser.c +++ b/trek/phaser.c @@ -1,4 +1,4 @@ -/* $NetBSD: phaser.c,v 1.5 1997/10/12 21:25:06 christos Exp $ */ +/* $NetBSD: phaser.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)phaser.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: phaser.c,v 1.5 1997/10/12 21:25:06 christos Exp $"); +__RCSID("$NetBSD: phaser.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -113,7 +113,7 @@ phaser(v) int n; int hitreqd[NBANKS]; struct banks bank[NBANKS]; - struct cvntab *ptr; + const struct cvntab *ptr; if (Ship.cond == DOCKED) { printf("Phasers cannot fire through starbase shields\n"); diff --git a/trek/play.c b/trek/play.c index d0f83e01..fe1f2200 100644 --- a/trek/play.c +++ b/trek/play.c @@ -1,4 +1,4 @@ -/* $NetBSD: play.c,v 1.4 1997/10/12 21:25:07 christos Exp $ */ +/* $NetBSD: play.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)play.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: play.c,v 1.4 1997/10/12 21:25:07 christos Exp $"); +__RCSID("$NetBSD: play.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -58,7 +58,7 @@ __RCSID("$NetBSD: play.c,v 1.4 1997/10/12 21:25:07 christos Exp $"); ** on how we are doing after the move. */ -struct cvntab Comtab[] = +const struct cvntab Comtab[] = { { "abandon", "", abandon, 0 }, { "ca", "pture", capture, 0 }, @@ -99,7 +99,7 @@ myreset(v) void play() { - struct cvntab *r; + const struct cvntab *r; while (1) { diff --git a/trek/setup.c b/trek/setup.c index 6e381be5..f2596371 100644 --- a/trek/setup.c +++ b/trek/setup.c @@ -1,4 +1,4 @@ -/* $NetBSD: setup.c,v 1.5 1997/10/12 21:25:15 christos Exp $ */ +/* $NetBSD: setup.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 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/12 21:25:15 christos Exp $"); +__RCSID("$NetBSD: setup.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -61,7 +61,7 @@ __RCSID("$NetBSD: setup.c,v 1.5 1997/10/12 21:25:15 christos Exp $"); ** Game restart and tournament games are handled here. */ -struct cvntab Lentab[] = +const struct cvntab Lentab[] = { { "s", "hort", (cmdfun)1, 0 }, { "m", "edium", (cmdfun)2, 0 }, @@ -70,7 +70,7 @@ struct cvntab Lentab[] = { NULL, NULL, NULL, 0 } }; -struct cvntab Skitab[] = +const struct cvntab Skitab[] = { { "n", "ovice", (cmdfun)1, 0 }, { "f", "air", (cmdfun)2, 0 }, @@ -84,7 +84,7 @@ struct cvntab Skitab[] = void setup() { - struct cvntab *r; + const struct cvntab *r; int i, j; double f; int d; diff --git a/trek/shield.c b/trek/shield.c index 135fa589..c9a53520 100644 --- a/trek/shield.c +++ b/trek/shield.c @@ -1,4 +1,4 @@ -/* $NetBSD: shield.c,v 1.6 1998/08/30 09:19:40 veego Exp $ */ +/* $NetBSD: shield.c,v 1.7 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)shield.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: shield.c,v 1.6 1998/08/30 09:19:40 veego Exp $"); +__RCSID("$NetBSD: shield.c,v 1.7 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -63,7 +63,7 @@ __RCSID("$NetBSD: shield.c,v 1.6 1998/08/30 09:19:40 veego Exp $"); ** so you get partial hits. */ -struct cvntab Udtab[] = +const struct cvntab Udtab[] = { { "u", "p", (cmdfun)1, 0 }, { "d", "own", (cmdfun)0, 0 }, @@ -75,9 +75,9 @@ shield(f) int f; { int i; - struct cvntab *r; + const struct cvntab *r; char s[100]; - char *device, *dev2, *dev3; + const char *device, *dev2, *dev3; int ind; char *stat; diff --git a/trek/srscan.c b/trek/srscan.c index be86d140..7456d233 100644 --- a/trek/srscan.c +++ b/trek/srscan.c @@ -1,4 +1,4 @@ -/* $NetBSD: srscan.c,v 1.4 1997/10/12 21:25:19 christos Exp $ */ +/* $NetBSD: srscan.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)srscan.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: srscan.c,v 1.4 1997/10/12 21:25:19 christos Exp $"); +__RCSID("$NetBSD: srscan.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -61,7 +61,7 @@ __RCSID("$NetBSD: srscan.c,v 1.4 1997/10/12 21:25:19 christos Exp $"); ** The current quadrant is filled in on the computer chart. */ -char *Color[4] = +const char *const Color[4] = { "GREEN", "DOCKED", @@ -75,10 +75,10 @@ int f; { int i, j; int statinfo; - char *s; + const char *s; int percent; struct quad *q = NULL; - struct cvntab *p; + const struct cvntab *p; if (f >= 0 && check_out(SRSCAN)) { diff --git a/trek/systemname.c b/trek/systemname.c index bb37d5ca..74ca7774 100644 --- a/trek/systemname.c +++ b/trek/systemname.c @@ -1,4 +1,4 @@ -/* $NetBSD: systemname.c,v 1.4 1997/10/12 21:25:21 christos Exp $ */ +/* $NetBSD: systemname.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)systemname.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: systemname.c,v 1.4 1997/10/12 21:25:21 christos Exp $"); +__RCSID("$NetBSD: systemname.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -55,10 +55,10 @@ __RCSID("$NetBSD: systemname.c,v 1.4 1997/10/12 21:25:21 christos Exp $"); ** starsystems, etc. */ -char *systemname(q1) -struct quad *q1; +const char *systemname(q1) + const struct quad *q1; { - struct quad *q; + const struct quad *q; int i; q = q1; diff --git a/trek/trek.h b/trek/trek.h index 8b96d880..a5686e7e 100644 --- a/trek/trek.h +++ b/trek/trek.h @@ -1,4 +1,4 @@ -/* $NetBSD: trek.h,v 1.5 1997/10/12 21:25:23 christos Exp $ */ +/* $NetBSD: trek.h,v 1.6 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -90,7 +90,7 @@ struct quad /* definition for each quadrant */ */ /* ascii names of systems */ -extern char *Systemname[NINHAB]; +extern const char *const Systemname[NINHAB]; /* quadrant definition */ struct quad Quad[NQUADS][NQUADS]; @@ -133,11 +133,11 @@ char Sect[NSECTS][NSECTS]; /* device names */ struct device { - char *name; /* device name */ - char *person; /* the person who fixes it */ + const char *name; /* device name */ + const char *person; /* the person who fixes it */ }; -struct device Device[NDEV]; +const struct device Device[NDEV]; /*************************** EVENTS ****************************/ @@ -215,8 +215,8 @@ struct xy }; -extern struct cvntab Skitab[]; -extern struct cvntab Lentab[]; +extern const struct cvntab Skitab[]; +extern const struct cvntab Lentab[]; /* * note that much of the stuff in the following structs CAN NOT @@ -245,7 +245,7 @@ struct int secty; /* sector y coord */ unsigned char cond; /* condition code */ char sinsbad; /* Space Inertial Navigation System condition */ - char *shipname; /* name of current starship */ + const char *shipname; /* name of current starship */ char ship; /* current starship */ int distressed; /* number of distress calls */ } Ship; @@ -516,7 +516,7 @@ void snova __P((int, int )); void srscan __P((int)); /* systemname.c */ -char *systemname __P((struct quad *)); +const char *systemname __P((const struct quad *)); /* torped.c */ void torped __P((int)); diff --git a/trek/win.c b/trek/win.c index 64be2331..af12d5a5 100644 --- a/trek/win.c +++ b/trek/win.c @@ -1,4 +1,4 @@ -/* $NetBSD: win.c,v 1.4 1997/10/12 21:25:28 christos Exp $ */ +/* $NetBSD: win.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)win.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: win.c,v 1.4 1997/10/12 21:25:28 christos Exp $"); +__RCSID("$NetBSD: win.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $"); #endif #endif /* not lint */ @@ -65,7 +65,7 @@ void win() { long s; - struct cvntab *p = NULL; + const struct cvntab *p = NULL; extern jmp_buf env; sleep(1); -- cgit v1.2.3-56-ge451