shk.c formatting

Mostly wrapping wide lines.  No change in behavior except one
impossible warning now ends in "?" instead of "??".
This commit is contained in:
PatR
2021-08-20 15:01:36 -07:00
parent 3736f2ba4c
commit f1fa497556
+21 -16
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 shk.c $NHDT-Date: 1625277130 2021/07/03 01:52:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.202 $ */ /* NetHack 3.7 shk.c $NHDT-Date: 1629496872 2021/08/20 22:01:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.204 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -347,7 +347,8 @@ call_kops(register struct monst* shkp, register boolean nearshop)
stairway *stway = g.stairs; stairway *stway = g.stairs;
while (stway) { while (stway) {
if (!stway->isladder && !stway->up && stway->tolev.dnum == u.uz.dnum) if (!stway->isladder && !stway->up
&& stway->tolev.dnum == u.uz.dnum)
break; break;
stway = stway->next; stway = stway->next;
} }
@@ -845,7 +846,8 @@ shop_keeper(char rmno)
(int) rmno, (int) rmno,
(int) g.rooms[rmno - ROOMOFFSET].rtype, (int) g.rooms[rmno - ROOMOFFSET].rtype,
shkp->mnum, shkp->mnum,
/* [real shopkeeper name is kept in ESHK, not MGIVENNAME] */ /* [real shopkeeper name is kept in ESHK,
not MGIVENNAME] */
has_mgivenname(shkp) ? MGIVENNAME(shkp) : "anonymous"); has_mgivenname(shkp) ? MGIVENNAME(shkp) : "anonymous");
/* not sure if this is appropriate, because it does nothing to /* not sure if this is appropriate, because it does nothing to
correct the underlying g.rooms[].resident issue but... */ correct the underlying g.rooms[].resident issue but... */
@@ -951,11 +953,12 @@ obfree(register struct obj* obj, register struct obj* merge)
if (!bpm) { if (!bpm) {
/* this used to be a rename */ /* this used to be a rename */
/* !merge already returned */ /* !merge already returned */
impossible("obfree: not on bill, %s = (%d,%d,%ld,%d) (%d,%d,%ld,%d)??", impossible(
"otyp,where,quan,unpaid", "obfree: not on bill, %s = (%d,%d,%ld,%d) (%d,%d,%ld,%d)?",
obj->otyp, obj->where, obj->quan, obj->unpaid ? 1 : 0, "otyp,where,quan,unpaid",
merge->otyp, merge->where, merge->quan, obj->otyp, obj->where, obj->quan, obj->unpaid ? 1 : 0,
merge->unpaid ? 1 : 0); merge->otyp, merge->where, merge->quan,
merge->unpaid ? 1 : 0);
return; return;
} else { } else {
/* this was a merger */ /* this was a merger */
@@ -1850,7 +1853,8 @@ inherits(struct monst* shkp, int numsk, int croaked, boolean silently)
if (!silently) if (!silently)
pline("%s %s the %ld %s %sowed %s.", Shknam(shkp), pline("%s %s the %ld %s %sowed %s.", Shknam(shkp),
takes, loss, currency(loss), takes, loss, currency(loss),
strncmp(eshkp->customer, g.plname, PL_NSIZ) ? "" : "you ", strncmp(eshkp->customer, g.plname, PL_NSIZ) ? ""
: "you ",
noit_mhim(shkp)); noit_mhim(shkp));
/* shopkeeper has now been paid in full */ /* shopkeeper has now been paid in full */
pacify_shk(shkp); pacify_shk(shkp);
@@ -2203,7 +2207,7 @@ contained_cost(
long long
contained_gold( contained_gold(
struct obj *obj, struct obj *obj,
boolean even_if_unknown) /* True: all gold; False: limit to known contents */ boolean even_if_unknown) /* T: all gold; F: limit to known contents */
{ {
register struct obj *otmp; register struct obj *otmp;
register long value = 0L; register long value = 0L;
@@ -2557,7 +2561,8 @@ shk_names_obj(
/* decide whether a shopkeeper thinks an item belongs to her */ /* decide whether a shopkeeper thinks an item belongs to her */
boolean boolean
billable( billable(
struct monst **shkpp, /* in: non-null if shk has been validated; out: shk */ struct monst **shkpp, /* in: non-null if shk has been validated;
* out: shk */
struct obj *obj, struct obj *obj,
char roomno, char roomno,
boolean reset_nocharge) boolean reset_nocharge)
@@ -2974,7 +2979,7 @@ void
donate_gold( donate_gold(
long gltmp, long gltmp,
struct monst *shkp, struct monst *shkp,
boolean selling) /* True: dropped in shop; False: kicked and landed in shop */ boolean selling) /* T: dropped in shop; F: kicked and landed in shop */
{ {
struct eshk *eshkp = ESHK(shkp); struct eshk *eshkp = ESHK(shkp);
@@ -3991,11 +3996,11 @@ shopdig(register int fall)
if (!Deaf && !muteshk(shkp)) { if (!Deaf && !muteshk(shkp)) {
if (u.utraptype == TT_PIT) if (u.utraptype == TT_PIT)
verbalize( verbalize(
"Be careful, %s, or you might fall through the floor.", "Be careful, %s, or you might fall through the floor.",
flags.female ? "madam" : "sir"); flags.female ? "madam" : "sir");
else else
verbalize("%s, do not damage the floor here!", verbalize("%s, do not damage the floor here!",
flags.female ? "Madam" : "Sir"); flags.female ? "Madam" : "Sir");
} }
} }
if (Role_if(PM_KNIGHT)) { if (Role_if(PM_KNIGHT)) {
@@ -4501,7 +4506,7 @@ static long
cost_per_charge( cost_per_charge(
struct monst *shkp, struct monst *shkp,
struct obj *otmp, struct obj *otmp,
boolean altusage) /* some items have an "alternate" use with different cost */ boolean altusage) /* some items have "alternate" use with different cost */
{ {
long tmp = 0L; long tmp = 0L;