Reformat all C files.

I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
This commit is contained in:
Sean Hunt
2015-05-09 13:43:16 -04:00
parent 167800afdf
commit 97d6fade74
270 changed files with 182649 additions and 173878 deletions
+35 -35
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mactopl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.6 mactopl.c $NHDT-Date: 1431192785 2015/05/09 17:33:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
/* NetHack 3.6 mactopl.c $Date: 2009/05/06 10:49:14 $ $Revision: 1.5 $ */
/* SCCS Id: @(#)mactopl.c 3.5 1991/07/23 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
@@ -10,48 +10,48 @@
#include "macpopup.h"
char
queued_resp(char *resp) {
char buf[30];
if (try_key_queue(buf)) {
if (!resp || strchr(resp, buf[0]))
return buf[0];
if (digit(buf[0]) && strchr(resp, '#')) {
yn_number = atoi(buf);
return '#';
}
}
return '\0';
queued_resp(char *resp)
{
char buf[30];
if (try_key_queue(buf)) {
if (!resp || strchr(resp, buf[0]))
return buf[0];
if (digit(buf[0]) && strchr(resp, '#')) {
yn_number = atoi(buf);
return '#';
}
}
return '\0';
}
char
topl_yn_function(const char *query, const char *resp, char def) {
char buf[30];
char c = queued_resp((char *) resp);
if (!c) {
enter_topl_mode((char *) query);
topl_set_resp((char *) resp, def);
topl_yn_function(const char *query, const char *resp, char def)
{
char buf[30];
char c = queued_resp((char *) resp);
if (!c) {
enter_topl_mode((char *) query);
topl_set_resp((char *) resp, def);
do {
c = readchar();
if (c && resp && !strchr(resp, c)) {
nhbell();
c = '\0';
}
} while (!c);
do {
c = readchar();
if (c && resp && !strchr(resp, c)) {
nhbell();
c = '\0';
}
} while (!c);
topl_set_resp("", '\0');
leave_topl_mode(buf);
if (c == '#')
yn_number = atoi(buf);
}
return c;
topl_set_resp("", '\0');
leave_topl_mode(buf);
if (c == '#')
yn_number = atoi(buf);
}
return c;
}
char
mac_yn_function(query, resp, def)
const char *query,*resp;
const char *query, *resp;
char def;
/*
* Generic yes/no function. 'def' is the default (returned by space or
@@ -61,7 +61,7 @@ char def;
* If resp is NULL, any single character is accepted and returned.
*/
{
return topl_yn_function(query, resp, def);
return topl_yn_function(query, resp, def);
}
/* mactopl.c */