Constants and formals have been converted, but not globals yet.
#include <stdio.h>
#include <stdbool.h>
-#define TRUE (0==0)
-#define FALSE (0!=0)
-
/*
* INITIALISATION
*/
if(LNLENG < LNPOSN)BUG(1);
L1006: KK=KK+1;
if(KK >= LINSIZ)BUG(2);
- LINES[KK]=GETTXT(FALSE,FALSE,FALSE,KK);
+ LINES[KK]=GETTXT(false,false,false,KK);
if(LINES[KK] != -1) goto L1006;
LINES[LINUSE]=KK;
if(LOC == OLDLOC) goto L1005;
L1043: KTAB[TABNDX]=GETNUM(1);
if(KTAB[TABNDX] == -1) goto L1002;
J=J+7;
-L1042: ATAB[TABNDX]=GETTXT(TRUE,TRUE,TRUE,0)+J*J;
+L1042: ATAB[TABNDX]=GETTXT(true,true,true,0)+J*J;
} /* end loop */
BUG(4);
* I. HINTED(I) IS TRUE IFF HINT I HAS BEEN USED. */
/* 1300 */ for (I=1; I<=HNTMAX; I++) {
- HINTED[I]=FALSE;
+ HINTED[I]=false;
L1300: HINTLC[I]=0;
} /* end loop */
CHLOC=114;
CHLOC2=140;
/* 1700 */ for (I=1; I<=6; I++) {
-L1700: DSEEN[I]=FALSE;
+L1700: DSEEN[I]=false;
} /* end loop */
DFLAG=0;
DLOC[1]=19;
THRESH= -1;
if(TRNVLS > 0)THRESH=MOD(TRNVAL[1],100000)+1;
TRNLUZ=0;
- LMWARN=FALSE;
+ LMWARN=false;
IGO=0;
IWEST=0;
KNFLOC=0;
CLOCK2=50;
CONDS=SETBIT(11);
SAVED=0;
- CLOSNG=FALSE;
- PANIC=FALSE;
- CLOSED=FALSE;
- CLSHNT=FALSE;
- NOVICE=FALSE;
+ CLOSNG=false;
+ PANIC=false;
+ CLOSED=false;
+ CLSHNT=false;
+ NOVICE=false;
SETUP=1;
/* if we can ever think of how, we should save it at this point */
f = NULL;
if(adv)f = fopen(adv,READ_MODE);
if(f == NULL)f = fopen("adventure.data",READ_MODE);
- if(f == NULL)return(FALSE);
- init_reading = TRUE;
+ if(f == NULL)return(false);
+ init_reading = true;
init_cksum = 1;
quick_io();
if(fread(&K,4,1,f) == 1) init_cksum -= K; else init_cksum = 1;
printf("Writing adventure.data...\n");
f = fopen("adventure.data",WRITE_MODE);
if(f == NULL){printf("Can't open file!\n"); return;}
- init_reading = FALSE;
+ init_reading = false;
init_cksum = 1;
quick_io();
fwrite(&init_cksum,4,1,f);
*/
#include <stdlib.h>
#include <stdio.h>
+#include <stdbool.h>
#include "main.h"
#include "misc.h"
-#define TRUE (0==0)
-#define FALSE (0!=0)
-
-long ABB[186], ATAB[331], ATLOC[186], BLKLIN = TRUE, DFLAG,
+long ABB[186], ATAB[331], ATLOC[186], BLKLIN = true, DFLAG,
DLOC[7], FIXED[101], HOLDNG,
KTAB[331], *LINES, LINK[201], LNLENG, LNPOSN,
PARMS[26], PLACE[101], PTEXT[101], RTEXT[278],
TRNDEX, TRNLUZ, TRNSIZ = 5, TRNVAL[6], TRNVLS, TROLL, TROLL2, TRVS,
TRVSIZ = 885, TTEXT[6], TURNS, URN, V1, V2, VASE, VEND, VERB,
VOLCAN, VRBSIZ = 35, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X,
- WZDARK = FALSE, ZZWORD;
+ WZDARK = false, ZZWORD;
extern void initialise();
extern void score(long);
LINES = (long *)calloc(LINSIZ+1,sizeof(long));
if(!LINES){
printf("Not enough memory!\n");
- exit(FALSE);
+ exit(1);
}
MAP2[1] = 0;
* RERUN, WE COME HERE AND TELL THE PLAYER TO RUN A FRESH COPY. */
RSPEAK(201);
- exit(FALSE);
+ exit(0);
RSPEAK(130);
NEWLOC=LOC;
if(!PANIC)CLOCK2=15;
- PANIC=TRUE;
+ PANIC=true;
/* SEE IF A DWARF HAS SEEN HIM AND HAS COME FROM WHERE HE WANTS TO GO. IF SO,
* THE DWARF'S BLOCKING HIS WAY. IF COMING FROM PLACE FORBIDDEN TO PIRATE
} /* end loop */
L6024: DLOC[6]=CHLOC;
ODLOC[6]=CHLOC;
- DSEEN[6]=FALSE;
+ DSEEN[6]=false;
goto L6030;
L6025: RSPEAK(186);
L30: if(DETAIL < 3)RSPEAK(15);
DETAIL=DETAIL+1;
- WZDARK=FALSE;
+ WZDARK=false;
ABB[LOC]=0;
goto L2;
L10000: PROP[GRATE]=0;
PROP[FISSUR]=0;
/* 10010 */ for (I=1; I<=6; I++) {
- DSEEN[I]=FALSE;
+ DSEEN[I]=false;
L10010: DLOC[I]=0;
} /* end loop */
MOVE(TROLL,0);
FIXED[AXE]=0;
RSPEAK(129);
CLOCK1= -1;
- CLOSNG=TRUE;
+ CLOSNG=true;
goto L19999;
/* ONCE HE'S PANICKED, AND CLOCK2 HAS RUN OUT, WE COME HERE TO SET UP THE
} /* end loop */
RSPEAK(132);
- CLOSED=TRUE;
+ CLOSED=true;
goto L2;
/* ANOTHER WAY WE CAN FORCE AN END TO THINGS IS BY HAVING THE LAMP GIVE OUT.
PROP[BATTER]=1;
if(TOTING(BATTER))DROP(BATTER,LOC);
LIMIT=LIMIT+2500;
- LMWARN=FALSE;
+ LMWARN=false;
goto L19999;
L12200: if(LMWARN || !HERE(LAMP)) goto L19999;
- LMWARN=TRUE;
+ LMWARN=true;
SPK=187;
if(PLACE[BATTER] == 0)SPK=183;
if(PROP[BATTER] == 1)SPK=189;
#include "misc.h"
#include "funcs.h"
-#define TRUE (0==0)
-#define FALSE (0!=0)
-
/* hack to ignore GCC Unused Result */
#define IGNORE(r) do{if(r){}}while(0)
goto L32;
L40: if(BLANK)TYPE0();
- BLANK=FALSE;
+ BLANK=false;
TYPE();
K=L+1;
if(LINES[K] >= 0) goto L10;
L10: if(BLKLIN)TYPE0();
- MAPLIN(FALSE);
- WORD1=GETTXT(TRUE,TRUE,TRUE,0);
+ MAPLIN(false);
+ WORD1=GETTXT(true,true,true,0);
if(BLKLIN && WORD1 < 0) goto L10;
- WORD1X=GETTXT(FALSE,TRUE,TRUE,0);
-L12: JUNK=GETTXT(FALSE,TRUE,TRUE,0);
+ WORD1X=GETTXT(false,true,true,0);
+L12: JUNK=GETTXT(false,true,true,0);
if(JUNK > 0) goto L12;
- WORD2=GETTXT(TRUE,TRUE,TRUE,0);
- WORD2X=GETTXT(FALSE,TRUE,TRUE,0);
-L22: JUNK=GETTXT(FALSE,TRUE,TRUE,0);
+ WORD2=GETTXT(true,true,true,0);
+ WORD2X=GETTXT(false,true,true,0);
+L22: JUNK=GETTXT(false,true,true,0);
if(JUNK > 0) goto L22;
- if(GETTXT(TRUE,TRUE,TRUE,0) <= 0)return;
+ if(GETTXT(true,true,true,0) <= 0)return;
RSPEAK(53);
goto L10;
}
if(REPLY == MAKEWD(1415) || REPLY == MAKEWD(14)) goto L20;
RSPEAK(185);
goto L1;
-L10: YES=TRUE;
+L10: YES=true;
RSPEAK(Y);
return(YES);
-L20: YES=FALSE;
+L20: YES=false;
RSPEAK(Z);
return(YES);
}
L13: CKSUM=BUF[0];
return;
-L15: SAVEIO(1,TRUE,BUF);
+L15: SAVEIO(1,true,BUF);
HASH=MOD(1234L*5678L-BUF[0],1048576L);
goto L13;
N=MOD(N,250)+1;
if(STATE > 0) goto L32;
N--; BUF[N]=CKSUM; N++;
- SAVEIO(1,FALSE,BUF);
+ SAVEIO(1,false,BUF);
L32: N--; WORD=BUF[N]-CKSUM; N++;
SAVEIO(-1,STATE > 0,BUF);
STATE=0;
printf("Fatal error %ld. See source code for interpretation.\n",
NUM);
- exit(FALSE);
+ exit(0);
}
L15: if(!OPENED){
OPENED=fopen("adventure.text","r" /* NOT binary */);
- if(!OPENED){printf("Can't read adventure.text!\n"); exit(FALSE);}
+ if(!OPENED){printf("Can't read adventure.text!\n"); exit(0);}
}
IGNORE(fgets(INLINE+1,100,OPENED));
#include "main.h"
#include "share.h"
-#define TRUE (0==0)
-#define FALSE (0!=0)
-
/*
* SCORING AND WRAP-UP
*/
SETPRM(1,I,I);
SPK=263;
L25000: RSPEAK(SPK);
- exit(FALSE);
+ exit(0);
}