Mercurial > hg > early-roguelike
changeset 304:e52a8a7ad4c5
Fix many compiler warnings.
There should only be two changes in behavior:
arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly
applied to characters who are not monks instead of monks who are not
empty-handed.
urogue/fight.c: fixed an interaction with the "debug" macro that could
cause the wrong message to be displayed.
line wrap: on
line diff
--- a/arogue5/chase.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/chase.c Wed Apr 14 18:55:33 2021 -0400 @@ -65,7 +65,7 @@ /* Is it OK to move there? */ if (step_ok(y, x, NOMONST, tp) && - (!isatrap(mvwinch(cw, y, x)) || + (!isatrap(CCHAR( mvwinch(cw, y, x) )) || rnd(10) >= tp->t_stats.s_intel || on(*tp, ISFLY))) { /* OK, we can go here. But don't go there if
--- a/arogue5/command.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/command.c Wed Apr 14 18:55:33 2021 -0400 @@ -921,7 +921,7 @@ } else know = (bool *) 0; } - if ((obj->o_flags & ISPOST) || (know && know[obj->o_which]) && !mark) { + if ((obj->o_flags & ISPOST) || (know && know[obj->o_which] && !mark)) { msg("That has already been identified."); return; }
--- a/arogue5/main.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/main.c Wed Apr 14 18:55:33 2021 -0400 @@ -50,9 +50,11 @@ main(int argc, char *argv[], char *envp[]) { register char *env; +#ifndef SCOREFILE char *roguedir; roguedir = md_getroguedir(); +#endif md_init(); /*
--- a/arogue5/mdport.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/mdport.c Wed Apr 14 18:55:33 2021 -0400 @@ -112,7 +112,9 @@ # define SE exit_standout_mode #endif +#ifdef _WIN32 static int md_standout_mode = 0; +#endif void md_raw_standout(void) @@ -292,7 +294,9 @@ #endif if ( (h == NULL) || (*h == '\0') ) + { if ( (h = getenv("HOME")) == NULL ) + { if ( (h = getenv("HOMEDRIVE")) == NULL) h = ""; else @@ -303,6 +307,8 @@ if ( (h = getenv("HOMEPATH")) == NULL) h = ""; } + } + } len = strlen(homedir); @@ -375,7 +381,7 @@ */ setuid(getuid()); setgid(getgid()); - execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", 0); + execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", (char *) NULL); perror("No shelly"); _exit(-1); }
--- a/arogue5/misc.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/misc.c Wed Apr 14 18:55:33 2021 -0400 @@ -447,10 +447,9 @@ { register struct object *obj = NULL; register struct linked_list *item = NULL; - bool cursed, blessed, is_mm; + bool is_mm; char buf[LINELEN]; - cursed = FALSE; is_mm = FALSE; if (which < 0) { /* A real miscellaneous magic item */ @@ -463,8 +462,6 @@ return; obj = OBJPTR(item); - cursed = (obj->o_flags & ISCURSED) != 0; - blessed = (obj->o_flags & ISBLESSED) != 0; which = obj->o_which; }
--- a/arogue5/monsters.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/monsters.c Wed Apr 14 18:55:33 2021 -0400 @@ -730,14 +730,12 @@ register struct room *trp; register const char *mname; bool nasty; /* Will the monster "attack"? */ - char ch; if ((it = find_mons(y, x)) == NULL) { msg("Can't find monster in show"); return (NULL); } tp = THINGPTR(it); - ch = tp->t_type; trp = roomin(&tp->t_pos); /* Current room for monster */ mname = monsters[tp->t_index].m_name;