aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-20 22:20:59 -0700
committerPaul Gilbert2019-06-22 14:40:50 -0700
commit8f75589971d70b2ca749d5389a332e6761213a5b (patch)
tree4ddb7bba2a1040c5b563b89b75ae823182c08a91 /engines/glk
parentad1cecaeac5d54b0973d6c7edce8181cb965ff68 (diff)
downloadscummvm-rg350-8f75589971d70b2ca749d5389a332e6761213a5b.tar.gz
scummvm-rg350-8f75589971d70b2ca749d5389a332e6761213a5b.tar.bz2
scummvm-rg350-8f75589971d70b2ca749d5389a332e6761213a5b.zip
GLK: ALAN2: Remove all prototype ifdef blocks
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/alan2/args.cpp25
-rw-r--r--engines/glk/alan2/args.h4
-rw-r--r--engines/glk/alan2/debug.cpp124
-rw-r--r--engines/glk/alan2/debug.h10
-rw-r--r--engines/glk/alan2/decode.cpp38
-rw-r--r--engines/glk/alan2/decode.h7
-rw-r--r--engines/glk/alan2/exe.cpp636
-rw-r--r--engines/glk/alan2/exe.h44
-rw-r--r--engines/glk/alan2/inter.cpp63
-rw-r--r--engines/glk/alan2/inter.h4
-rw-r--r--engines/glk/alan2/main.cpp356
-rw-r--r--engines/glk/alan2/main.h25
-rw-r--r--engines/glk/alan2/params.cpp73
-rw-r--r--engines/glk/alan2/params.h11
-rw-r--r--engines/glk/alan2/parse.cpp154
-rw-r--r--engines/glk/alan2/parse.h6
-rw-r--r--engines/glk/alan2/readline.h5
-rw-r--r--engines/glk/alan2/reverse.cpp212
-rw-r--r--engines/glk/alan2/reverse.h9
-rw-r--r--engines/glk/alan2/rules.cpp7
-rw-r--r--engines/glk/alan2/rules.h6
-rw-r--r--engines/glk/alan2/stack.cpp24
-rw-r--r--engines/glk/alan2/stack.h8
-rw-r--r--engines/glk/alan2/sysdep.cpp2
-rw-r--r--engines/glk/alan2/sysdep.h25
-rw-r--r--engines/glk/alan2/term.cpp7
-rw-r--r--engines/glk/alan2/term.h6
-rw-r--r--engines/glk/alan2/types.cpp45
28 files changed, 246 insertions, 1690 deletions
diff --git a/engines/glk/alan2/args.cpp b/engines/glk/alan2/args.cpp
index 19462393a3..caf32c1bec 100644
--- a/engines/glk/alan2/args.cpp
+++ b/engines/glk/alan2/args.cpp
@@ -54,17 +54,7 @@ BPTR cd;
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
-static void switches(
- unsigned argc,
- char *argv[]
-)
-#else
-static void switches(argc, argv)
- unsigned argc;
- char *argv[];
-#endif
-{
+static void switches(unsigned argc, char *argv[]) {
#ifndef GLK
uint i;
@@ -173,18 +163,7 @@ wb_parse(void)
#endif
#endif
-
-#ifdef _PROTOTYPES_
-void args(
- int argc,
- char * argv[]
-)
-#else
-void args(argc, argv)
- int argc;
- char *argv[];
-#endif
-{
+void args(int argc, char * argv[]) {
char *prgnam;
#ifdef __mac__
diff --git a/engines/glk/alan2/args.h b/engines/glk/alan2/args.h
index a86d5197fe..dc2f0883a5 100644
--- a/engines/glk/alan2/args.h
+++ b/engines/glk/alan2/args.h
@@ -38,11 +38,7 @@ namespace Alan2 {
#define PROGNAME "alan2"
#endif
-#ifdef _PROTOTYPES_
extern void args(int argc, char *argv[]);
-#else
-extern void args();
-#endif
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/debug.cpp b/engines/glk/alan2/debug.cpp
index dc353c7729..785cd54cbc 100644
--- a/engines/glk/alan2/debug.cpp
+++ b/engines/glk/alan2/debug.cpp
@@ -45,15 +45,7 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
-static void showatrs(
- Aword atradr
-)
-#else
-static void showatrs(atradr)
- Aword atradr;
-#endif
-{
+static void showatrs(Aword atradr) {
AtrElem *at;
int i;
char str[80];
@@ -71,13 +63,7 @@ static void showatrs(atradr)
}
}
-
-#ifdef _PROTOTYPES_
-static void showobjs(void)
-#else
-static void showobjs()
-#endif
-{
+static void showobjs() {
char str[80];
int obj;
@@ -89,16 +75,7 @@ static void showobjs()
}
}
-
-#ifdef _PROTOTYPES_
-static void showobj(
- int obj
-)
-#else
-static void showobj(obj)
- int obj;
-#endif
-{
+static void showobj(int obj) {
char str[80];
#define OBJ (obj-OBJMIN)
@@ -138,13 +115,7 @@ static void showobj(obj)
#undef OBJ
}
-
-#ifdef _PROTOTYPES_
-static void showcnts(void)
-#else
-static void showcnts()
-#endif
-{
+static void showcnts() {
char str[80];
int cnt;
#define CNT (cnt-CNTMIN)
@@ -162,16 +133,7 @@ static void showcnts()
#undef CNT
}
-
-#ifdef _PROTOTYPES_
-static void showcnt(
- int cnt
-)
-#else
-static void showcnt(cnt)
- int cnt;
-#endif
-{
+static void showcnt(int cnt) {
char str[80];
int i;
Abool found = FALSE;
@@ -211,13 +173,7 @@ static void showcnt(cnt)
#undef CNT
}
-
-#ifdef _PROTOTYPES_
-static void showlocs(void)
-#else
-static void showlocs()
-#endif
-{
+static void showlocs() {
char str[80];
int loc;
@@ -229,16 +185,7 @@ static void showlocs()
}
}
-
-#ifdef _PROTOTYPES_
-static void showloc(
- int loc
-)
-#else
-static void showloc(loc)
- int loc;
-#endif
-{
+static void showloc(int loc) {
char str[80];
@@ -256,13 +203,7 @@ static void showloc(loc)
showatrs(locs[loc-LOCMIN].atrs);
}
-
-#ifdef _PROTOTYPES_
-static void showacts(void)
-#else
-static void showacts()
-#endif
-{
+static void showacts() {
char str[80];
int act;
@@ -274,16 +215,7 @@ static void showacts()
}
}
-
-#ifdef _PROTOTYPES_
-static void showact(
- int act
-)
-#else
-static void showact(act)
- int act;
-#endif
-{
+static void showact(int act) {
char str[80];
Boolean oldstp;
@@ -318,13 +250,7 @@ static void showact(act)
showatrs(acts[act-ACTMIN].atrs);
}
-
-#ifdef _PROTOTYPES_
-static void showevts(void)
-#else
-static void showevts()
-#endif
-{
+static void showevts() {
int evt, i;
char str[80];
Boolean scheduled;
@@ -353,37 +279,21 @@ static void showevts()
static Boolean trc, stp;
static int loc;
-#ifdef _PROTOTYPES_
-void saveInfo(void)
-#else
-void saveInfo()
-#endif
-{
+void saveInfo() {
/* Save some important things */
trc = trcflg; trcflg = FALSE;
stp = stpflg; stpflg = FALSE;
loc = cur.loc; cur.loc = where(HERO);
}
-#ifdef _PROTOTYPES_
-void restoreInfo(void)
-#else
-void restoreInfo()
-#endif
-{
+void restoreInfo() {
/* Restore! */
trcflg = trc;
stpflg = stp;
cur.loc = loc;
}
-
-#ifdef _PROTOTYPES_
-void debug(void)
-#else
-void debug()
-#endif
-{
+void debug() {
char buf[256];
char c;
int i;
@@ -483,13 +393,7 @@ void debug()
shown to the player.
*/
-#ifdef _PROTOTYPES_
-void debugsay(int item)
-#else
-void debugsay(item)
- int item;
-#endif
-{
+void debugsay(int item) {
saveInfo();
needsp = FALSE;
col = 1;
diff --git a/engines/glk/alan2/debug.h b/engines/glk/alan2/debug.h
index aac870ec42..6f020f9fc3 100644
--- a/engines/glk/alan2/debug.h
+++ b/engines/glk/alan2/debug.h
@@ -28,18 +28,10 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
-
-extern void saveInfo(void);
-extern void restoreInfo(void);
-extern void debug(void);
-extern void debugsay(int item);
-#else
extern void saveInfo();
extern void restoreInfo();
extern void debug();
-extern void debugsay();
-#endif
+extern void debugsay(int item);
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/decode.cpp b/engines/glk/alan2/decode.cpp
index 4ffdc2f3b9..f1ec3db89c 100644
--- a/engines/glk/alan2/decode.cpp
+++ b/engines/glk/alan2/decode.cpp
@@ -32,13 +32,7 @@ static int decodeBuffer; /* Bits to be input */
static int bitsToGo; /* Bits still in buffer */
static int garbageBits; /* Bits past EOF */
-
-#ifdef _PROTOTYPES_
-static int inputBit(void)
-#else
-static int inputBit()
-#endif
-{
+static int inputBit() {
int bit;
if (!bitsToGo) { /* More bits available ? */
@@ -63,12 +57,7 @@ static CodeValue value; /* Currently seen code value */
static CodeValue low, high; /* Current code region */
-#ifdef _PROTOTYPES_
-void startDecoding(void)
-#else
-void startDecoding()
-#endif
-{
+void startDecoding() {
int i;
bitsToGo = 0;
@@ -81,13 +70,7 @@ void startDecoding()
high = TOPVALUE;
}
-
-#ifdef _PROTOTYPES_
-int decodeChar(void)
-#else
-int decodeChar()
-#endif
-{
+int decodeChar() {
long range;
int f;
int symbol;
@@ -144,12 +127,7 @@ typedef struct DecodeInfo {
restore and continue later.
*/
-#ifdef _PROTOTYPES_
-void *pushDecode(void)
-#else
-void *pushDecode()
-#endif
-{
+void *pushDecode() {
DecodeInfo *info;
info = (DecodeInfo *) allocate(sizeof(DecodeInfo));
@@ -171,13 +149,7 @@ void *pushDecode()
continue after having decoded something else.
*/
-#ifdef _PROTOTYPES_
-void popDecode(void *i)
-#else
-void popDecode(i)
- void *i;
-#endif
-{
+void popDecode(void *i) {
DecodeInfo *info = (DecodeInfo *) i;
fseek(txtfil, info->fpos, 0);
decodeBuffer = info->buffer;
diff --git a/engines/glk/alan2/decode.h b/engines/glk/alan2/decode.h
index 7ce15b41de..2e430de1f7 100644
--- a/engines/glk/alan2/decode.h
+++ b/engines/glk/alan2/decode.h
@@ -31,17 +31,10 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
extern void startDecoding(void);
extern int decodeChar(void);
extern void *pushDecode(void);
extern void popDecode(void *info);
-#else
-extern void startDecoding();
-extern int decodeChar();
-extern void *pushDecode();
-extern void popDecode();
-#endif
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/exe.cpp b/engines/glk/alan2/exe.cpp
index 9b06943257..d91c3aafc7 100644
--- a/engines/glk/alan2/exe.cpp
+++ b/engines/glk/alan2/exe.cpp
@@ -54,23 +54,11 @@ Boolean looking = FALSE; /* LOOKING? flag */
int dscrstkp = 0; /* Describe-stack pointer */
-#ifdef _PROTOTYPES_
-void dscrobjs(void);
-void dscracts(void);
-#else
void dscrobjs();
void dscracts();
-#endif
-
-#ifdef _PROTOTYPES_
-void print(Aword fpos, Aword len)
-#else
-void print(fpos, len)
- Aword fpos, len;
-#endif
-{
+void print(Aword fpos, Aword len) {
char str[2*WIDTH]; /* String buffer */
int outlen = 0; /* Current output length */
int ch;
@@ -125,14 +113,7 @@ void print(fpos, len)
}
}
-
-#ifdef _PROTOTYPES_
-void sys(Aword fpos, Aword len)
-#else
-void sys(fpos, len)
- Aword fpos, len;
-#endif
-{
+void sys(Aword fpos, Aword len) {
#ifdef GLK
::error("system calls aren't supported");
#else
@@ -145,14 +126,7 @@ void sys(fpos, len)
#endif
}
-
-#ifdef _PROTOTYPES_
-void getstr(Aword fpos, Aword len)
-#else
-void getstr(fpos, len)
- Aword fpos, len;
-#endif
-{
+void getstr(Aword fpos, Aword len) {
char *buf = (char *)allocate(len+1);
push((Aptr) buf); /* Push the address to the string */
@@ -167,15 +141,7 @@ void getstr(fpos, len)
*buf = '\0';
}
-
-
-#ifdef _PROTOTYPES_
-void score(Aword sc)
-#else
-void score(sc)
- Aword sc;
-#endif
-{
+void score(Aword sc) {
char buf[80];
if (sc == 0) {
@@ -191,24 +157,11 @@ void score(sc)
}
}
-#ifdef _PROTOTYPES_
-void visits(Aword v)
-#else
-void visits(v)
- Aword v;
-#endif
-{
+void visits(Aword v) {
cur.visits = v;
}
-
-#ifdef _PROTOTYPES_
-Boolean confirm(MsgKind msgno)
-#else
-Boolean confirm(msgno)
- MsgKind msgno;
-#endif
-{
+Boolean confirm(MsgKind msgno) {
char buf[80];
/* This is a bit of a hack since we really want to compare the input,
@@ -225,13 +178,7 @@ Boolean confirm(msgno)
return (buf[0] == '\0');
}
-
-#ifdef _PROTOTYPES_
-void quit(void)
-#else
-void quit()
-#endif
-{
+void quit() {
char buf[80];
char choices[10];
@@ -257,14 +204,7 @@ void quit()
syserr("Fallthrough in QUIT");
}
-
-
-#ifdef _PROTOTYPES_
-void restart(void)
-#else
-void restart()
-#endif
-{
+void restart() {
para();
if (confirm(M_REALLY)) {
//longjmp(restart_label, TRUE);
@@ -274,15 +214,7 @@ void restart()
syserr("Fallthrough in RESTART");
}
-
-
-#ifdef _PROTOTYPES_
-void cancl(Aword evt)
-#else
-void cancl(evt)
- Aword evt;
-#endif
-{
+void cancl(Aword evt) {
int i;
for(i = etop-1; i>=0; i--)
@@ -298,14 +230,7 @@ void cancl(evt)
}
}
-
-#ifdef _PROTOTYPES_
-void schedule(Aword evt, Aword whr, Aword aft)
-#else
-void schedule(evt, whr, aft)
- Aword evt, whr, aft;
-#endif
-{ int i;
+void schedule(Aword evt, Aword whr, Aword aft) { int i;
int time;
cancl(evt);
@@ -335,17 +260,10 @@ void schedule(evt, whr, aft)
Get an attribute value from an attribute list
*/
-#ifdef _PROTOTYPES_
static Aptr getatr(
Aaddr atradr, /* IN - ACODE address to attribute table */
Aaddr atr /* IN - The attribute to read */
-)
-#else
-static Aptr getatr(atradr, atr)
- Aaddr atradr; /* IN - ACODE address to attribute table */
- Aaddr atr; /* IN - The attribute to read */
-#endif
-{
+) {
AtrElem *at;
at = (AtrElem *) addrTo(atradr);
@@ -360,19 +278,11 @@ static Aptr getatr(atradr, atr)
Set a particular attribute to a value.
*/
-#ifdef _PROTOTYPES_
static void setatr(
Aaddr atradr, /* IN - ACODE address to attribute table */
Aword atr, /* IN - attribute code */
Aword val /* IN - new value */
-)
-#else
-static void setatr(atradr, atr, val)
- Aaddr atradr; /* IN - ACODE address to attribute table */
- Aword atr; /* IN - attribute code */
- Aword val; /* IN - new value */
-#endif
-{
+) {
AtrElem *at;
at = (AtrElem *) addrTo(atradr);
@@ -386,44 +296,19 @@ static void setatr(atradr, atr, val)
*/
-#ifdef _PROTOTYPES_
-static void makloc(Aword loc, Aword atr, Aword val)
-#else
-static void makloc(loc, atr, val)
- Aword loc, atr, val;
-#endif
-{
+static void makloc(Aword loc, Aword atr, Aword val) {
setatr(locs[loc-LOCMIN].atrs, atr, val);
}
-#ifdef _PROTOTYPES_
-static void makobj(Aword obj, Aword atr, Aword val)
-#else
-static void makobj(obj, atr, val)
- Aword obj, atr, val;
-#endif
-{
+static void makobj(Aword obj, Aword atr, Aword val) {
setatr(objs[obj-OBJMIN].atrs, atr, val);
}
-#ifdef _PROTOTYPES_
-static void makact(Aword act, Aword atr, Aword val)
-#else
-static void makact(act, atr, val)
- Aword act, atr, val;
-#endif
-{
+static void makact(Aword act, Aword atr, Aword val) {
setatr(acts[act-ACTMIN].atrs, atr, val);
}
-
-#ifdef _PROTOTYPES_
-void make(Aword id, Aword atr, Aword val)
-#else
-void make(id, atr, val)
- Aword id, atr, val;
-#endif
-{
+void make(Aword id, Aword atr, Aword val) {
char str[80];
if (isObj(id))
@@ -445,46 +330,20 @@ void make(id, atr, val)
*/
-#ifdef _PROTOTYPES_
-static void setloc(Aword loc, Aword atr, Aword val)
-#else
-static void setloc(loc, atr, val)
- Aword loc, atr, val;
-#endif
-{
+static void setloc(Aword loc, Aword atr, Aword val) {
setatr(locs[loc-LOCMIN].atrs, atr, val);
locs[loc-LOCMIN].describe = 0;
}
-
-#ifdef _PROTOTYPES_
-static void setobj(Aword obj, Aword atr, Aword val)
-#else
-static void setobj(obj, atr, val)
- Aword obj, atr, val;
-#endif
-{
+static void setobj(Aword obj, Aword atr, Aword val) {
setatr(objs[obj-OBJMIN].atrs, atr, val);
}
-#ifdef _PROTOTYPES_
-static void setact(Aword act, Aword atr, Aword val)
-#else
-static void setact(act, atr, val)
- Aword act, atr, val;
-#endif
-{
+static void setact(Aword act, Aword atr, Aword val) {
setatr(acts[act-ACTMIN].atrs, atr, val);
}
-
-#ifdef _PROTOTYPES_
-void set(Aword id, Aword atr, Aword val)
-#else
-void set(id, atr, val)
- Aword id, atr, val;
-#endif
-{
+void set(Aword id, Aword atr, Aword val) {
char str[80];
if (isObj(id))
@@ -499,14 +358,7 @@ void set(id, atr, val)
}
}
-
-#ifdef _PROTOTYPES_
-void setstr(Aword id, Aword atr, Aword str)
-#else
-void setstr(id, atr, str)
- Aword id, atr, str;
-#endif
-{
+void setstr(Aword id, Aword atr, Aword str) {
free((char *)attribute(id, atr));
set(id, atr, str);
}
@@ -526,64 +378,31 @@ void setstr(id, atr, str)
Increment a particular attribute by a value.
*/
-#ifdef _PROTOTYPES_
static void incratr(
Aaddr atradr, /* IN - ACODE address to attribute table */
Aword atr, /* IN - attribute code */
Aword step /* IN - step to increment by */
-)
-#else
-static void incratr(atradr, atr, step)
- Aaddr atradr, atr, step;
-#endif
-{
+) {
AtrElem *at;
at = (AtrElem *) addrTo(atradr);
at[atr-1].val += step;
}
-
-#ifdef _PROTOTYPES_
-static void incrloc(Aword loc, Aword atr, Aword step)
-#else
-static void incrloc(loc, atr, step)
- Aword loc, atr, step;
-#endif
-{
+static void incrloc(Aword loc, Aword atr, Aword step) {
incratr(locs[loc-LOCMIN].atrs, atr, step);
locs[loc-LOCMIN].describe = 0;
}
-
-#ifdef _PROTOTYPES_
-static void incrobj(Aword obj, Aword atr, Aword step)
-#else
-static void incrobj(obj, atr, step)
- Aword obj, atr, step;
-#endif
-{
+static void incrobj(Aword obj, Aword atr, Aword step) {
incratr(objs[obj-OBJMIN].atrs, atr, step);
}
-#ifdef _PROTOTYPES_
-static void incract(Aword act, Aword atr, Aword step)
-#else
-static void incract(act, atr, step)
- Aword act, atr, step;
-#endif
-{
+static void incract(Aword act, Aword atr, Aword step) {
incratr(acts[act-ACTMIN].atrs, atr, step);
}
-
-#ifdef _PROTOTYPES_
-void incr(Aword id, Aword atr, Aword step)
-#else
-void incr(id, atr, step)
- Aword id, atr, step;
-#endif
-{
+void incr(Aword id, Aword atr, Aword step) {
char str[80];
if (isObj(id))
@@ -598,13 +417,7 @@ void incr(id, atr, step)
}
}
-#ifdef _PROTOTYPES_
-void decr(Aword id, Aword atr, Aword step)
-#else
-void decr(id, atr, step)
- Aword id, atr, step;
-#endif
-{
+void decr(Aword id, Aword atr, Aword step) {
char str[80];
if (isObj(id))
@@ -620,52 +433,25 @@ void decr(id, atr, step)
}
-
/*----------------------------------------------------------------------
attribute()
*/
-#ifdef _PROTOTYPES_
-static Aptr locatr(Aword loc, Aword atr)
-#else
-static Aptr locatr(loc, atr)
- Aword loc, atr;
-#endif
-{
+static Aptr locatr(Aword loc, Aword atr) {
return getatr(locs[loc-LOCMIN].atrs, atr);
}
-
-
-#ifdef _PROTOTYPES_
-static Aptr objatr(Aword obj, Aword atr)
-#else
-static Aptr objatr(obj, atr)
- Aword obj, atr;
-#endif
-{
+static Aptr objatr(Aword obj, Aword atr) {
return getatr(objs[obj-OBJMIN].atrs, atr);
}
-#ifdef _PROTOTYPES_
-static Aptr actatr(Aword act, Aword atr)
-#else
-static Aptr actatr(act, atr)
- Aword act, atr;
-#endif
-{
+static Aptr actatr(Aword act, Aword atr) {
return getatr(acts[act-ACTMIN].atrs, atr);
}
-#ifdef _PROTOTYPES_
-static Aptr litatr(Aword lit, Aword atr)
-#else
-static Aptr litatr(lit, atr)
- Aword lit, atr;
-#endif
-{
+static Aptr litatr(Aword lit, Aword atr) {
char str[80];
if (atr == 1)
@@ -677,14 +463,7 @@ static Aptr litatr(lit, atr)
return (Aptr)EOF;
}
-
-#ifdef _PROTOTYPES_
-Aptr attribute(Aword id, Aword atr)
-#else
-Aptr attribute(id, atr)
- Aword id, atr;
-#endif
-{
+Aptr attribute(Aword id, Aword atr) {
char str[80];
if (isObj(id))
@@ -702,14 +481,7 @@ Aptr attribute(id, atr)
return (Aptr)EOF;
}
-
-#ifdef _PROTOTYPES_
-Aptr strattr(Aword id, Aword atr)
-#else
-Aptr strattr(id, atr)
- Aword id, atr;
-#endif
-{
+Aptr strattr(Aword id, Aword atr) {
return (Aptr) strdup((char *)attribute(id, atr));
}
@@ -720,13 +492,7 @@ Aptr strattr(id, atr)
*/
-#ifdef _PROTOTYPES_
-static Aword objloc(Aword obj)
-#else
-static Aword objloc(obj)
- Aword obj;
-#endif
-{
+static Aword objloc(Aword obj) {
if (isCnt(objs[obj-OBJMIN].loc)) /* In something ? */
if (isObj(objs[obj-OBJMIN].loc) || isAct(objs[obj-OBJMIN].loc))
return(where(objs[obj-OBJMIN].loc));
@@ -736,25 +502,11 @@ static Aword objloc(obj)
return(objs[obj-OBJMIN].loc);
}
-
-#ifdef _PROTOTYPES_
-static Aword actloc(Aword act)
-#else
-static Aword actloc(act)
- Aword act;
-#endif
-{
+static Aword actloc(Aword act) {
return(acts[act-ACTMIN].loc);
}
-
-#ifdef _PROTOTYPES_
-Aword where(Aword id)
-#else
-Aword where(id)
- Aword id;
-#endif
-{
+Aword where(Aword id) {
char str[80];
if (isObj(id))
@@ -769,20 +521,13 @@ Aword where(id)
}
-
/*----------------------------------------------------------------------
aggregates
*/
-#ifdef _PROTOTYPES_
-Aint agrmax(Aword atr, Aword whr)
-#else
-Aint agrmax(atr, whr)
- Aword atr, whr;
-#endif
-{
+Aint agrmax(Aword atr, Aword whr) {
Aword i;
Aint max = 0;
@@ -796,13 +541,7 @@ Aint agrmax(atr, whr)
return(max);
}
-#ifdef _PROTOTYPES_
-Aint agrsum(Aword atr, Aword whr)
-#else
-Aint agrsum(atr, whr)
- Aword atr, whr;
-#endif
-{
+Aint agrsum(Aword atr, Aword whr) {
Aword i;
Aint sum = 0;
@@ -816,14 +555,7 @@ Aint agrsum(atr, whr)
return(sum);
}
-
-#ifdef _PROTOTYPES_
-Aint agrcount(Aword whr)
-#else
-Aint agrcount(whr)
- Aword whr;
-#endif
-{
+Aint agrcount(Aword whr) {
Aword i;
Aword count = 0;
@@ -844,13 +576,7 @@ Aint agrcount(whr)
*/
-#ifdef _PROTOTYPES_
-static void locobj(Aword obj, Aword whr)
-#else
-static void locobj(obj, whr)
- Aword obj, whr;
-#endif
-{
+static void locobj(Aword obj, Aword whr) {
if (isCnt(whr)) { /* Into a container */
if (whr == obj)
syserr("Locating something inside itself.");
@@ -865,14 +591,7 @@ static void locobj(obj, whr)
}
}
-
-#ifdef _PROTOTYPES_
-static void locact(Aword act, Aword whr)
-#else
-static void locact(act, whr)
- Aword act, whr;
-#endif
-{
+static void locact(Aword act, Aword whr) {
Aword prevact = cur.act;
Aword prevloc = cur.loc;
@@ -904,14 +623,7 @@ static void locact(act, whr)
cur.loc = prevloc;
}
-
-#ifdef _PROTOTYPES_
-void locate(Aword id, Aword whr)
-#else
-void locate(id, whr)
- Aword id, whr;
-#endif
-{
+void locate(Aword id, Aword whr) {
char str[80];
if (isObj(id))
@@ -931,13 +643,7 @@ void locate(id, whr)
*/
-#ifdef _PROTOTYPES_
-static Abool objhere(Aword obj)
-#else
-static Abool objhere(obj)
- Aword obj;
-#endif
-{
+static Abool objhere(Aword obj) {
if (isCnt(objs[obj-OBJMIN].loc)) { /* In something? */
if (isObj(objs[obj-OBJMIN].loc) || isAct(objs[obj-OBJMIN].loc))
return(isHere(objs[obj-OBJMIN].loc));
@@ -947,25 +653,11 @@ static Abool objhere(obj)
return(objs[obj-OBJMIN].loc == cur.loc);
}
-
-#ifdef _PROTOTYPES_
-static Aword acthere(Aword act)
-#else
-static Aword acthere(act)
- Aword act;
-#endif
-{
+static Aword acthere(Aword act) {
return(acts[act-ACTMIN].loc == cur.loc);
}
-
-#ifdef _PROTOTYPES_
-Abool isHere(Aword id)
-#else
-Abool isHere(id)
- Aword id;
-#endif
-{
+Abool isHere(Aword id) {
char str[80];
if (isObj(id))
@@ -985,13 +677,7 @@ Abool isHere(id)
*/
-#ifdef _PROTOTYPES_
-static Aword objnear(Aword obj)
-#else
-static Aword objnear(obj)
- Aword obj;
-#endif
-{
+static Aword objnear(Aword obj) {
if (isCnt(objs[obj-OBJMIN].loc)) { /* In something? */
if (isObj(objs[obj-OBJMIN].loc) || isAct(objs[obj-OBJMIN].loc))
return(isNear(objs[obj-OBJMIN].loc));
@@ -1001,25 +687,11 @@ static Aword objnear(obj)
return(exitto(where(obj), cur.loc));
}
-
-#ifdef _PROTOTYPES_
-static Aword actnear(Aword act)
-#else
-static Aword actnear(act)
- Aword act;
-#endif
-{
+static Aword actnear(Aword act) {
return(exitto(where(act), cur.loc));
}
-
-#ifdef _PROTOTYPES_
-Abool isNear(Aword id)
-#else
-Abool isNear(id)
- Aword id;
-#endif
-{
+Abool isNear(Aword id) {
char str[80];
if (isObj(id))
@@ -1034,21 +706,13 @@ Abool isNear(id)
}
-
/*----------------------------------------------------------------------
in()
*/
-#ifdef _PROTOTYPES_
-Abool in(Aword obj, Aword cnt)
-#else
-Abool in(obj, cnt)
- Aword obj;
- Aword cnt;
-#endif
-{
+Abool in(Aword obj, Aword cnt) {
if (!isObj(obj))
return(FALSE);
if (!isCnt(cnt))
@@ -1064,45 +728,19 @@ Abool in(obj, cnt)
*/
-#ifdef _PROTOTYPES_
-static void sayloc(Aword loc)
-#else
-static void sayloc(loc)
- Aword loc;
-#endif
-{
+static void sayloc(Aword loc) {
interpret(locs[loc-LOCMIN].nams);
}
-
-#ifdef _PROTOTYPES_
-static void sayobj(Aword obj)
-#else
-static void sayobj(obj)
- Aword obj;
-#endif
-{
+static void sayobj(Aword obj) {
interpret(objs[obj-OBJMIN].dscr2);
}
-#ifdef _PROTOTYPES_
-static void sayact(Aword act)
-#else
-static void sayact(act)
- Aword act;
-#endif
-{
+static void sayact(Aword act) {
interpret(acts[act-ACTMIN].nam);
}
-
-#ifdef _PROTOTYPES_
-void sayint(Aword val)
-#else
-void sayint(val)
- Aword val;
-#endif
-{
+void sayint(Aword val) {
char buf[25];
if (isHere(HERO)) {
@@ -1111,27 +749,13 @@ void sayint(val)
}
}
-
-#ifdef _PROTOTYPES_
-void saystr(char *str)
-#else
-void saystr(str)
- char *str;
-#endif
-{
+void saystr(char *str) {
if (isHere(HERO))
output(str);
free(str);
}
-
-#ifdef _PROTOTYPES_
-static void saylit(Aword lit)
-#else
-static void saylit(lit)
- Aword lit;
-#endif
-{
+static void saylit(Aword lit) {
char *str;
if (isNum(lit))
@@ -1142,14 +766,7 @@ static void saylit(lit)
}
}
-
-#ifdef _PROTOTYPES_
-void sayarticle(Aword id)
-#else
-void sayarticle(id)
- Aword id;
-#endif
-{
+void sayarticle(Aword id) {
if (!isObj(id))
syserr("Trying to say article of something *not* an object.");
if (objs[id-OBJMIN].art != 0)
@@ -1158,14 +775,7 @@ void sayarticle(id)
prmsg(M_ARTICLE);
}
-
-#ifdef _PROTOTYPES_
-void say(Aword id)
-#else
-void say(id)
- Aword id;
-#endif
-{
+void say(Aword id) {
char str[80];
if (isHere(HERO)) {
@@ -1191,25 +801,12 @@ void say(id)
*/
-#ifdef _PROTOTYPES_
-static void dscrloc(Aword loc)
-#else
-static void dscrloc(loc)
- Aword loc;
-#endif
-{
+static void dscrloc(Aword loc) {
if (locs[loc-LOCMIN].dscr != 0)
interpret(locs[loc-LOCMIN].dscr);
}
-
-#ifdef _PROTOTYPES_
-static void dscrobj(Aword obj)
-#else
-static void dscrobj(obj)
- Aword obj;
-#endif
-{
+static void dscrobj(Aword obj) {
objs[obj-OBJMIN].describe = FALSE;
if (objs[obj-OBJMIN].dscr1 != 0)
interpret(objs[obj-OBJMIN].dscr1);
@@ -1223,14 +820,7 @@ static void dscrobj(obj)
}
}
-
-#ifdef _PROTOTYPES_
-static void dscract(Aword act)
-#else
-static void dscract(act)
- Aword act;
-#endif
-{
+static void dscract(Aword act) {
ScrElem *scr = NULL;
if (acts[act-ACTMIN].script != 0) {
@@ -1253,13 +843,7 @@ static void dscract(act)
static Aword dscrstk[255];
-#ifdef _PROTOTYPES_
-void describe(Aword id)
-#else
-void describe(id)
- Aword id;
-#endif
-{
+void describe(Aword id) {
int i;
char str[80];
@@ -1289,13 +873,7 @@ void describe(id)
*/
-#ifdef _PROTOTYPES_
-void use(Aword act, Aword scr)
-#else
-void use(act, scr)
- Aword act, scr;
-#endif
-{
+void use(Aword act, Aword scr) {
char str[80];
if (!isAct(act)) {
@@ -1308,20 +886,13 @@ void use(act, scr)
}
-
/*----------------------------------------------------------------------
list()
*/
-#ifdef _PROTOTYPES_
-void list(Aword cnt)
-#else
-void list(cnt)
- Aword cnt;
-#endif
-{
+void list(Aword cnt) {
int i;
Aword props;
Aword prevobj;
@@ -1391,14 +962,7 @@ void list(cnt)
*/
-#ifdef _PROTOTYPES_
-void empty(Aword cnt, Aword whr)
-#else
-void empty(cnt, whr)
- Aword cnt;
- Aword whr;
-#endif
-{
+void empty(Aword cnt, Aword whr) {
int i;
for (i = OBJMIN; i <= OBJMAX; i++)
@@ -1407,7 +971,6 @@ void empty(cnt, whr)
}
-
/*----------------------------------------------------------------------*\
Description of current location
@@ -1418,12 +981,7 @@ void empty(cnt, whr)
\*----------------------------------------------------------------------*/
-#ifdef _PROTOTYPES_
-void dscrobjs(void)
-#else
-void dscrobjs()
-#endif
-{
+void dscrobjs() {
int i;
int prevobj;
Boolean found = FALSE;
@@ -1471,13 +1029,7 @@ void dscrobjs()
objs[i-OBJMIN].describe = TRUE;
}
-
-#ifdef _PROTOTYPES_
-void dscracts(void)
-#else
-void dscracts()
-#endif
-{
+void dscracts() {
int i;
for (i = HERO+1; i <= ACTMAX; i++)
@@ -1490,13 +1042,7 @@ void dscracts()
acts[i-ACTMIN].describe = TRUE;
}
-
-#ifdef _PROTOTYPES_
-void look(void)
-#else
-void look()
-#endif
-{
+void look() {
int i;
if (looking)
@@ -1527,7 +1073,6 @@ needsp = FALSE;
}
-
static char savfnm[256];
@@ -1544,12 +1089,7 @@ void save() {
#else
-#ifdef _PROTOTYPES_
-void save(void)
-#else
-void save()
-#endif
-{
+void save() {
int i;
char str[256];
AtrElem *atr;
@@ -1645,12 +1185,7 @@ void restore() {
#else
-#ifdef _PROTOTYPES_
-void restore(void)
-#else
-void restore()
-#endif
-{
+void restore() {
int i,tmp;
FILE *savfil;
char str[256];
@@ -1748,13 +1283,7 @@ void restore()
*/
-#ifdef _PROTOTYPES_
-Aword rnd(Aword from, Aword to)
-#else
-Aword rnd(from, to)
- Aword from, to;
-#endif
-{
+Aword rnd(Aword from, Aword to) {
if (to == from)
return to;
else if (to > from)
@@ -1771,13 +1300,7 @@ Aword rnd(from, to)
*/
-#ifdef _PROTOTYPES_
-Abool btw(Aint val, Aint low, Aint high)
-#else
-Abool btw(val, low, high)
- Aint val, low, high;
-#endif
-{
+Abool btw(Aint val, Aint low, Aint high) {
if (high > low)
return low <= val && val <= high;
else
@@ -1792,13 +1315,7 @@ Abool btw(val, low, high)
*/
-#ifdef _PROTOTYPES_
-Aword contains(Aptr string, Aptr substring)
-#else
-Aword contains(string, substring)
- Aptr string, substring;;
-#endif
-{
+Aword contains(Aptr string, Aptr substring) {
Abool found;
strlow((char *)string);
@@ -1813,7 +1330,6 @@ Aword contains(string, substring)
}
-
/*----------------------------------------------------------------------
streq()
@@ -1821,13 +1337,7 @@ Aword contains(string, substring)
Compare two strings approximately, ignore case
*/
-#ifdef _PROTOTYPES_
-Abool streq(char a[], char b[])
-#else
-Abool streq(a, b)
- char a[], b[]; /* IN - Strings to compare */
-#endif
-{
+Abool streq(char a[], char b[]) {
Boolean eq;
strlow(a);
diff --git a/engines/glk/alan2/exe.h b/engines/glk/alan2/exe.h
index fbecac5975..1b0e5f9483 100644
--- a/engines/glk/alan2/exe.h
+++ b/engines/glk/alan2/exe.h
@@ -37,7 +37,6 @@ extern int etop; /* Event queue top pointer */
extern Boolean looking; /* LOOKING? flag */
extern int dscrstkp; /* Point into describe stack */
-#ifdef _PROTOTYPES_
extern void sys(Aword fpos, Aword len);
extern Boolean confirm(MsgKind msgno);
extern Aptr attribute(Aword item, Aword atr);
@@ -80,49 +79,6 @@ extern Aint agrcount(Aword whr);
extern Abool isHere(Aword item);
extern Abool isNear(Aword item);
-#else
-extern void sys();
-extern Boolean confirm();
-extern Aptr attribute();
-extern void say();
-extern void saynum();
-extern void saystr();
-extern Aptr strattr();
-extern void setstr();
-extern void getstr();
-extern void print();
-extern void look();
-extern void make();
-extern void set();
-extern void incr();
-extern void decr();
-extern void use();
-extern void describe();
-extern void list();
-extern void locate();
-extern void empty();
-extern void score();
-extern void visits();
-extern void schedule();
-extern void cancl();
-extern void quit();
-extern void restart();
-extern void save();
-extern void restore();
-extern void say();
-extern void sayint();
-extern Aword rnd();
-extern Abool btw();
-extern Aword contains()
-extern Abool streq();
-extern Abool in();
-extern Aword where();
-extern Aword agrmax();
-extern Aword agrsum();
-extern Abool isHere();
-extern Abool isNear();
-#endif
-
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/inter.cpp b/engines/glk/alan2/inter.cpp
index dd3ee9e0bd..1d52b74acc 100644
--- a/engines/glk/alan2/inter.cpp
+++ b/engines/glk/alan2/inter.cpp
@@ -42,15 +42,7 @@ namespace Alan2 {
static int pc;
-#ifdef _PROTOTYPES_
-static void if_(
- Aword v
-)
-#else
-static void if_(v)
- Aword v;
-#endif
-{
+static void if_(Aword v) {
int lev = 1;
Aword i;
@@ -75,13 +67,7 @@ static void if_(v)
}
}
-
-#ifdef _PROTOTYPES_
-static void else_(void)
-#else
-static void else_()
-#endif
-{
+static void else_() {
int lev = 1;
Aword i;
@@ -101,25 +87,13 @@ static void else_()
}
}
-
-#ifdef _PROTOTYPES_
-static void depstart(void)
-#else
-static void depstart(void)
-#endif
-{
+static void depstart() {
/* A DEPSTART was executed so skip across the redundant DEPCASE to
start at the first expression */
pc++;
}
-
-#ifdef _PROTOTYPES_
-static void swap(void)
-#else
-static void swap()
-#endif
-{
+static void swap() {
Aptr v1 = pop();
Aptr v2 = pop();
@@ -127,17 +101,7 @@ static void swap()
push(v2);
}
-
-
-#ifdef _PROTOTYPES_
-static void depexec(
- Aword v
-)
-#else
-static void depexec(v)
- Aword v;
-#endif
-{
+static void depexec(Aword v) {
int lev = 1;
Aword i;
@@ -163,13 +127,7 @@ static void depexec(v)
}
}
-
-#ifdef _PROTOTYPES_
-static void depcase(void)
-#else
-static void depcase()
-#endif
-{
+static void depcase() {
int lev = 1;
Aword i;
@@ -192,14 +150,7 @@ static void depcase()
}
}
-
-#ifdef _PROTOTYPES_
-void interpret(Aaddr adr)
-#else
-void interpret(adr)
- Aaddr adr;
-#endif
-{
+void interpret(Aaddr adr) {
Aaddr oldpc;
Aword i;
diff --git a/engines/glk/alan2/inter.h b/engines/glk/alan2/inter.h
index a7fafefc59..b4ae725726 100644
--- a/engines/glk/alan2/inter.h
+++ b/engines/glk/alan2/inter.h
@@ -26,11 +26,7 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
extern void interpret(Aaddr adr);
-#else
-extern void interpret();
-#endif
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/main.cpp b/engines/glk/alan2/main.cpp
index 63ab5456f9..7f1aa8da05 100644
--- a/engines/glk/alan2/main.cpp
+++ b/engines/glk/alan2/main.cpp
@@ -131,13 +131,7 @@ Boolean skipsp = FALSE;
return buffers...
*/
-#ifdef _PROTOTYPES_
-void terminate(int code)
-#else
-void terminate(code)
- int code;
-#endif
-{
+void terminate(int code) {
#ifdef __amiga__
#ifdef AZTEC_C
#include <fcntl.h>
@@ -184,12 +178,7 @@ void terminate(code)
usage()
*/
-#ifdef _PROTOTYPES_
-void usage(void)
-#else
-void usage()
-#endif
-{
+void usage() {
printf("Usage:\n\n");
printf(" %s [<switches>] <adventure>\n\n", PROGNAME);
printf("where the possible optional switches are:\n");
@@ -216,13 +205,7 @@ void usage()
Print a little text blaming the user for the system error.
*/
-#ifdef _PROTOTYPES_
-void syserr(const char *str)
-#else
-void syserr(str)
- char *str;
-#endif
-{
+void syserr(const char *str) {
#ifdef GLK
::error("%s", str);
#else
@@ -261,13 +244,7 @@ of an Adventure that never was.$n$nSYSTEM ERROR: ");
Print an error message, force new player input and abort.
*/
-#ifdef _PROTOTYPES_
-void error(MsgKind msgno) /* IN - The error message number */
-#else
-void error(msgno)
- MsgKind msgno; /* IN - The error message number */
-#endif
-{
+void error(MsgKind msgno /* IN - The error message number */) {
if (msgno != MSGMAX)
prmsg(msgno);
wrds[wrdidx] = EOF; /* Force new player input */
@@ -285,8 +262,7 @@ void error(msgno)
Print the the status line on the top of the screen.
*/
-void statusline(void)
-{
+void statusline() {
#ifdef GLK
uint glkWidth;
char line[100];
@@ -354,15 +330,13 @@ needsp = FALSE;
Print some text and log it if logging is on.
*/
-void logprint(char str[])
-{
+void logprint(char str[]) {
printf(str);
if (logflg)
fprintf(logfil, "%s", str);
}
-
/*======================================================================
newline()
@@ -370,12 +344,7 @@ void logprint(char str[])
Make a newline, but check for screen full.
*/
-#ifdef _PROTOTYPES_
-void newline(void)
-#else
-void newline()
-#endif
-{
+void newline() {
#ifdef GLK
g_vm->glk_put_char('\n');
#else
@@ -409,12 +378,7 @@ void newline()
Make a new paragraph, i.e one empty line (one or two newlines).
*/
-#ifdef _PROTOTYPES_
-void para(void)
-#else
-void para()
-#endif
-{
+void para() {
if (col != 1)
newline();
newline();
@@ -428,12 +392,7 @@ void para()
Clear the screen.
*/
-#ifdef _PROTOTYPES_
-void clear(void)
-#else
-void clear()
-#endif
-{
+void clear() {
#ifdef GLK
g_vm->glk_window_clear(glkMainWin);
#else
@@ -453,13 +412,7 @@ void clear()
Safely allocate new memory.
*/
-#ifdef _PROTOTYPES_
-void *allocate(unsigned long len) /* IN - Length to allocate */
-#else
-void *allocate(len)
- unsigned long len; /* IN - Length to allocate */
-#endif
-{
+void *allocate(unsigned long len /* IN - Length to allocate */) {
void *p = (void *)malloc((size_t)len);
if (p == NULL)
@@ -476,13 +429,7 @@ void *allocate(len)
Justify a string so that it wraps at end of screen.
*/
-#ifdef _PROTOTYPES_
-static void just(char str[])
-#else
-static void just(str)
- char str[];
-#endif
-{
+static void just(char str[]) {
#ifdef GLK
logprint(str);
#else
@@ -524,12 +471,7 @@ static void just(str)
Output a space if needed.
*/
-#ifdef _PROTOTYPES_
-static void space(void)
-#else
-static void space()
-#endif
-{
+static void space() {
if (skipsp)
skipsp = FALSE;
else {
@@ -542,7 +484,6 @@ static void space()
}
-
/*----------------------------------------------------------------------
sayparam()
@@ -551,13 +492,7 @@ static void space()
them if possible.
*/
-#ifdef _PROTOTYPES_
-static void sayparam(int p)
-#else
-static void sayparam(p)
- int p;
-#endif
-{
+static void sayparam(int p) {
int i;
for (i = 0; i <= p; i++)
@@ -591,15 +526,9 @@ static void sayparam(p)
T = tabulation
$ = no space needed after this
*/
-#ifdef _PROTOTYPES_
static void prsym(
- char *str /* IN - The string starting with '$' */
-)
-#else
-static void prsym(str)
- char *str; /* IN - The string starting with '$' */
-#endif
-{
+ char *str /* IN - The string starting with '$' */
+) {
switch (toLower(str[1])) {
case 'n':
newline();
@@ -671,13 +600,7 @@ static void prsym(str)
recogniced and performed.
*/
-#ifdef _PROTOTYPES_
-void output(char original[])
-#else
-void output(original)
- char original[];
-#endif
-{
+void output(char original[]) {
char ch;
char *str, *copy;
char *symptr;
@@ -718,13 +641,7 @@ void output(original)
Print a message from the message table.
*/
-#ifdef _PROTOTYPES_
-void prmsg(MsgKind msg) /* IN - message number */
-#else
-void prmsg(msg)
- MsgKind msg; /* IN - message number */
-#endif
-{
+void prmsg(MsgKind msg /* IN - message number */) {
interpret(msgs[msg].stms);
}
@@ -739,91 +656,41 @@ void prmsg(msg)
\*----------------------------------------------------------------------*/
/* How to know we are at end of a table */
-#ifdef _PROTOTYPES_
-Boolean eot(Aword *adr)
-#else
-Boolean eot(adr)
- Aword *adr;
-#endif
-{
+Boolean eot(Aword *adr) {
return *adr == EOF;
}
-
-#ifdef _PROTOTYPES_
-Boolean isObj(Aword x)
-#else
-Boolean isObj(x)
- Aword x;
-#endif
-{
+Boolean isObj(Aword x) {
return x >= OBJMIN && x <= OBJMAX;
}
-#ifdef _PROTOTYPES_
-Boolean isCnt(Aword x)
-#else
-Boolean isCnt(x)
- Aword x;
-#endif
-{
+Boolean isCnt(Aword x) {
return (x >= CNTMIN && x <= CNTMAX) ||
(isObj(x) && objs[x-OBJMIN].cont != 0) ||
(isAct(x) && acts[x-ACTMIN].cont != 0);
}
-#ifdef _PROTOTYPES_
-Boolean isAct(Aword x)
-#else
-Boolean isAct(x)
- Aword x;
-#endif
-{
+Boolean isAct(Aword x) {
return x >= ACTMIN && x <= ACTMAX;
}
-#ifdef _PROTOTYPES_
-Boolean isLoc(Aword x)
-#else
-Boolean isLoc(x)
- Aword x;
-#endif
-{
+Boolean isLoc(Aword x) {
return x >= LOCMIN && x <= LOCMAX;
}
-#ifdef _PROTOTYPES_
-Boolean isNum(Aword x)
-#else
-Boolean isNum(x)
- Aword x;
-#endif
-{
+Boolean isNum(Aword x) {
return x >= LITMIN && x <= LITMAX && litValues[x-LITMIN].type == TYPNUM;
}
-#ifdef _PROTOTYPES_
-Boolean isStr(Aword x)
-#else
-Boolean isStr(x)
- Aword x;
-#endif
-{
+Boolean isStr(Aword x) {
return x >= LITMIN && x <= LITMAX && litValues[x-LITMIN].type == TYPSTR;
}
-#ifdef _PROTOTYPES_
-Boolean isLit(Aword x)
-#else
-Boolean isLit(x)
- Aword x;
-#endif
-{
+Boolean isLit(Aword x) {
return x >= LITMIN && x <= LITMAX;
}
-
/*======================================================================
exitto()
@@ -831,13 +698,7 @@ Boolean isLit(x)
Is there an exit from one location to another?
*/
-#ifdef _PROTOTYPES_
-Boolean exitto(int to, int from)
-#else
-Boolean exitto(to, from)
- int to, from;
-#endif
-{
+Boolean exitto(int to, int from) {
ExtElem *ext;
if (locs[from-LOCMIN].exts == 0)
@@ -849,8 +710,7 @@ Boolean exitto(to, from)
return(FALSE);
}
-
-
+
#ifdef CHECKOBJ
/*======================================================================
@@ -898,13 +758,7 @@ void checkobj(obj)
Count the number of items in a container.
*/
-#ifdef _PROTOTYPES_
-static int count(int cnt) /* IN - the container to count */
-#else
-static int count(cnt)
- int cnt; /* IN - the container to count */
-#endif
-{
+static int count(int cnt /* IN - the container to count */) {
int i, j = 0;
for (i = OBJMIN; i <= OBJMAX; i++)
@@ -915,24 +769,16 @@ static int count(cnt)
}
-
/*----------------------------------------------------------------------
sumatr()
Sum the values of one attribute in a container. Recursively.
*/
-#ifdef _PROTOTYPES_
static int sumatr(
Aword atr, /* IN - the attribute to sum over */
Aword cnt /* IN - the container to sum */
-)
-#else
-static int sumatr(atr, cnt)
- Aword atr; /* IN - the attribute to sum over */
- Aword cnt; /* IN - the container to sum */
-#endif
-{
+) {
int i;
int sum = 0;
@@ -946,25 +792,16 @@ static int sumatr(atr, cnt)
}
-
-
/*======================================================================
checklim()
Checks if a limit for a container is exceeded.
*/
-#ifdef _PROTOTYPES_
Boolean checklim(
Aword cnt, /* IN - Container code */
Aword obj /* IN - The object to add */
-)
-#else
-Boolean checklim(cnt, obj)
- Aword cnt; /* IN - Container code */
- Aword obj; /* IN - The object to add */
-#endif
-{
+) {
LimElem *lim;
Aword props;
@@ -999,9 +836,6 @@ Boolean checklim(cnt, obj)
}
-
-
-
/*----------------------------------------------------------------------*\
Action routines
@@ -1016,17 +850,10 @@ Boolean checklim(cnt, obj)
Tries a check, returns TRUE if it passed, FALSE else.
*/
-#ifdef _PROTOTYPES_
static Boolean trycheck(
Aaddr adr, /* IN - ACODE address to check table */
Boolean act /* IN - Act if it fails ? */
-)
-#else
-static Boolean trycheck(adr, act)
- Aaddr adr; /* IN - ACODE address to check table */
- Boolean act; /* IN - Act if it fails ? */
-#endif
-{
+) {
ChkElem *chk;
chk = (ChkElem *) addrTo(adr);
@@ -1054,13 +881,7 @@ static Boolean trycheck(adr, act)
Move hero in a direction.
*/
-#ifdef _PROTOTYPES_
-void go(int dir)
-#else
-void go(dir)
- int dir;
-#endif
-{
+void go(int dir) {
ExtElem *ext;
Boolean ok;
Aword oldloc;
@@ -1109,7 +930,6 @@ void go(dir)
}
-
/*----------------------------------------------------------------------
findalt()
@@ -1118,17 +938,10 @@ void go(dir)
the address to it.
*/
-#ifdef _PROTOTYPES_
static AltElem *findalt(
Aword vrbsadr, /* IN - Address to start of list */
Aword param /* IN - Which parameter to match */
-)
-#else
-static AltElem *findalt(vrbsadr, param)
- Aword vrbsadr; /* IN - Address to start of list */
- Aword param; /* IN - Which parameter to match */
-#endif
-{
+) {
VrbElem *vrb;
AltElem *alt;
@@ -1146,8 +959,6 @@ static AltElem *findalt(vrbsadr, param)
}
-
-
/*======================================================================
possible()
@@ -1155,12 +966,7 @@ static AltElem *findalt(vrbsadr, param)
Check if current action is possible according to the CHECKs.
*/
-#ifdef _PROTOTYPES_
-Boolean possible(void)
-#else
-Boolean possible()
-#endif
-{
+Boolean possible() {
AltElem *alt[MAXPARAMS+2]; /* List of alt-pointers, one for each param */
int i; /* Parameter index */
@@ -1197,7 +1003,6 @@ Boolean possible()
}
-
/*----------------------------------------------------------------------
do_it()
@@ -1205,12 +1010,7 @@ Boolean possible()
Execute the action commanded by hero.
*/
-#ifdef _PROTOTYPES_
-static void do_it(void)
-#else
-static void do_it()
-#endif
-{
+static void do_it() {
AltElem *alt[MAXPARAMS+2]; /* List of alt-pointers, one for each param */
Boolean done[MAXPARAMS+2]; /* Is it done */
int i; /* Parameter index */
@@ -1339,7 +1139,6 @@ static void do_it()
}
-
/*======================================================================
action()
@@ -1348,15 +1147,7 @@ static void do_it()
such as THEM or lists of objects.
*/
-#ifdef _PROTOTYPES_
-void action(
- ParamElem plst[] /* IN - Plural parameter list */
-)
-#else
-void action(plst)
- ParamElem plst[];
-#endif
-{
+void action(ParamElem plst[] /* IN - Plural parameter list */) {
int i, mpos;
char marker[10];
@@ -1380,7 +1171,6 @@ void action(plst)
}
-
/*----------------------------------------------------------------------*\
Event Handling
@@ -1395,12 +1185,7 @@ void action(plst)
Check if any events are pending. If so execute them.
*/
-#ifdef _PROTOTYPES_
-static void eventchk(void)
-#else
-static void eventchk()
-#endif
-{
+static void eventchk() {
while (etop != 0 && eventq[etop-1].time == cur.tick) {
etop--;
if (isLoc(eventq[etop].where))
@@ -1417,9 +1202,6 @@ static void eventchk()
}
-
-
-
/*----------------------------------------------------------------------*\
Main program and initialisation
@@ -1450,13 +1232,7 @@ static char logfnm[256];
checkvers()
*/
-#ifdef _PROTOTYPES_
-static void checkvers(AcdHdr *header)
-#else
-static void checkvers(header)
- AcdHdr *header;
-#endif
-{
+static void checkvers(AcdHdr *header) {
char vers[4];
char state[2];
@@ -1508,12 +1284,7 @@ static void checkvers(header)
load()
*/
-#ifdef _PROTOTYPES_
-static void load(void)
-#else
-static void load()
-#endif
-{
+static void load() {
AcdHdr tmphdr;
Aword crc = 0;
int i;
@@ -1598,12 +1369,7 @@ static void load()
checkdebug()
*/
-#ifdef _PROTOTYPES_
-static void checkdebug(void)
-#else
-static void checkdebug()
-#endif
-{
+static void checkdebug() {
/* Make sure he can't debug if not allowed! */
if (!header->debug) {
if (dbgflg|trcflg|stpflg)
@@ -1628,12 +1394,7 @@ static void checkdebug()
initheader()
*/
-#ifdef _PROTOTYPES_
-static void initheader(void)
-#else
-static void initheader()
-#endif
-{
+static void initheader() {
dict = (WrdElem *) addrTo(header->dict);
/* Find out number of entries in dictionary */
for (dictsize = 0; !endOfTable(&dict[dictsize]); dictsize++);
@@ -1658,12 +1419,7 @@ static void initheader()
initstrings()
*/
-#ifdef _PROTOTYPES_
-static void initstrings(void)
-#else
-static void initstrings()
-#endif
-{
+static void initstrings() {
IniElem *init;
for (init = (IniElem *) addrTo(header->init); !endOfTable(init); init++) {
@@ -1678,12 +1434,7 @@ static void initstrings()
start()
*/
-#ifdef _PROTOTYPES_
-static void start(void)
-#else
-static void start()
-#endif
-{
+static void start() {
int startloc;
cur.tick = -1;
@@ -1707,12 +1458,7 @@ static void start()
Initialization, program load etc.
*/
-#ifdef _PROTOTYPES_
-static void init(void)
-#else
-static void init()
-#endif
-{
+static void init() {
int i;
/* Initialise some status */
@@ -1750,12 +1496,7 @@ static void init()
Let the current actor move. If player, ask him.
*/
-#ifdef _PROTOTYPES_
-static void movactor(void)
-#else
-static void movactor()
-#endif
-{
+static void movactor() {
ScrElem *scr;
StepElem *step;
ActElem *act = (ActElem *) &acts[cur.act-ACTMIN];
@@ -1844,12 +1585,7 @@ static void movactor()
Open the necessary files.
*/
-#ifdef _PROTOTYPES_
-static void openFiles(void)
-#else
-static void openFiles()
-#endif
-{
+static void openFiles() {
char str[256];
char *usr = "";
time_t tick;
diff --git a/engines/glk/alan2/main.h b/engines/glk/alan2/main.h
index c72549f3fb..4a47b775f5 100644
--- a/engines/glk/alan2/main.h
+++ b/engines/glk/alan2/main.h
@@ -97,8 +97,6 @@ extern Boolean needsp;
#define endOfTable(x) eot((Aword *) x)
-
-#ifdef _PROTOTYPES_
extern void *allocate(unsigned long len);
extern void terminate(int code);
extern void usage(void);
@@ -128,29 +126,6 @@ extern Boolean isStr(Aword x);
/* Run the game! */
extern void run(void);
-#else
-extern void *allocate();
-extern void terminate();
-extern void syserr();
-extern void usage();
-extern void error();
-extern void output();
-extern void statusline();
-extern void prmsg();
-extern void print();
-extern void para();
-extern void newline();
-extern Boolean checklim();
-extern Boolean possible();
-extern Boolean eot();
-extern Boolean isObj();
-extern Boolean isCnt();
-extern Boolean isAct();
-extern Boolean isLoc();
-extern Boolean isLit();
-extern void run();
-#endif
-
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/params.cpp b/engines/glk/alan2/params.cpp
index b8851035f2..e5414bdf32 100644
--- a/engines/glk/alan2/params.cpp
+++ b/engines/glk/alan2/params.cpp
@@ -27,13 +27,7 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
-void compact(ParamElem a[])
-#else
-void compact(a)
- ParamElem a[];
-#endif
-{
+void compact(ParamElem a[]) {
int i, j;
for (i = 0, j = 0; a[j].code != (Aword)EOF; j++)
@@ -42,14 +36,7 @@ void compact(a)
a[i].code = (Aword)EOF;
}
-
-#ifdef _PROTOTYPES_
-int lstlen(ParamElem a[])
-#else
-int lstlen(a)
- ParamElem a[];
-#endif
-{
+int lstlen(ParamElem a[]) {
int i = 0;
while (a[i].code != (Aword)EOF)
@@ -57,29 +44,14 @@ int lstlen(a)
return (i);
}
-
-#ifdef _PROTOTYPES_
-Boolean inlst(ParamElem l[], Aword e)
-#else
-Boolean inlst(l, e)
- ParamElem l[];
- Aword e;
-#endif
-{
+Boolean inlst(ParamElem l[], Aword e) {
int i;
for (i = 0; l[i].code != (Aword)EOF && l[i].code != e; i++);
return (l[i].code == e);
}
-
-#ifdef _PROTOTYPES_
-void lstcpy(ParamElem a[], ParamElem b[])
-#else
-void lstcpy(a, b)
- ParamElem a[], b[];
-#endif
-{
+void lstcpy(ParamElem a[], ParamElem b[]) {
int i;
for (i = 0; b[i].code != (Aword)EOF; i++)
@@ -87,14 +59,7 @@ void lstcpy(a, b)
a[i].code = (Aword)EOF;
}
-
-#ifdef _PROTOTYPES_
-void sublst(ParamElem a[], ParamElem b[])
-#else
-void sublst(a, b)
- ParamElem a[], b[];
-#endif
-{
+void sublst(ParamElem a[], ParamElem b[]) {
int i;
for (i = 0; a[i].code != (Aword)EOF; i++)
@@ -103,14 +68,7 @@ void sublst(a, b)
compact(a);
}
-
-#ifdef _PROTOTYPES_
-void mrglst(ParamElem a[], ParamElem b[])
-#else
-void mrglst(a, b)
- ParamElem a[], b[];
-#endif
-{
+void mrglst(ParamElem a[], ParamElem b[]) {
int i,last;
for (last = 0; a[last].code != (Aword)EOF; last++); /* Find end of list */
@@ -121,14 +79,7 @@ void mrglst(a, b)
}
}
-
-#ifdef _PROTOTYPES_
-void isect(ParamElem a[], ParamElem b[])
-#else
-void isect(a, b)
- ParamElem a[], b[];
-#endif
-{
+void isect(ParamElem a[], ParamElem b[]) {
int i, last = 0;
for (i = 0; a[i].code != (Aword)EOF; i++)
@@ -137,15 +88,7 @@ void isect(a, b)
a[last].code = (Aword)EOF;
}
-
-#ifdef _PROTOTYPES_
-void cpyrefs(ParamElem p[], Aword r[])
-#else
-void cpyrefs(p, r)
- ParamElem p[];
- Aword r[];
-#endif
-{
+void cpyrefs(ParamElem p[], Aword r[]) {
int i;
for (i = 0; r[i] != (Aword)EOF; i++) {
diff --git a/engines/glk/alan2/params.h b/engines/glk/alan2/params.h
index 82fa84be9c..88bee5d41f 100644
--- a/engines/glk/alan2/params.h
+++ b/engines/glk/alan2/params.h
@@ -40,7 +40,6 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
extern void compact(ParamElem *a);
extern int lstlen(ParamElem *a);
extern Boolean inlst(ParamElem *l, Aword e);
@@ -49,16 +48,6 @@ extern void sublst(ParamElem *a, ParamElem *b);
extern void mrglst(ParamElem *a, ParamElem *b);
extern void isect(ParamElem *a, ParamElem *b);
extern void cpyrefs(ParamElem *p, Aword *r);
-#else
-extern void compact();
-extern int lstlen();
-extern Boolean inlst();
-extern void lstcpy();
-extern void sublst();
-extern void mrglst();
-extern void isect();
-extern void cpyrefs();
-#endif
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/parse.cpp b/engines/glk/alan2/parse.cpp
index 41a442438c..a399605107 100644
--- a/engines/glk/alan2/parse.cpp
+++ b/engines/glk/alan2/parse.cpp
@@ -97,16 +97,7 @@ static char isobuf[LISTLEN+1]; /* The input buffer in ISO */
static Boolean eol = TRUE; /* Looking at End of line? Yes, initially */
-
-#ifdef _PROTOTYPES_
-static void unknown(
- char token[]
-)
-#else
-static void unknown(token)
- char token[];
-#endif
-{
+static void unknown(char token[]) {
char *str = (char *)allocate((int)strlen(token)+4);
str[0] = '\'';
@@ -122,19 +113,10 @@ static void unknown(token)
}
-
static char *token;
-#ifdef _PROTOTYPES_
-static int lookup(
- char wrd[]
-)
-#else
-static int lookup(wrd)
- char wrd[];
-#endif
-{
+static int lookup(char wrd[]) {
int i;
for (i = 0; !endOfTable(&dict[i]); i++) {
@@ -145,31 +127,14 @@ static int lookup(wrd)
return(EOF);
}
-
-#ifdef _PROTOTYPES_
-static int number(
- char token[] /* IN - The string to convert to a number */
-)
-#else
-static int number(token)
- char token[]; /* IN - The string to convert to a number */
-#endif
-{
+static int number(char token[] /* IN - The string to convert to a number */) {
int i;
sscanf(token, "%d", &i);
return i;
}
-#ifdef _PROTOTYPES_
-static char *gettoken(
- char *buf
-)
-#else
-static char *gettoken(buf)
- char *buf;
-#endif
-{
+static char *gettoken(char *buf) {
static char *marker;
static char oldch;
@@ -196,13 +161,7 @@ static char *gettoken(buf)
return buf;
}
-
-#ifdef _PROTOTYPES_
-static void agetline(void)
-#else
-static void agetline()
-#endif
-{
+static void agetline() {
para();
do {
#if defined(HAVE_ANSI) || defined(GLK)
@@ -249,13 +208,7 @@ static void agetline()
lin = 1;
}
-
-#ifdef _PROTOTYPES_
-static void scan(void)
-#else
-static void scan()
-#endif
-{
+static void scan() {
int i;
int w;
char *str;
@@ -301,7 +254,6 @@ static void scan()
}
-
/*----------------------------------------------------------------------*\
PARSE DATA & PROCEDURES
@@ -321,12 +273,7 @@ static void scan()
static int allLength; /* No. of objects matching 'all' */
-#ifdef _PROTOTYPES_
-static void nonverb(void)
-#else
-static void nonverb()
-#endif
-{
+static void nonverb() {
if (isDir(wrds[wrdidx])) {
wrdidx++;
if (wrds[wrdidx] != EOF && !isConj(wrds[wrdidx]))
@@ -339,16 +286,7 @@ static void nonverb()
error(M_WHAT);
}
-
-#ifdef _PROTOTYPES_
-static void buildall(
- ParamElem list[]
-)
-#else
-static void buildall(list)
- ParamElem list[];
-#endif
-{
+static void buildall(ParamElem list[]) {
int o, i = 0;
Boolean found = FALSE;
@@ -364,16 +302,7 @@ static void buildall(list)
list[i].code = EOF;
}
-
-#ifdef _PROTOTYPES_
-static void unambig(
- ParamElem plst[]
-)
-#else
-static void unambig(plst)
- ParamElem plst[];
-#endif
-{
+static void unambig(ParamElem plst[]) {
int i;
Boolean found = FALSE; /* Adjective or noun found ? */
static ParamElem *refs; /* Entities referenced by word */
@@ -477,16 +406,7 @@ static void unambig(plst)
}
}
-
-#ifdef _PROTOTYPES_
-static void simple(
- ParamElem olst[]
-)
-#else
-static void simple(olst)
- ParamElem olst[];
-#endif
-{
+static void simple(ParamElem olst[]) {
static ParamElem *tlst = NULL;
int savidx = wrdidx;
Boolean savplur = FALSE;
@@ -543,15 +463,7 @@ static void simple(olst)
entity tables. Particularly this goes for literals...
*/
-#ifdef _PROTOTYPES_
-static void complex(
- ParamElem olst[]
-)
-#else
-static void complex(olst)
- ParamElem olst[];
-#endif
-{
+static void complex(ParamElem olst[]) {
static ParamElem *alst = NULL;
if (alst == NULL)
@@ -576,16 +488,7 @@ static void complex(olst)
simple(olst); /* Look for simple noun group */
}
-
-#ifdef _PROTOTYPES_
-static Boolean claCheck(
- ClaElem *cla /* IN - The cla elem to check */
-)
-#else
-static Boolean claCheck(cla)
- ClaElem *cla; /* IN - The cla elem to check */
-#endif
-{
+static Boolean claCheck(ClaElem *cla /* IN - The cla elem to check */) {
Boolean ok = FALSE;
if ((cla->classes&(Aword)CLA_OBJ) != 0)
@@ -614,8 +517,7 @@ static Boolean claCheck(cla)
access to remote object), we need to remove non-present parameters
*/
-static void resolve(ParamElem plst[])
-{
+static void resolve(ParamElem plst[]) {
int i;
if (allLength > 0) return; /* ALL has already done this */
@@ -630,16 +532,7 @@ static void resolve(ParamElem plst[])
}
}
-
-#ifdef _PROTOTYPES_
-static void tryMatch(
- ParamElem mlst[] /* OUT - List of params allowed by multiple */
-)
-#else
-static void tryMatch(mlst)
- ParamElem mlst[]; /* OUT - List of params allowed by multiple */
-#endif
-{
+static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multiple */) {
ElmElem *elms; /* Pointer to element list */
StxElem *stx; /* Pointer to syntax list */
ClaElem *cla; /* Pointer to class definitions */
@@ -791,16 +684,7 @@ static void tryMatch(mlst)
plural = anyPlural; /* Remember that we found plural objects */
}
-
-#ifdef _PROTOTYPES_
-static void match(
- ParamElem *mlst /* OUT - List of params allowed by multiple */
-)
-#else
-static void match(mlst)
- ParamElem *mlst; /* OUT - List of params allowed by multiple */
-#endif
-{
+static void match(ParamElem *mlst /* OUT - List of params allowed by multiple */) {
tryMatch(mlst); /* ... to understand what he said */
if (wrds[wrdidx] != EOF && !isConj(wrds[wrdidx]))
error(M_WHAT);
@@ -808,13 +692,7 @@ static void match(mlst)
wrdidx++; /* If so skip the AND */
}
-
-#ifdef _PROTOTYPES_
-void parse(void)
-#else
-void parse()
-#endif
-{
+void parse() {
if (mlst == NULL) { /* Allocate large enough paramlists */
mlst = (ParamElem *) allocate(sizeof(ParamElem)*(MAXENTITY+1));
mlst[0].code = EOF;
diff --git a/engines/glk/alan2/parse.h b/engines/glk/alan2/parse.h
index 067c73fb3b..e2c558c5c3 100644
--- a/engines/glk/alan2/parse.h
+++ b/engines/glk/alan2/parse.h
@@ -39,15 +39,9 @@ extern int litCount;
extern int vrbwrd;
-#ifdef _PROTOTYPES_
-
/* Parse a new player command */
extern void parse(void);
-#else
-extern void parse();
-#endif
-
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/readline.h b/engines/glk/alan2/readline.h
index a50022415d..249ccbd62c 100644
--- a/engines/glk/alan2/readline.h
+++ b/engines/glk/alan2/readline.h
@@ -33,13 +33,8 @@ namespace Alan2 {
#define LINELENGTH 80
#define HISTORYLENGTH 20
-#ifdef _PROTOTYPES_
extern Boolean readline(char usrbuf[]);
-#else
-extern Boolean readline();
-#endif
-
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/reverse.cpp b/engines/glk/alan2/reverse.cpp
index cf3e851226..943411e873 100644
--- a/engines/glk/alan2/reverse.cpp
+++ b/engines/glk/alan2/reverse.cpp
@@ -34,13 +34,7 @@ namespace Alan2 {
Return the reversed bytes in the Aword
*/
-#ifdef _PROTOTYPES_
-Aword reversed(Aword w) /* IN - The ACODE word to swap bytes of */
-#else
-Aword reversed(w)
- Aword w; /* IN - The ACODE word to swap bytes of */
-#endif
-{
+Aword reversed(Aword w /* IN - The ACODE word to swap bytes of */) {
Aword s; /* The swapped ACODE word */
char *wp, *sp;
int i;
@@ -54,26 +48,11 @@ Aword reversed(w)
return s;
}
-
-#ifdef _PROTOTYPES_
-void reverse(Aword *w) /* IN - The ACODE word to reverse bytes in */
-#else
-void reverse(w)
- Aword *w; /* IN - The ACODE word to reverse bytes in */
-#endif
-{
+void reverse(Aword *w /* IN - The ACODE word to reverse bytes in */) {
*w = reversed(*w);
}
-
-#ifdef _PROTOTYPES_
-static void reverseTable(Aword adr, int len)
-#else
-static void reverseTable(adr, len)
- Aword adr;
- int len;
-#endif
-{
+static void reverseTable(Aword adr, int len) {
Aword *e = &memory[adr];
int i;
@@ -86,14 +65,7 @@ static void reverseTable(adr, len)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseStms(Aword adr)
-#else
-static void reverseStms(adr)
- Aword adr;
-#endif
-{
+static void reverseStms(Aword adr) {
Aword *e = &memory[adr];
if (adr != 0)
@@ -104,14 +76,7 @@ static void reverseStms(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseMsgs(Aword adr)
-#else
-static void reverseMsgs(adr)
- Aword adr;
-#endif
-{
+static void reverseMsgs(Aword adr) {
MsgElem *e = (MsgElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -123,14 +88,7 @@ static void reverseMsgs(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseWrds(Aword adr)
-#else
-static void reverseWrds(adr)
- Aword adr;
-#endif
-{
+static void reverseWrds(Aword adr) {
WrdElem *e = (WrdElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -145,13 +103,7 @@ static void reverseWrds(adr)
}
}
-#ifdef _PROTOTYPES_
-static void reverseChks(Aword adr)
-#else
-static void reverseChks(adr)
- Aword adr;
-#endif
-{
+static void reverseChks(Aword adr) {
ChkElem *e = (ChkElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -164,13 +116,7 @@ static void reverseChks(adr)
}
}
-#ifdef _PROTOTYPES_
-static void reverseAlts(Aword adr)
-#else
-static void reverseAlts(adr)
- Aword adr;
-#endif
-{
+static void reverseAlts(Aword adr) {
AltElem *e = (AltElem *)&memory[adr];
if (adr != 0 && !endOfTable(e) && !e->done) {
@@ -184,14 +130,7 @@ static void reverseAlts(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseVrbs(Aword adr)
-#else
-static void reverseVrbs(adr)
- Aword adr;
-#endif
-{
+static void reverseVrbs(Aword adr) {
VrbElem *e = (VrbElem *)&memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -203,14 +142,7 @@ static void reverseVrbs(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseSteps(Aword adr)
-#else
-static void reverseSteps(adr)
- Aword adr;
-#endif
-{
+static void reverseSteps(Aword adr) {
StepElem *e = (StepElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -223,14 +155,7 @@ static void reverseSteps(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseScrs(Aword adr)
-#else
-static void reverseScrs(adr)
- Aword adr;
-#endif
-{
+static void reverseScrs(Aword adr) {
ScrElem *e = (ScrElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -243,14 +168,7 @@ static void reverseScrs(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseActs(Aword adr)
-#else
-static void reverseActs(adr)
- Aword adr;
-#endif
-{
+static void reverseActs(Aword adr) {
ActElem *e = (ActElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -266,14 +184,7 @@ static void reverseActs(adr)
}
}
-#ifdef _PROTOTYPES_
-static void reverseObjs(Aword adr, Boolean v2_5)
-#else
-static void reverseObjs(adr, v2_5)
- Aword adr;
- Boolean v2_5; /* TRUE if it's a v2.5 format game */
-#endif
-{
+static void reverseObjs(Aword adr, Boolean v2_5) {
ObjElem *e = (ObjElem *) &memory[adr];
ObjElem25 *e25 = (ObjElem25 *) &memory[adr];
@@ -303,14 +214,7 @@ static void reverseObjs(adr, v2_5)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseExts(Aword adr)
-#else
-static void reverseExts(adr)
- Aword adr;
-#endif
-{
+static void reverseExts(Aword adr) {
ExtElem *e = (ExtElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -325,13 +229,7 @@ static void reverseExts(adr)
}
}
-#ifdef _PROTOTYPES_
-static void reverseLocs(Aword adr)
-#else
-static void reverseLocs(adr)
- Aword adr;
-#endif
-{
+static void reverseLocs(Aword adr) {
LocElem *e = (LocElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -348,14 +246,7 @@ static void reverseLocs(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseClas(Aword adr)
-#else
-static void reverseClas(adr)
- Aword adr;
-#endif
-{
+static void reverseClas(Aword adr) {
ClaElem *e = (ClaElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -369,14 +260,7 @@ static void reverseClas(adr)
reverse(&((Aword *)e)[1]); /* The verb code is stored after the table */
}
-
-#ifdef _PROTOTYPES_
-static void reverseElms(Aword adr)
-#else
-static void reverseElms(adr)
- Aword adr;
-#endif
-{
+static void reverseElms(Aword adr) {
ElmElem *e = (ElmElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -389,14 +273,7 @@ static void reverseElms(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseStxs(Aword adr)
-#else
-static void reverseStxs(adr)
- Aword adr;
-#endif
-{
+static void reverseStxs(Aword adr) {
StxElem *e = (StxElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -408,13 +285,7 @@ static void reverseStxs(adr)
}
}
-#ifdef _PROTOTYPES_
-static void reverseEvts(Aword adr)
-#else
-static void reverseEvts(adr)
- Aword adr;
-#endif
-{
+static void reverseEvts(Aword adr) {
EvtElem *e = (EvtElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -426,15 +297,7 @@ static void reverseEvts(adr)
}
}
-
-
-#ifdef _PROTOTYPES_
-static void reverseLims(Aword adr)
-#else
-static void reverseLims(adr)
- Aword adr;
-#endif
-{
+static void reverseLims(Aword adr) {
LimElem *e = (LimElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -446,14 +309,7 @@ static void reverseLims(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseCnts(Aword adr)
-#else
-static void reverseCnts(adr)
- Aword adr;
-#endif
-{
+static void reverseCnts(Aword adr) {
CntElem *e = (CntElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -468,14 +324,7 @@ static void reverseCnts(adr)
}
}
-
-#ifdef _PROTOTYPES_
-static void reverseRuls(Aword adr)
-#else
-static void reverseRuls(adr)
- Aword adr;
-#endif
-{
+static void reverseRuls(Aword adr) {
RulElem *e = (RulElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@@ -489,7 +338,6 @@ static void reverseRuls(adr)
}
-
/*----------------------------------------------------------------------
reverseHdr()
@@ -497,13 +345,7 @@ static void reverseRuls(adr)
Reverse the header structure.
*/
-#ifdef _PROTOTYPES_
-void reverseHdr(AcdHdr *hdr)
-#else
-void reverseHdr(hdr)
- AcdHdr *hdr;
-#endif
-{
+void reverseHdr(AcdHdr *hdr) {
int i;
/* Reverse all words in the header except the first (version marking) */
@@ -520,13 +362,7 @@ void reverseHdr(hdr)
makes the .ACD files fully compatible across architectures
*/
-#ifdef _PROTOTYPES_
-void reverseACD(Boolean v2_5)
-#else
-void reverseACD(v2_5)
- Boolean v2_5;
-#endif
-{
+void reverseACD(Boolean v2_5) {
reverseHdr(header);
reverseWrds(header->dict);
reverseTable(header->oatrs, sizeof(AtrElem));
diff --git a/engines/glk/alan2/reverse.h b/engines/glk/alan2/reverse.h
index 40807ce403..1f88eb61bc 100644
--- a/engines/glk/alan2/reverse.h
+++ b/engines/glk/alan2/reverse.h
@@ -26,20 +26,11 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
-
extern void reverseHdr(AcdHdr *hdr);
extern void reverseACD(Boolean v25);
extern void reverse(Aword *word);
extern Aword reversed(Aword word);
-#else
-extern void reverseHdr();
-extern void reverseACD();
-extern void reverse();
-extern Aword reversed();
-#endif
-
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/rules.cpp b/engines/glk/alan2/rules.cpp
index d00d1f3955..b558b183b5 100644
--- a/engines/glk/alan2/rules.cpp
+++ b/engines/glk/alan2/rules.cpp
@@ -36,12 +36,7 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
-void rules(void)
-#else
-void rules()
-#endif
-{
+void rules() {
Boolean change = TRUE;
int i;
diff --git a/engines/glk/alan2/rules.h b/engines/glk/alan2/rules.h
index 1cc0b909e3..aaa2596d8b 100644
--- a/engines/glk/alan2/rules.h
+++ b/engines/glk/alan2/rules.h
@@ -30,14 +30,8 @@ namespace Alan2 {
/* TYPES */
-#ifdef _PROTOTYPES_
-
extern void rules(void);
-#else
-extern void rules();
-#endif
-
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/stack.cpp b/engines/glk/alan2/stack.cpp
index ccce1475d1..98423f02cd 100644
--- a/engines/glk/alan2/stack.cpp
+++ b/engines/glk/alan2/stack.cpp
@@ -36,37 +36,19 @@ static Aptr stack[STACKSIZE];
static int stackp = 0;
-#ifdef _PROTOTYPES_
-void push(Aptr i)
-#else
-void push(i)
- Aptr i;
-#endif
-{
+void push(Aptr i) {
if (stackp == STACKSIZE)
syserr("Out of stack space.");
stack[stackp++] = i;
}
-
-#ifdef _PROTOTYPES_
-Aptr pop(void)
-#else
-Aptr pop()
-#endif
-{
+Aptr pop() {
if (stackp == 0)
syserr("Stack underflow.");
return(stack[--stackp]);
}
-
-#ifdef _PROTOTYPES_
-Aptr top(void)
-#else
-Aptr top()
-#endif
-{
+Aptr top() {
return(stack[stackp-1]);
}
diff --git a/engines/glk/alan2/stack.h b/engines/glk/alan2/stack.h
index 7f10c080b6..1a6db7495b 100644
--- a/engines/glk/alan2/stack.h
+++ b/engines/glk/alan2/stack.h
@@ -30,18 +30,10 @@ namespace Alan2 {
/* TYPES */
-#ifdef _PROTOTYPES_
-
extern Aptr pop(void);
extern void push(Aptr item);
extern Aptr top(void);
-#else
-extern Aptr pop();
-extern void push();
-extern Aptr top();
-#endif
-
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/sysdep.cpp b/engines/glk/alan2/sysdep.cpp
index d36722c312..312518f879 100644
--- a/engines/glk/alan2/sysdep.cpp
+++ b/engines/glk/alan2/sysdep.cpp
@@ -41,9 +41,7 @@ extern void fprintf(Common::WriteStream *ws, const char *fmt, ...) {
}
#endif
-#ifdef _PROTOTYPES_
extern void syserr(char str[]);
-#endif
#ifdef __vms__
diff --git a/engines/glk/alan2/sysdep.h b/engines/glk/alan2/sysdep.h
index 5e562cd68f..e58e538f20 100644
--- a/engines/glk/alan2/sysdep.h
+++ b/engines/glk/alan2/sysdep.h
@@ -43,7 +43,6 @@ namespace Glk {
namespace Alan2 {
#define GLK
-#define _PROTOTYPES_
#define __win__
#ifdef GLK
@@ -136,21 +135,18 @@ extern void fprintf(Common::WriteStream *ws, const char *fmt, ...);
#endif
#ifdef __STDC__
-#define _PROTOTYPES_
#include <stdlib.h>
#include <string.h>
#endif
#ifdef __vms__
/* Our VAXC doesn't define __STDC__ */
-#define _PROTOTYPES_
#include <stdlib.h>
#include <string.h>
#endif
#ifdef __mac__
-#define _PROTOTYPES_
#include <stdlib.h>
#include <string.h>
#include <unix.h>
@@ -354,8 +350,6 @@ extern char *strdup(char *str);
#endif
-#ifdef _PROTOTYPES_
-
/* Native character functions */
extern int isSpace(int c); /* IN - Native character to test */
extern int isLower(int c); /* IN - Native character to test */
@@ -384,25 +378,6 @@ extern void fromIso(char copy[], /* OUT - Mapped string */
extern void toNative(char copy[], /* OUT - Mapped string */
char original[], /* IN - string to convert */
int charset); /* IN - current character set */
-#else
-extern int isSpace();
-extern int isLower();
-extern int isUpper();
-extern int isLetter();
-extern int toLower();
-extern int toUpper();
-extern char *strlow();
-extern char *strupp();
-
-extern int isISOLetter();
-extern char toLowerCase();
-extern char toUpperCase();
-extern char *stringLower();
-extern char *stringUpper();
-
-extern void toIso();
-extern void fromIso();
-#endif
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/term.cpp b/engines/glk/alan2/term.cpp
index cf60fc5bbe..8f7b64a719 100644
--- a/engines/glk/alan2/term.cpp
+++ b/engines/glk/alan2/term.cpp
@@ -34,12 +34,7 @@ namespace Alan2 {
from the header.
*/
-#ifdef _PROTOTYPES_
-void getPageSize(void)
-#else
-void getPageSize()
-#endif
-{
+void getPageSize() {
#ifdef GLK
paglen = 0;
pagwidth = 0;
diff --git a/engines/glk/alan2/term.h b/engines/glk/alan2/term.h
index 339a3b5e82..7667abdad3 100644
--- a/engines/glk/alan2/term.h
+++ b/engines/glk/alan2/term.h
@@ -28,13 +28,7 @@
namespace Glk {
namespace Alan2 {
-#ifdef _PROTOTYPES_
-
-extern void getPageSize(void);
-
-#else
extern void getPageSize();
-#endif
} // End of namespace Alan2
} // End of namespace Glk
diff --git a/engines/glk/alan2/types.cpp b/engines/glk/alan2/types.cpp
new file mode 100644
index 0000000000..8419e33ff4
--- /dev/null
+++ b/engines/glk/alan2/types.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "glk/alan2/types.h"
+
+namespace Glk {
+namespace Alan2 {
+
+void CurVars::synchronize(Common::Serializer &s) {
+ s.syncAsSint32LE(vrb);
+ s.syncAsSint32LE(obj);
+ s.syncAsSint32LE(loc);
+ s.syncAsSint32LE(act);
+ s.syncAsSint32LE(tick);
+ s.syncAsSint32LE(score);
+ s.syncAsSint32LE(visits);
+}
+
+void EvtqElem::synchronize(Common::Serializer &s) {
+ s.syncAsSint32LE(time);
+ s.syncAsSint32LE(event);
+ s.syncAsSint32LE(where);
+};
+
+} // End of namespace Alan2
+} // End of namespace Glk