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

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dprintf.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.6 dprintf.c $NHDT-Date: 1431192786 2015/05/09 17:33:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.6 $ */
/* NetHack 3.6 dprintf.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.3 $ */
/* SCCS Id: @(#)dprintf.c 3.5 1994/01/29 */
/* Copyright (c) Jon W{tte, 1993. */
@@ -8,42 +8,43 @@
#include "macwin.h"
static Boolean
KeyDown (unsigned short code) {
unsigned char keys [16];
KeyDown(unsigned short code)
{
unsigned char keys[16];
GetKeys ((void *) keys);
return ((keys [code >> 3] >> (code & 7)) & 1) != 0;
GetKeys((void *) keys);
return ((keys[code >> 3] >> (code & 7)) & 1) != 0;
}
void
dprintf (char *format, ...)
dprintf(char *format, ...)
{
char buffer [500];
va_list list;
int doit;
char buffer[500];
va_list list;
int doit;
#define DO_DEBUGSTR 1
#define DO_PLINE 2
if (flags.debug) {
doit = 0;
if (macFlags.hasDebugger && KeyDown (0x39)) { /* Caps Lock */
doit = DO_DEBUGSTR;
} else if (KeyDown (0x3B) && iflags.window_inited && /* Control */
(WIN_MESSAGE != -1) && theWindows [WIN_MESSAGE].its_window) {
doit = DO_PLINE;
}
if (doit) {
va_start (list, format);
vsprintf (&buffer [1], format, list);
va_end (list) ;
if (flags.debug) {
doit = 0;
if (macFlags.hasDebugger && KeyDown(0x39)) { /* Caps Lock */
doit = DO_DEBUGSTR;
} else if (KeyDown(0x3B) && iflags.window_inited && /* Control */
(WIN_MESSAGE != -1)
&& theWindows[WIN_MESSAGE].its_window) {
doit = DO_PLINE;
}
if (doit == DO_DEBUGSTR) {
buffer [0] = strlen (&buffer [1]);
DebugStr ((uchar *) buffer);
} else if (doit == DO_PLINE)
pline ("%s", &buffer [1]);
}
}
if (doit) {
va_start(list, format);
vsprintf(&buffer[1], format, list);
va_end(list);
if (doit == DO_DEBUGSTR) {
buffer[0] = strlen(&buffer[1]);
DebugStr((uchar *) buffer);
} else if (doit == DO_PLINE)
pline("%s", &buffer[1]);
}
}
}