diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-01-21 19:12:14 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-01-21 19:12:14 +0000 |
commit | 7a0881cf3134f24b0e2e04e075841298f05a1618 (patch) | |
tree | 707b2b84fce0c275dd0d658cb4054a7d7acf2acf /games/rogue | |
parent | 015a4179321bbc59cf34543034f1e859d4815555 (diff) |
make rogue const-correct, and fix one write-strings issue.
ok miod@
Diffstat (limited to 'games/rogue')
-rw-r--r-- | games/rogue/Makefile | 4 | ||||
-rw-r--r-- | games/rogue/hit.c | 12 | ||||
-rw-r--r-- | games/rogue/init.c | 13 | ||||
-rw-r--r-- | games/rogue/inventory.c | 14 | ||||
-rw-r--r-- | games/rogue/level.c | 6 | ||||
-rw-r--r-- | games/rogue/machdep.c | 10 | ||||
-rw-r--r-- | games/rogue/message.c | 6 | ||||
-rw-r--r-- | games/rogue/monster.c | 10 | ||||
-rw-r--r-- | games/rogue/move.c | 6 | ||||
-rw-r--r-- | games/rogue/object.c | 8 | ||||
-rw-r--r-- | games/rogue/pack.c | 8 | ||||
-rw-r--r-- | games/rogue/play.c | 6 | ||||
-rw-r--r-- | games/rogue/ring.c | 8 | ||||
-rw-r--r-- | games/rogue/rogue.h | 46 | ||||
-rw-r--r-- | games/rogue/room.c | 6 | ||||
-rw-r--r-- | games/rogue/save.c | 6 | ||||
-rw-r--r-- | games/rogue/throw.c | 6 | ||||
-rw-r--r-- | games/rogue/trap.c | 6 | ||||
-rw-r--r-- | games/rogue/use.c | 8 |
19 files changed, 95 insertions, 94 deletions
diff --git a/games/rogue/Makefile b/games/rogue/Makefile index 49b78c13466..17b747d85b1 100644 --- a/games/rogue/Makefile +++ b/games/rogue/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.9 2002/07/18 07:13:56 pjanzen Exp $ +# $OpenBSD: Makefile,v 1.10 2004/01/21 19:12:13 espie Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 PROG= rogue -CFLAGS+=-fwritable-strings + SRCS= hit.c init.c inventory.c level.c machdep.c main.c \ message.c monster.c move.c object.c pack.c play.c random.c ring.c \ room.c save.c score.c spec_hit.c throw.c trap.c use.c zap.c diff --git a/games/rogue/hit.c b/games/rogue/hit.c index 5fc5a69c611..aa95886d0d7 100644 --- a/games/rogue/hit.c +++ b/games/rogue/hit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hit.c,v 1.5 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: hit.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: hit.c,v 1.3 1995/04/22 10:27:30 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)hit.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: hit.c,v 1.5 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: hit.c,v 1.6 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -63,7 +63,7 @@ mon_hit(monster) object *monster; { short damage, hit_chance; - char *mn; + const char *mn; float minus; if (fight_monster && (monster != fight_monster)) { @@ -178,7 +178,7 @@ rogue_damage(d, monster, other) int get_damage(ds, r) - char *ds; + const char *ds; boolean r; { int i = 0, j, n, d, total = 0; @@ -231,7 +231,7 @@ get_w_damage(obj) int get_number(s) - char *s; + const char *s; { int i = 0; int total = 0; @@ -289,7 +289,7 @@ mon_damage(monster, damage) object *monster; short damage; { - char *mn; + const char *mn; short row, col; monster->hp_to_kill -= damage; diff --git a/games/rogue/init.c b/games/rogue/init.c index 5a34e161f1f..0448f574483 100644 --- a/games/rogue/init.c +++ b/games/rogue/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.8 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: init.c,v 1.9 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: init.c,v 1.4 1995/04/28 23:49:19 mycroft Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: init.c,v 1.8 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: init.c,v 1.9 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -67,8 +67,8 @@ boolean save_is_interactive = 1; boolean ask_quit = 1; boolean no_skull = 0; boolean passgo = 0; -char *error_file = "rogue.esave"; -char *byebye_string = "Okay, bye bye!"; +const char *error_file = "rogue.esave"; +const char *byebye_string = "Okay, bye bye!"; gid_t gid, egid; int @@ -180,7 +180,7 @@ player_init() void clean_up(estr) - char *estr; + const char *estr; { if (save_is_interactive) { if (init_curses) { @@ -341,7 +341,8 @@ env_get_value(s, e, add_blank) void init_str(str, dflt) - char **str, *dflt; + char **str; + const char *dflt; { if (!(*str)) { /* room.c:edit_opts() depends on length MAX_OPT_LEN + 2 */ diff --git a/games/rogue/inventory.c b/games/rogue/inventory.c index 8f09a89ccdd..151fe5216d7 100644 --- a/games/rogue/inventory.c +++ b/games/rogue/inventory.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inventory.c,v 1.7 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: inventory.c,v 1.8 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: inventory.c,v 1.3 1995/04/22 10:27:35 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)inventory.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: inventory.c,v 1.7 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: inventory.c,v 1.8 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -57,9 +57,9 @@ static const char rcsid[] = "$OpenBSD: inventory.c,v 1.7 2003/06/03 03:01:41 mil #include "rogue.h" boolean is_wood[WANDS]; -char *press_space = " --press space to continue--"; +const char *press_space = " --press space to continue--"; -char *wand_materials[WAND_MATERIALS] = { +const char *wand_materials[WAND_MATERIALS] = { "steel ", "bronze ", "gold ", @@ -93,7 +93,7 @@ char *wand_materials[WAND_MATERIALS] = { "wooden " }; -char *gems[GEMS] = { +const char *gems[GEMS] = { "diamond ", "stibotantalite ", "lapi-lazuli ", @@ -110,7 +110,7 @@ char *gems[GEMS] = { "garnet " }; -char *syllables[MAXSYLLABLES] = { +const char *syllables[MAXSYLLABLES] = { "blech ", "foo ", "barf ", @@ -157,7 +157,7 @@ char *syllables[MAXSYLLABLES] = { struct id_com_s { short com_char; - char *com_desc; + const char *com_desc; }; struct id_com_s com_id_tab[COMS] = { diff --git a/games/rogue/level.c b/games/rogue/level.c index b13a3cdbb8b..a4fb3841778 100644 --- a/games/rogue/level.c +++ b/games/rogue/level.c @@ -1,4 +1,4 @@ -/* $OpenBSD: level.c,v 1.6 2003/08/06 21:08:05 millert Exp $ */ +/* $OpenBSD: level.c,v 1.7 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: level.c,v 1.3 1995/04/22 10:27:37 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)level.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: level.c,v 1.6 2003/08/06 21:08:05 millert Exp $"; +static const char rcsid[] = "$OpenBSD: level.c,v 1.7 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -60,7 +60,7 @@ static const char rcsid[] = "$OpenBSD: level.c,v 1.6 2003/08/06 21:08:05 millert short cur_level = 0; short max_level = 1; short cur_room; -char *new_level_message = 0; +const char *new_level_message = 0; short party_room = NO_ROOM; short r_de; diff --git a/games/rogue/machdep.c b/games/rogue/machdep.c index 05b541881d9..757b2d0f44f 100644 --- a/games/rogue/machdep.c +++ b/games/rogue/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.9 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: machdep.c,v 1.10 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: machdep.c,v 1.5 1995/04/28 23:49:22 mycroft Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)machdep.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: machdep.c,v 1.9 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: machdep.c,v 1.10 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -142,7 +142,7 @@ md_ignore_signals() int md_get_file_id(fname) - char *fname; + const char *fname; { struct stat sbuf; @@ -252,7 +252,7 @@ md_gfmt(fname, rt_buf) boolean md_df(fname) - char *fname; + const char *fname; { if (unlink(fname)) { return(0); @@ -319,7 +319,7 @@ md_sleep(nsecs) char * md_getenv(name) - char *name; + const char *name; { char *value; diff --git a/games/rogue/message.c b/games/rogue/message.c index 9296ab6dd68..d15f4859448 100644 --- a/games/rogue/message.c +++ b/games/rogue/message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: message.c,v 1.10 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: message.c,v 1.11 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: message.c,v 1.5 1995/04/22 10:27:43 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)message.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: message.c,v 1.10 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: message.c,v 1.11 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -351,7 +351,7 @@ is_digit(ch) int r_index(str, ch, last) - char *str; + const char *str; int ch; boolean last; { diff --git a/games/rogue/monster.c b/games/rogue/monster.c index 5c7441871f6..33ffab12a42 100644 --- a/games/rogue/monster.c +++ b/games/rogue/monster.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monster.c,v 1.6 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: monster.c,v 1.7 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: monster.c,v 1.3 1995/04/22 10:27:45 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)monster.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: monster.c,v 1.6 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: monster.c,v 1.7 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ static const char rcsid[] = "$OpenBSD: monster.c,v 1.6 2003/06/03 03:01:41 mille object level_monsters; boolean mon_disappeared; -char *m_names[] = { +const char *m_names[] = { "aquator", "bat", "centaur", @@ -602,7 +602,7 @@ wake_room(rn, entering, row, col) } } -char * +const char * mon_name(monster) object *monster; { @@ -830,7 +830,7 @@ char gr_obj_char() { short r; - char *rs = "%!?]=/):*"; + const char *rs = "%!?]=/):*"; r = get_rand(0, 8); diff --git a/games/rogue/move.c b/games/rogue/move.c index 35d674103af..ba205444d84 100644 --- a/games/rogue/move.c +++ b/games/rogue/move.c @@ -1,4 +1,4 @@ -/* $OpenBSD: move.c,v 1.5 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: move.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: move.c,v 1.3 1995/04/22 10:27:47 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: move.c,v 1.5 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: move.c,v 1.6 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -57,7 +57,7 @@ static const char rcsid[] = "$OpenBSD: move.c,v 1.5 2003/06/03 03:01:41 millert short m_moves = 0; boolean jump = 0; -char *you_can_move_again = "you can move again"; +const char *you_can_move_again = "you can move again"; int one_move_rogue(dirch, pickup) diff --git a/games/rogue/object.c b/games/rogue/object.c index 97a5ccf775f..53aa464d9a0 100644 --- a/games/rogue/object.c +++ b/games/rogue/object.c @@ -1,4 +1,4 @@ -/* $OpenBSD: object.c,v 1.8 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: object.c,v 1.9 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: object.c,v 1.3 1995/04/22 10:27:50 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)object.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: object.c,v 1.8 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: object.c,v 1.9 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -291,11 +291,11 @@ free_stuff(objlist) } } -char * +const char * name_of(obj) const object *obj; { - char *retstring; + const char *retstring; switch(obj->what_is) { case SCROL: diff --git a/games/rogue/pack.c b/games/rogue/pack.c index 0d2bcdc4727..56c9314bab4 100644 --- a/games/rogue/pack.c +++ b/games/rogue/pack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pack.c,v 1.9 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: pack.c,v 1.10 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: pack.c,v 1.3 1995/04/22 10:27:54 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)pack.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: pack.c,v 1.9 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: pack.c,v 1.10 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -55,7 +55,7 @@ static const char rcsid[] = "$OpenBSD: pack.c,v 1.9 2003/06/03 03:01:41 millert #include "rogue.h" -char *curse_message = "you can't, it appears to be cursed"; +const char *curse_message = "you can't, it appears to be cursed"; object * add_to_pack(obj, pack, condense) @@ -277,7 +277,7 @@ wait_for_ack() short pack_letter(prompt, mask) - char *prompt; + const char *prompt; unsigned short mask; { short ch; diff --git a/games/rogue/play.c b/games/rogue/play.c index df5a21215fd..6f7cfecf90e 100644 --- a/games/rogue/play.c +++ b/games/rogue/play.c @@ -1,4 +1,4 @@ -/* $OpenBSD: play.c,v 1.5 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: play.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: play.c,v 1.3 1995/04/22 10:28:04 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)play.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: play.c,v 1.5 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: play.c,v 1.6 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -56,7 +56,7 @@ static const char rcsid[] = "$OpenBSD: play.c,v 1.5 2003/06/03 03:01:41 millert #include "rogue.h" boolean interrupted = 0; -char *unknown_command = "unknown command"; +const char *unknown_command = "unknown command"; void play_level() diff --git a/games/rogue/ring.c b/games/rogue/ring.c index bdb593d966c..0f8ea99f1a3 100644 --- a/games/rogue/ring.c +++ b/games/rogue/ring.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ring.c,v 1.5 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: ring.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */ /* * Copyright (c) 1988, 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)ring.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: ring.c,v 1.5 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: ring.c,v 1.6 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -54,8 +54,8 @@ static const char rcsid[] = "$OpenBSD: ring.c,v 1.5 2003/06/03 03:01:41 millert #include "rogue.h" -char *left_or_right = "left or right hand?"; -char *no_ring = "there's no ring on that hand"; +const char *left_or_right = "left or right hand?"; +const char *no_ring = "there's no ring on that hand"; short stealthy; short r_rings; short add_strength; diff --git a/games/rogue/rogue.h b/games/rogue/rogue.h index 31d92f55c2a..22493236cb2 100644 --- a/games/rogue/rogue.h +++ b/games/rogue/rogue.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rogue.h,v 1.13 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: rogue.h,v 1.14 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: rogue.h,v 1.4 1995/04/24 12:25:04 cgd Exp $ */ /* @@ -220,8 +220,8 @@ struct id { #define next_monster next_object struct obj { /* comment is monster meaning */ - unsigned long m_flags; /* monster flags */ - char *damage; /* damage it does */ + unsigned long m_flags; /* monster flags */ + const char *damage; /* damage it does */ short quantity; /* hit points to kill */ short ichar; /* 'A' is for aquatar */ short kill_exp; /* exp for killing it */ @@ -447,17 +447,17 @@ struct rogue_time { object *alloc_object(void); object *check_duplicate(object *, object *); -char *get_ench_color(void); +const char *get_ench_color(void); object *get_letter_object(int); object *get_thrown_at_monster(object *, short, short *, short *); object *get_zapped_monster(short, short *, short *); object *gr_monster(object *, int); object *gr_object(void); -char *md_getenv(char *); +char *md_getenv(const char *); char *md_gln(void); char *md_malloc(int); -char *mon_name(object *); -char *name_of(const object *); +const char *mon_name(object *); +const char *name_of(const object *); object *object_at(object *, short, short); object *pick_up(short, short, short *); void add_exp(int, boolean); @@ -477,7 +477,7 @@ boolean check_hunger(boolean); boolean check_imitator(object *); void check_message(void); int check_up(void); -void clean_up(char *); +void clean_up(const char *); void clear_level(void); void cnfs(void); int coin_toss(void); @@ -515,7 +515,7 @@ void free_stuff(object *); void freeze(object *); int get_armor_class(const object *); int get_com_id(int *, short); -int get_damage(char *, boolean); +int get_damage(const char *, boolean); void get_desc(const object *, char *, size_t); int get_dir(short, short, short, short); void get_dir_rc(short, short *, short *, short); @@ -525,7 +525,7 @@ void get_food(object *, boolean); int get_hit_chance(object *); int get_input_line(const char *, const char *, char *, size_t, const char *, boolean, boolean); char get_mask_char(unsigned short); -int get_number(char *); +int get_number(const char *); boolean get_oth_room(short, short *, short *); int get_rand(int, int); short get_room_number(short, short); @@ -560,7 +560,7 @@ void id_type(void); void idntfy(void); boolean imitating(short, short); int init(int, char **); -void init_str(char **, char *); +void init_str(char **, const char *); void inv_armor_weapon(boolean); void inv_rings(void); void inventory(object *, unsigned short); @@ -582,10 +582,10 @@ void make_room(short, short, short, short); void make_scroll_titles(void); boolean mask_pack(object *, unsigned short); boolean mask_room(short, short *, short *, unsigned short); -boolean md_df(char *); +boolean md_df(const char *); void md_exit(int); void md_gct(struct rogue_time *); -int md_get_file_id(char *); +int md_get_file_id(const char *); void md_gfmt(char *, struct rogue_time *); int md_gseed(void); void md_heed_signals(void); @@ -623,7 +623,7 @@ void opt_erase(int); void opt_go(int); void opt_show(int); short pack_count(object *); -short pack_letter(char *, unsigned short); +short pack_letter(const char *, unsigned short); void party_monsters(int, int); short party_objects(int); void place_at(object *, short, short); @@ -646,7 +646,7 @@ void put_scores(const object *, short); void put_stairs(void); void quaff(void); void quit(boolean); -int r_index(char *, int, boolean); +int r_index(const char *, int, boolean); void rand_around(short, short *, short *); int rand_percent(int); void rand_place(object *); @@ -670,7 +670,7 @@ void s_con_mon(object *); int same_col(int, int); int same_row(int, int); void save_game(void); -void save_into_file(char *); +void save_into_file(const char *); void save_screen(void); void search(short, boolean); boolean seek_gold(object *); @@ -754,17 +754,17 @@ extern char hit_message[HIT_MESSAGE_LEN]; extern char hunger_str[HUNGER_STR_LEN]; #define LOGIN_NAME_LEN 40 extern char login_name[LOGIN_NAME_LEN]; -extern char *byebye_string; -extern char *curse_message; -extern char *error_file; +extern const char *byebye_string; +extern const char *curse_message; +extern const char *error_file; extern char *fruit; -extern char *m_names[]; +extern const char *m_names[]; extern const char *more; -extern char *new_level_message; +extern const char *new_level_message; extern char *nick_name; -extern char *press_space; +extern const char *press_space; extern char *save_file; -extern char *you_can_move_again; +extern const char *you_can_move_again; extern long level_points[]; extern short add_strength; extern short auto_search; diff --git a/games/rogue/room.c b/games/rogue/room.c index 03bde944956..44382a78b85 100644 --- a/games/rogue/room.c +++ b/games/rogue/room.c @@ -1,4 +1,4 @@ -/* $OpenBSD: room.c,v 1.7 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: room.c,v 1.8 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: room.c,v 1.3 1995/04/22 10:28:17 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)room.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: room.c,v 1.7 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: room.c,v 1.8 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -658,7 +658,7 @@ opt_go(i) void do_shell() { - char *sh; + const char *sh; md_ignore_signals(); if (!(sh = md_getenv("SHELL"))) { diff --git a/games/rogue/save.c b/games/rogue/save.c index 6f309ee80dd..cbc67406325 100644 --- a/games/rogue/save.c +++ b/games/rogue/save.c @@ -1,4 +1,4 @@ -/* $OpenBSD: save.c,v 1.9 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: save.c,v 1.10 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: save.c,v 1.3 1995/04/22 10:28:21 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: save.c,v 1.9 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: save.c,v 1.10 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -92,7 +92,7 @@ save_game() void save_into_file(sfile) - char *sfile; + const char *sfile; { int fp; int file_id; diff --git a/games/rogue/throw.c b/games/rogue/throw.c index f86a5f85f28..017a3d85333 100644 --- a/games/rogue/throw.c +++ b/games/rogue/throw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: throw.c,v 1.6 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: throw.c,v 1.7 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: throw.c,v 1.3 1995/04/22 10:28:32 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)throw.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: throw.c,v 1.6 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: throw.c,v 1.7 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -262,7 +262,7 @@ void rand_around(i, r, c) short i, *r, *c; { - static char* pos = "\010\007\001\003\004\005\002\006\0"; + static char pos[] = "\010\007\001\003\004\005\002\006\0"; static short row, col; short j; diff --git a/games/rogue/trap.c b/games/rogue/trap.c index 85d11330829..c14da8b9080 100644 --- a/games/rogue/trap.c +++ b/games/rogue/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.5 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: trap.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: trap.c,v 1.3 1995/04/22 10:28:35 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)trap.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: trap.c,v 1.5 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: trap.c,v 1.6 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -59,7 +59,7 @@ trap traps[MAX_TRAPS]; boolean trap_door = 0; short bear_trap = 0; -char *trap_strings[TRAPS * 2] = { +const char *trap_strings[TRAPS * 2] = { "trap door", "you fell down a trap", "bear trap", diff --git a/games/rogue/use.c b/games/rogue/use.c index a27ced4c1da..af359630ea7 100644 --- a/games/rogue/use.c +++ b/games/rogue/use.c @@ -1,4 +1,4 @@ -/* $OpenBSD: use.c,v 1.6 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: use.c,v 1.7 2004/01/21 19:12:13 espie Exp $ */ /* $NetBSD: use.c,v 1.3 1995/04/22 10:28:38 cgd Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)use.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: use.c,v 1.6 2003/06/03 03:01:41 millert Exp $"; +static const char rcsid[] = "$OpenBSD: use.c,v 1.7 2004/01/21 19:12:13 espie Exp $"; #endif #endif /* not lint */ @@ -64,7 +64,7 @@ boolean see_invisible = 0; short extra_hp = 0; boolean detect_monster = 0; boolean con_mon = 0; -char *strange_feeling = "you have a strange feeling for a moment, then it passes"; +const char *strange_feeling = "you have a strange feeling for a moment, then it passes"; void quaff() @@ -580,7 +580,7 @@ go_blind() mvaddch(rogue.row, rogue.col, rogue.fchar); } -char * +const char * get_ench_color() { if (halluc) { |