some reformatting (1 of 4)

I recently realized that I've been editing sources in a terminal
window that was widened in order to fit curses borders for testing
something or other.  That has resulted in some new wide lines in the
source.  There were lots of old ones too.

This updates some source files to try to achieve the goal of 78
characters or less.  As in the past, I've been inconsistent about
lines with 79 characters.  Lines with 80 or more have been wrapped
or shortened (usually by trimming an end of line comment or removing
redundant parantheses, sometimes just by reducing the indentation
of the continuation portion of an already wrapped line).

I eliminated one instance of warning manipulation for non-constant
format string, and simplified stone_luck() where Ken had a silly
comment about the function argument's name.
This commit is contained in:
PatR
2024-09-05 13:12:11 -07:00
parent 74981d9ff2
commit 50412ba53b
11 changed files with 102 additions and 64 deletions

View File

@@ -215,18 +215,30 @@ set_occupation(int (*fn)(void), const char *txt, cmdcount_nht xtime)
void
cmdq_print(int q)
{
struct _cmd_queue *cq = gc.command_queue[q];
char buf[QBUFSZ];
struct _cmd_queue *cq = gc.command_queue[q];
pline("CQ:%i", q);
while (cq) {
switch (cq->typ) {
case CMDQ_KEY: pline("(key:%s)", key2txt(cq->key, buf)); break;
case CMDQ_EXTCMD: pline("(extcmd:#%s)", cq->ec_entry->ef_txt); break;
case CMDQ_DIR: pline("(dir:%i,%i,%i)", cq->dirx, cq->diry, cq->dirz); break;
case CMDQ_USER_INPUT: pline1("(userinput)"); break;
case CMDQ_INT: pline("(int:%i)", cq->intval); break;
default: pline("(ERROR:%i)",cq->typ); break;
case CMDQ_KEY:
pline("(key:%s)", key2txt(cq->key, buf));
break;
case CMDQ_EXTCMD:
pline("(extcmd:#%s)", cq->ec_entry->ef_txt);
break;
case CMDQ_DIR:
pline("(dir:%i,%i,%i)", cq->dirx, cq->diry, cq->dirz);
break;
case CMDQ_USER_INPUT:
pline("(userinput)");
break;
case CMDQ_INT:
pline("(int:%i)", cq->intval);
break;
default:
pline("(ERROR:%i)",cq->typ);
break;
}
cq = cq->next;
}
@@ -878,7 +890,8 @@ domonability(void)
char c = '\0';
if (might_hide && webmaker(uptr)) {
c = yn_function("Hide [h] or spin a web [s]?", hidespinchars, 'q', TRUE);
c = yn_function("Hide [h] or spin a web [s]?",
hidespinchars, 'q', TRUE);
if (c == 'q' || c == '\033')
return ECMD_OK;
}
@@ -2198,7 +2211,8 @@ bindit:
pline("Changed key '%s' from \"%s\" to \"%s\".",
key2txt(key, buf2), prevec->ef_txt, cmdstr);
} else if (!prevec) {
pline("Bound key '%s' to \"%s\".", key2txt(key, buf2), cmdstr);
pline("Bound key '%s' to \"%s\".",
key2txt(key, buf2), cmdstr);
}
} else {
pline("Key binding failed?!");
@@ -3371,7 +3385,8 @@ rhack(int key)
pline(
"The '%s' prefix should be followed by a movement command%s.",
which, (up || down) ? " other than up or down" : "");
which,
(up || down) ? " other than up or down" : "");
}
res = ECMD_FAIL;
prefix_seen = 0;
@@ -3620,7 +3635,8 @@ getdir(const char *s)
if (!cmdq->dirz) {
dirsym = gc.Cmd.dirchars[xytod(cmdq->dirx, cmdq->diry)];
} else {
dirsym = gc.Cmd.dirchars[(cmdq->dirz > 0) ? DIR_DOWN : DIR_UP];
dirsym = gc.Cmd.dirchars[(cmdq->dirz > 0) ? DIR_DOWN
: DIR_UP];
}
} else if (cmdq->typ == CMDQ_KEY) {
dirsym = cmdq->key;
@@ -3734,7 +3750,7 @@ getdir(const char *s)
did_help = help_dir((s && *s == '^') ? dirsym : '\0',
gc.Cmd.spkeys[NHKF_ESC],
help_requested ? (const char *) 0
: "Invalid direction key!");
: "Invalid direction key!");
if (help_requested)
goto retry;
}