formatting: src/m*.c - p*.c continuation lines
Somewhere along the line I started removing redundant parentheses from return statements, but only in files that needed continuation fixups so it's not comprehensive.
This commit is contained in:
84
src/pray.c
84
src/pray.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 pray.c $NHDT-Date: 1432512763 2015/05/25 00:12:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.81 $ */
|
||||
/* NetHack 3.6 pray.c $NHDT-Date: 1445556883 2015/10/22 23:34:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.85 $ */
|
||||
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -151,7 +151,7 @@ boolean only_if_injured; /* determines whether maxhp <= 5 matters */
|
||||
break; /* explvl 30+ */
|
||||
}
|
||||
/* 5 is a magic number in TROUBLE_HIT handling below */
|
||||
return (curhp <= 5 || curhp * divisor <= maxhp);
|
||||
return (boolean) (curhp <= 5 || curhp * divisor <= maxhp);
|
||||
}
|
||||
|
||||
STATIC_OVL int
|
||||
@@ -164,25 +164,25 @@ in_trouble()
|
||||
* major troubles
|
||||
*/
|
||||
if (Stoned)
|
||||
return (TROUBLE_STONED);
|
||||
return TROUBLE_STONED;
|
||||
if (Slimed)
|
||||
return (TROUBLE_SLIMED);
|
||||
return TROUBLE_SLIMED;
|
||||
if (Strangled)
|
||||
return (TROUBLE_STRANGLED);
|
||||
return TROUBLE_STRANGLED;
|
||||
if (u.utrap && u.utraptype == TT_LAVA)
|
||||
return (TROUBLE_LAVA);
|
||||
return TROUBLE_LAVA;
|
||||
if (Sick)
|
||||
return (TROUBLE_SICK);
|
||||
return TROUBLE_SICK;
|
||||
if (u.uhs >= WEAK)
|
||||
return (TROUBLE_STARVING);
|
||||
return TROUBLE_STARVING;
|
||||
if (region_danger())
|
||||
return TROUBLE_REGION;
|
||||
if (critically_low_hp(FALSE))
|
||||
return TROUBLE_HIT;
|
||||
if (u.ulycn >= LOW_PM)
|
||||
return (TROUBLE_LYCANTHROPE);
|
||||
return TROUBLE_LYCANTHROPE;
|
||||
if (near_capacity() >= EXT_ENCUMBER && AMAX(A_STR) - ABASE(A_STR) > 3)
|
||||
return (TROUBLE_COLLAPSING);
|
||||
return TROUBLE_COLLAPSING;
|
||||
|
||||
for (i = -1; i <= 1; i++)
|
||||
for (j = -1; j <= 1; j++) {
|
||||
@@ -194,12 +194,12 @@ in_trouble()
|
||||
count++;
|
||||
}
|
||||
if (count == 8 && !Passes_walls)
|
||||
return (TROUBLE_STUCK_IN_WALL);
|
||||
return TROUBLE_STUCK_IN_WALL;
|
||||
|
||||
if (Cursed_obj(uarmf, LEVITATION_BOOTS)
|
||||
|| stuck_ring(uleft, RIN_LEVITATION)
|
||||
|| stuck_ring(uright, RIN_LEVITATION))
|
||||
return (TROUBLE_CURSED_LEVITATION);
|
||||
return TROUBLE_CURSED_LEVITATION;
|
||||
if (nohands(youmonst.data) || !freehand()) {
|
||||
/* for bag/box access [cf use_container()]...
|
||||
make sure it's a case that we know how to handle;
|
||||
@@ -211,13 +211,13 @@ in_trouble()
|
||||
return TROUBLE_UNUSEABLE_HANDS;
|
||||
}
|
||||
if (Blindfolded && ublindf->cursed)
|
||||
return (TROUBLE_CURSED_BLINDFOLD);
|
||||
return TROUBLE_CURSED_BLINDFOLD;
|
||||
|
||||
/*
|
||||
* minor troubles
|
||||
*/
|
||||
if (Punished || (u.utrap && u.utraptype == TT_BURIEDBALL))
|
||||
return (TROUBLE_PUNISHED);
|
||||
return TROUBLE_PUNISHED;
|
||||
if (Cursed_obj(uarmg, GAUNTLETS_OF_FUMBLING)
|
||||
|| Cursed_obj(uarmf, FUMBLE_BOOTS))
|
||||
return TROUBLE_FUMBLING;
|
||||
@@ -232,12 +232,12 @@ in_trouble()
|
||||
if (Blinded > 1 && haseyes(youmonst.data)
|
||||
&& (!u.uswallow
|
||||
|| !attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
|
||||
return (TROUBLE_BLIND);
|
||||
return TROUBLE_BLIND;
|
||||
for (i = 0; i < A_MAX; i++)
|
||||
if (ABASE(i) < AMAX(i))
|
||||
return (TROUBLE_POISONED);
|
||||
return TROUBLE_POISONED;
|
||||
if (Wounded_legs && !u.usteed)
|
||||
return (TROUBLE_WOUNDED_LEGS);
|
||||
return TROUBLE_WOUNDED_LEGS;
|
||||
if (u.uhs >= HUNGRY)
|
||||
return TROUBLE_HUNGRY;
|
||||
if (HStun & TIMEOUT)
|
||||
@@ -246,7 +246,7 @@ in_trouble()
|
||||
return TROUBLE_CONFUSED;
|
||||
if (HHallucination & TIMEOUT)
|
||||
return TROUBLE_HALLUCINATION;
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* select an item for TROUBLE_CURSED_ITEMS */
|
||||
@@ -1184,7 +1184,7 @@ boolean bless_water;
|
||||
((other || changed > 1L) ? "s" : ""), (changed > 1L ? "" : "s"),
|
||||
(bless_water ? hcolor(NH_LIGHT_BLUE) : hcolor(NH_BLACK)));
|
||||
}
|
||||
return ((boolean)(changed > 0L));
|
||||
return (boolean) (changed > 0L);
|
||||
}
|
||||
|
||||
STATIC_OVL void
|
||||
@@ -1375,7 +1375,7 @@ dosacrifice()
|
||||
useup(otmp);
|
||||
else
|
||||
useupf(otmp, 1L);
|
||||
return (1);
|
||||
return 1;
|
||||
} else if (has_omonst(otmp) && ((mtmp = get_mtraits(otmp, FALSE))
|
||||
!= (struct monst *) 0)
|
||||
&& mtmp->mtame) {
|
||||
@@ -1430,13 +1430,13 @@ dosacrifice()
|
||||
gods_upset(A_NONE);
|
||||
else
|
||||
You_feel("%s.",
|
||||
Hallucination ? "homesick" :
|
||||
/* headed towards celestial disgrace */
|
||||
(altaralign != u.ualign.type)
|
||||
? "ashamed"
|
||||
:
|
||||
/* on track; give a big hint */
|
||||
"an urge to return to the surface");
|
||||
Hallucination
|
||||
? "homesick"
|
||||
/* if on track, give a big hint */
|
||||
: (altaralign == u.ualign.type)
|
||||
? "an urge to return to the surface"
|
||||
/* else headed towards celestial disgrace */
|
||||
: "ashamed");
|
||||
return 1;
|
||||
} else {
|
||||
/* The final Test. Did you win? */
|
||||
@@ -1514,7 +1514,7 @@ dosacrifice()
|
||||
|
||||
if (value == 0) {
|
||||
pline1(nothing_happens);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (altaralign != u.ualign.type && highaltar) {
|
||||
@@ -1563,7 +1563,7 @@ dosacrifice()
|
||||
if (!Inhell)
|
||||
angrygods(u.ualign.type);
|
||||
}
|
||||
return (1);
|
||||
return 1;
|
||||
} else {
|
||||
consume_offering(otmp);
|
||||
You("sense a conflict between %s and %s.", u_gname(),
|
||||
@@ -1603,7 +1603,7 @@ dosacrifice()
|
||||
&& rnd(u.ualign.record) > (7 * ALIGNLIM) / 8)
|
||||
summon_minion(altaralign, TRUE);
|
||||
}
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1692,7 +1692,7 @@ dosacrifice()
|
||||
makeknown(otmp->otyp);
|
||||
discover_artifact(otmp->oartifact);
|
||||
}
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
change_luck((value * LUCKMAX) / (MAXVALUE * 2));
|
||||
@@ -1711,7 +1711,7 @@ dosacrifice()
|
||||
}
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* determine prayer results in advance; also used for enlightenment */
|
||||
@@ -1801,7 +1801,7 @@ dopray()
|
||||
u.uinvulnerable = TRUE;
|
||||
}
|
||||
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
STATIC_PTR int prayer_done() /* M. Stephenson (1.0.3b) */
|
||||
@@ -1819,7 +1819,7 @@ STATIC_PTR int prayer_done() /* M. Stephenson (1.0.3b) */
|
||||
/* no Half_physical_damage adjustment here */
|
||||
losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN);
|
||||
exercise(A_CON, FALSE);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
if (Inhell) {
|
||||
pline("Since you are in Gehennom, %s won't help you.",
|
||||
@@ -1827,7 +1827,7 @@ STATIC_PTR int prayer_done() /* M. Stephenson (1.0.3b) */
|
||||
/* haltingly aligned is least likely to anger */
|
||||
if (u.ualign.record <= 0 || rnl(u.ualign.record))
|
||||
angrygods(u.ualign.type);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (p_type == 0) {
|
||||
@@ -1854,7 +1854,7 @@ STATIC_PTR int prayer_done() /* M. Stephenson (1.0.3b) */
|
||||
(void) water_prayer(TRUE);
|
||||
pleased(alignment); /* nice */
|
||||
}
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1879,7 +1879,7 @@ doturn()
|
||||
}
|
||||
|
||||
You("don't know how to turn undead!");
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
u.uconduct.gnostic++;
|
||||
|
||||
@@ -1889,13 +1889,13 @@ doturn()
|
||||
pline("For some reason, %s seems to ignore you.", u_gname());
|
||||
aggravate();
|
||||
exercise(A_WIS, FALSE);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (Inhell) {
|
||||
pline("Since you are in Gehennom, %s won't help you.", u_gname());
|
||||
aggravate();
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
pline("Calling upon %s, you chant an arcane formula.", u_gname());
|
||||
exercise(A_WIS, TRUE);
|
||||
@@ -1958,20 +1958,20 @@ doturn()
|
||||
nomul(-5);
|
||||
multi_reason = "trying to turn the monsters";
|
||||
nomovemsg = You_can_move_again;
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *
|
||||
a_gname()
|
||||
{
|
||||
return (a_gname_at(u.ux, u.uy));
|
||||
return a_gname_at(u.ux, u.uy);
|
||||
}
|
||||
|
||||
const char *a_gname_at(x, y) /* returns the name of an altar's deity */
|
||||
xchar x, y;
|
||||
{
|
||||
if (!IS_ALTAR(levl[x][y].typ))
|
||||
return ((char *) 0);
|
||||
return (char *) 0;
|
||||
|
||||
return align_gname(a_align(x, y));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user