Fix compiler warnings.

This commit is contained in:
Eric S. Raymond 2017-06-13 14:33:19 -04:00
parent bfa06be62d
commit bd35d47139
2 changed files with 5 additions and 7 deletions

View file

@ -177,6 +177,7 @@ static int blast(void)
game.bonus=135; game.bonus=135;
RSPEAK(game.bonus); RSPEAK(game.bonus);
score(0); score(0);
return GO_CLEAROBJ; /* pacify compiler - we never get here */
} }
static int vbreak(token_t verb, token_t obj) static int vbreak(token_t verb, token_t obj)
@ -234,9 +235,9 @@ static int carry(token_t verb, token_t obj)
if (obj == RUG && game.prop[RUG] == 2)spk=222; if (obj == RUG && game.prop[RUG] == 2)spk=222;
if (obj == SIGN)spk=196; if (obj == SIGN)spk=196;
if (obj == MESSAG) { if (obj == MESSAG) {
spk=190; RSPEAK(190);
return GO_CLEAROBJ;
DSTROY(MESSAG); DSTROY(MESSAG);
return GO_CLEAROBJ;
} }
if (game.fixed[obj] != 0) { if (game.fixed[obj] != 0) {
RSPEAK(spk); RSPEAK(spk);

7
main.c
View file

@ -264,7 +264,7 @@ bool spotted_by_pirate(int i)
/* The pirate's spotted him. He leaves him alone once we've /* The pirate's spotted him. He leaves him alone once we've
* found chest. K counts if a treasure is here. If not, and * found chest. K counts if a treasure is here. If not, and
* tally=1 for an unseen chest, let the pirate be spotted. * tally=1 for an unseen chest, let the pirate be spotted.
* Note that game.place(CHEST)=0 might mean that he's thrown * Note that game.place[CHEST]=0 might mean that he's thrown
* it to the troll, but in that case he's seen the chest * it to the troll, but in that case he's seen the chest
* (game.prop=0). */ * (game.prop=0). */
if (game.loc == game.chloc || game.prop[CHEST] >= 0) if (game.loc == game.chloc || game.prop[CHEST] >= 0)
@ -273,9 +273,7 @@ bool spotted_by_pirate(int i)
for (int j=MINTRS; j<=MAXTRS; j++) { for (int j=MINTRS; j<=MAXTRS; j++) {
/* Pirate won't take pyramid from plover room or dark /* Pirate won't take pyramid from plover room or dark
* room (too easy!). */ * room (too easy!). */
if (j == PYRAM && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD])) { if (j==PYRAM && (game.loc==PLAC[PYRAM] || game.loc==PLAC[EMRALD])) {
if (HERE(j))
k=1;
return true; return true;
} }
if (TOTING(j)) { if (TOTING(j)) {
@ -297,7 +295,6 @@ bool spotted_by_pirate(int i)
game.dloc[PIRATE]=game.chloc; game.dloc[PIRATE]=game.chloc;
game.odloc[PIRATE]=game.chloc; game.odloc[PIRATE]=game.chloc;
game.dseen[PIRATE]=false; game.dseen[PIRATE]=false;
return true; return true;
} }
if (HERE(j)) if (HERE(j))