diff options
author | billf <billf@FreeBSD.org> | 1999-09-07 06:00:03 +0000 |
---|---|---|
committer | billf <billf@FreeBSD.org> | 1999-09-07 06:00:03 +0000 |
commit | 3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4 (patch) | |
tree | a392a79dd376bd7e8273e85fac9e7af604437b66 | |
parent | 33adb981d4021526b69c31fe25c2fc524378289f (diff) | |
download | FreeBSD-src-3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4.zip FreeBSD-src-3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4.tar.gz |
Avoid ambigious if() if() else().
-rw-r--r-- | games/battlestar/com5.c | 3 | ||||
-rw-r--r-- | games/cribbage/crib.c | 3 | ||||
-rw-r--r-- | games/cribbage/score.c | 6 | ||||
-rw-r--r-- | games/hack/hack.read.c | 3 | ||||
-rw-r--r-- | games/hack/hack.trap.c | 3 | ||||
-rw-r--r-- | games/larn/main.c | 6 | ||||
-rw-r--r-- | games/larn/monster.c | 6 | ||||
-rw-r--r-- | games/phantasia/fight.c | 6 | ||||
-rw-r--r-- | games/phantasia/misc.c | 2 | ||||
-rw-r--r-- | games/sail/dr_1.c | 9 | ||||
-rw-r--r-- | games/sail/pl_3.c | 12 | ||||
-rw-r--r-- | games/sail/pl_7.c | 6 | ||||
-rw-r--r-- | games/sail/sync.c | 9 | ||||
-rw-r--r-- | games/trek/move.c | 2 | ||||
-rw-r--r-- | games/wump/wump.c | 8 |
15 files changed, 59 insertions, 25 deletions
diff --git a/games/battlestar/com5.c b/games/battlestar/com5.c index 7d41bb0..d53bcab 100644 --- a/games/battlestar/com5.c +++ b/games/battlestar/com5.c @@ -82,7 +82,7 @@ love() while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects,wordvalue[wordnumber])){ - if (wordvalue[wordnumber] == NORMGOD && !loved) + if (wordvalue[wordnumber] == NORMGOD && !loved) { if (godready >= 2){ puts("She cuddles up to you, and her mouth starts to work:\n'That was my sister's amulet. The lovely goddess, Purl, was she. The Empire\ncaptured her just after the Darkness came. My other sister, Vert, was killed\nby the Dark Lord himself. He took her amulet and warped its power.\nYour quest was foretold by my father before he died, but to get the Dark Lord's\namulet you must use cunning and skill. I will leave you my amulet."); puts("which you may use as you wish. As for me, I am the last goddess of the\nwaters. My father was the Island King, and the rule is rightfully mine.'\n\nShe pulls the throne out into a large bed."); @@ -107,6 +107,7 @@ love() puts("You wish!"); return; } + } if (wordvalue[wordnumber] == NATIVE){ puts("The girl is easy prey. She peels off her sarong and indulges you."); power++; diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c index 22dddba..1655053 100644 --- a/games/cribbage/crib.c +++ b/games/cribbage/crib.c @@ -570,7 +570,7 @@ peg(mycrib) prhand(ph, pnum, Playwin, FALSE); prhand(ch, cnum, Compwin, TRUE); prtable(sum); - if (last) + if (last) { if (played) { msg(quiet ? "I get one for last" : "I get one point for last"); @@ -583,6 +583,7 @@ peg(mycrib) if (chkscr(&pscore, 1)) return TRUE; } + } return (FALSE); } diff --git a/games/cribbage/score.c b/games/cribbage/score.c index ecfed9a..073a04a 100644 --- a/games/cribbage/score.c +++ b/games/cribbage/score.c @@ -152,21 +152,23 @@ scorehand(hand, starter, n, crb, do_explain) sorthand(h, n + 1); /* sort by rank */ i = 2 * fifteens(h, n + 1); score += i; - if (do_explain) + if (do_explain) { if (i > 0) { (void) sprintf(buf, "%d points in fifteens", i); strcat(expl, buf); } else strcat(expl, "No fifteens"); + } i = pairuns(h, n + 1); score += i; - if (do_explain) + if (do_explain) { if (i > 0) { (void) sprintf(buf, ", %d points in pairs, %d in runs", pairpoints, runpoints); strcat(expl, buf); } else strcat(expl, ", No pairs/runs"); + } return (score); } diff --git a/games/hack/hack.read.c b/games/hack/hack.read.c index 0ea1c4f..f7104b6 100644 --- a/games/hack/hack.read.c +++ b/games/hack/hack.read.c @@ -510,8 +510,9 @@ do_it: for(zy = seely; zy <= seehy; zy++) for(zx = seelx; zx <= seehx; zx++) { levl[zx][zy].lit = on; - if(!Blind && dist(zx,zy) > 2) + if(!Blind && dist(zx,zy) > 2) { if(on) prl(zx,zy); else nosee(zx,zy); + } } if(!on) seehx = 0; #endif QUEST diff --git a/games/hack/hack.trap.c b/games/hack/hack.trap.c index e426dd1..7ec0f93 100644 --- a/games/hack/hack.trap.c +++ b/games/hack/hack.trap.c @@ -391,8 +391,9 @@ register int newlevel; newlevel = atoi(buf); } else { newlevel = 5 + rn2(20); /* 5 - 24 */ - if(dlevel == newlevel) + if(dlevel == newlevel) { if(!xdnstair) newlevel--; else newlevel++; + } } if(newlevel >= 30) { if(newlevel > MAXLEVEL) newlevel = MAXLEVEL; diff --git a/games/larn/main.c b/games/larn/main.c index 49d3a2d..c42723e 100644 --- a/games/larn/main.c +++ b/games/larn/main.c @@ -50,7 +50,7 @@ main(argc,argv) #ifndef VT100 init_term(); /* setup the terminal (find out what type) for termcap */ #endif VT100 - if (((ptr = getlogin()) == 0) || (*ptr==0)) /* try to get login name */ + if (((ptr = getlogin()) == 0) || (*ptr==0)) { /* try to get login name */ if (pwe=getpwuid(getuid())) /* can we get it from /etc/passwd? */ ptr = pwe->pw_name; else @@ -60,6 +60,7 @@ main(argc,argv) noone: write(2, "Can't find your logname. Who Are You?\n",39); exit(1); } + } if (ptr==0) goto noone; if (strlen(ptr)==0) goto noone; /* @@ -788,7 +789,7 @@ char *p; while (1) { if ((i = whatitem("eat"))=='\33') return; - if (i != '.') + if (i != '.') { if (i=='*') showeat(); else { if (iven[i-'a']==OCOOKIE) @@ -808,6 +809,7 @@ while (1) if (iven[i-'a']==0) { ydhi(i); return; } lprcat("\nYou can't eat that!"); return; } + } } } diff --git a/games/larn/monster.c b/games/larn/monster.c index 649f925..041c976 100644 --- a/games/larn/monster.c +++ b/games/larn/monster.c @@ -713,6 +713,7 @@ omnidirect(spnum,dam,str) for (y=playery-1; y<playery+2; y++) { if (m=mitem[x][y]) + { if (nospell(spnum,m) == 0) { ifblind(x,y); @@ -720,6 +721,7 @@ omnidirect(spnum,dam,str) hitm(x,y,dam); nap(800); } else { lasthx=x; lasthy=y; } + } } } @@ -1085,7 +1087,9 @@ spattack(x,xx,yy) case 1: /* rust your armor, j=1 when rusting has occurred */ m = k = c[WEAR]; if ((i=c[SHIELD]) != -1) + { if (--ivenarg[i] < -1) ivenarg[i]= -1; else j=1; + } if ((j==0) && (k != -1)) { m = iven[k]; @@ -1226,6 +1230,7 @@ annihilate() for (k=0, i=playerx-1; i<=playerx+1; i++) for (j=playery-1; j<=playery+1; j++) if (!vxy(&i,&j)) /* if not out of bounds */ + { if (*(p= &mitem[i][j])) /* if a monster there */ if (*p<DEMONLORD+2) { @@ -1236,6 +1241,7 @@ annihilate() lprintf("\nThe %s barely escapes being annihilated!",monster[*p].name); hitp[i][j] = (hitp[i][j]>>1) + 1; /* lose half hit points*/ } + } if (k>0) { lprcat("\nYou hear loud screams of agony!"); raiseexperience((long)k); diff --git a/games/phantasia/fight.c b/games/phantasia/fight.c index 54002bf..d3910a0 100644 --- a/games/phantasia/fight.c +++ b/games/phantasia/fight.c @@ -275,13 +275,14 @@ int ch; /* input */ mvaddstr(7, 0, "1:Melee 2:Skirmish 3:Evade 4:Spell 5:Nick "); - if (!Luckout) + if (!Luckout) { /* haven't tried to luckout yet */ if (Curmonster.m_type == SM_MORGOTH) /* cannot luckout against Morgoth */ addstr("6:Ally "); else addstr("6:Luckout "); + } if (Player.p_ring.ring_type != R_NONE) /* player has a ring */ @@ -1200,7 +1201,7 @@ double dtemp; /* for temporary calculations */ ch = getanswer("NY", FALSE); addstr("\n\n"); - if (ch == 'Y') + if (ch == 'Y') { if (drandom() < treasuretype / 35.0 + 0.04) /* cursed */ { @@ -1209,6 +1210,7 @@ double dtemp; /* for temporary calculations */ } else collecttaxes(gold, gems); + } return; } diff --git a/games/phantasia/misc.c b/games/phantasia/misc.c index bcc1f85..959578f 100644 --- a/games/phantasia/misc.c +++ b/games/phantasia/misc.c @@ -424,6 +424,7 @@ bool dishonest = FALSE;/* set when merchant is dishonest */ ch = getanswer("NY", FALSE); if (ch == 'Y') + { if (Player.p_gold < blessingcost) ++cheat; else @@ -435,6 +436,7 @@ bool dishonest = FALSE;/* set when merchant is dishonest */ else Player.p_blessing = TRUE; } + } break; } break; diff --git a/games/sail/dr_1.c b/games/sail/dr_1.c index 52ab369..239be81 100644 --- a/games/sail/dr_1.c +++ b/games/sail/dr_1.c @@ -346,11 +346,12 @@ compcombat() hit++; hit += QUAL[index][capship(sp)->specs->qual - 1]; for (n = 0; n < 3 && sp->file->captured == 0; n++) - if (!crew[n]) + if (!crew[n]) { if (index <= 5) hit--; else hit -= 2; + } if (ready & R_INITIAL) { if (!r) sp->file->readyL &= ~R_INITIAL; @@ -361,11 +362,12 @@ compcombat() else hit += 2; } - if (sp->file->captured != 0) + if (sp->file->captured != 0) { if (index <= 1) hit--; else hit -= 2; + } hit += AMMO[index][load - 1]; temp = sp->specs->class; if ((temp >= 5 || temp == 1) && windspeed == 5) @@ -385,11 +387,12 @@ compcombat() next() { - if (++turn % 55 == 0) + if (++turn % 55 == 0) { if (alive) alive = 0; else people = 0; + } if (people <= 0 || windspeed == 7) { register struct ship *s; struct ship *bestship; diff --git a/games/sail/pl_3.c b/games/sail/pl_3.c index 3aee8b9..23ef384 100644 --- a/games/sail/pl_3.c +++ b/games/sail/pl_3.c @@ -124,11 +124,12 @@ acceptcombat() else if (temp > 8) temp -= 8; sternrake = temp > 4 && temp < 6; - if (rakehim) + if (rakehim) { if (!sternrake) Signal("Raking the %s!", closest); else Signal("Stern Rake! %s splintering!", closest); + } index = guns; if (target < 3) index += car; @@ -142,21 +143,24 @@ acceptcombat() hit++; hit += QUAL[index][mc->qual-1]; for (n = 0; n < 3 && mf->captured == 0; n++) - if (!crew[n]) + if (!crew[n]) { if (index <= 5) hit--; else hit -= 2; - if (ready & R_INITIAL) + } + if (ready & R_INITIAL) { if (index <= 3) hit++; else hit += 2; - if (mf->captured != 0) + } + if (mf->captured != 0) { if (index <= 1) hit--; else hit -= 2; + } hit += AMMO[index][load - 1]; if (((temp = mc->class) >= 5 || temp == 1) && windspeed == 5) hit--; diff --git a/games/sail/pl_7.c b/games/sail/pl_7.c index 80efdd0..e7afd95 100644 --- a/games/sail/pl_7.c +++ b/games/sail/pl_7.c @@ -84,16 +84,18 @@ newturn() movebuf[0] = '\0'; (void) alarm(0); - if (mf->readyL & R_LOADING) + if (mf->readyL & R_LOADING) { if (mf->readyL & R_DOUBLE) mf->readyL = R_LOADING; else mf->readyL = R_LOADED; - if (mf->readyR & R_LOADING) + } + if (mf->readyR & R_LOADING) { if (mf->readyR & R_DOUBLE) mf->readyR = R_LOADING; else mf->readyR = R_LOADED; + } if (!hasdriver) Write(W_DDEAD, SHIP(0), 0, 0, 0, 0, 0); diff --git a/games/sail/sync.c b/games/sail/sync.c index b896eed..ab663a9 100644 --- a/games/sail/sync.c +++ b/games/sail/sync.c @@ -264,7 +264,7 @@ sync_update(type, ship, a, b, c, d) } case W_UNFOUL: { register struct snag *p = &ship->file->foul[a]; - if (p->sn_count > 0) + if (p->sn_count > 0) { if (b) { ship->file->nfoul -= p->sn_count; p->sn_count = 0; @@ -272,11 +272,12 @@ sync_update(type, ship, a, b, c, d) ship->file->nfoul--; p->sn_count--; } + } break; } case W_UNGRAP: { register struct snag *p = &ship->file->grap[a]; - if (p->sn_count > 0) + if (p->sn_count > 0) { if (b) { ship->file->ngrap -= p->sn_count; p->sn_count = 0; @@ -284,14 +285,16 @@ sync_update(type, ship, a, b, c, d) ship->file->ngrap--; p->sn_count--; } + } break; } case W_SIGNAL: - if (mode == MODE_PLAYER) + if (mode == MODE_PLAYER) { if (nobells) Signal("%s (%c%c): %s", ship, a); else Signal("\7%s (%c%c): %s", ship, a); + } break; case W_CREW: { register struct shipspecs *s = ship->specs; diff --git a/games/trek/move.c b/games/trek/move.c index e812e75..9a76d12 100644 --- a/games/trek/move.c +++ b/games/trek/move.c @@ -179,12 +179,14 @@ double speed; Ship.sectx = ix % NSECTS; Ship.secty = iy % NSECTS; if (ix < 0 || Ship.quadx >= NQUADS || iy < 0 || Ship.quady >= NQUADS) + { if (!damaged(COMPUTER)) { dumpme(0); } else lose(L_NEGENB); + } initquad(0); n = 0; break; diff --git a/games/wump/wump.c b/games/wump/wump.c index 7418591..ecab0c9 100644 --- a/games/wump/wump.c +++ b/games/wump/wump.c @@ -347,7 +347,7 @@ move_to(room_number) wump_kill(); return(1); } - if (cave[next_room].has_a_pit) + if (cave[next_room].has_a_pit) { if (random() % 12 < 2) { pit_survive(); return(0); @@ -355,6 +355,7 @@ move_to(room_number) pit_kill(); return(1); } + } if (cave[next_room].has_a_bat) { (void)printf( @@ -389,14 +390,15 @@ shoot(room_list) */ arrow_location = player_loc; for (roomcnt = 1;; ++roomcnt, room_list = NULL) { - if (!(p = strtok(room_list, " \t\n"))) + if (!(p = strtok(room_list, " \t\n"))) { if (roomcnt == 1) { (void)printf( "The arrow falls to the ground at your feet!\n"); return(0); } else break; - if (roomcnt > 5) { + } + if (roomcnt > 5) { (void)printf( "The arrow wavers in its flight and and can go no further!\n"); break; |