Prototypization.

This commit is contained in:
Eric S. Raymond 2017-05-22 18:47:39 -04:00
parent 5286f6b3bd
commit ef24a63ced

30
misc.c
View file

@ -588,7 +588,7 @@ void fDSTROY(long OBJECT) {
#define DSTROY(OBJECT) fDSTROY(OBJECT) #define DSTROY(OBJECT) fDSTROY(OBJECT)
#undef JUGGLE #undef JUGGLE
void fJUGGLE(OBJECT)long OBJECT; { void fJUGGLE(long OBJECT) {
long I, J; long I, J;
/* Juggle an object by picking it up and putting it down again, the purpose /* Juggle an object by picking it up and putting it down again, the purpose
@ -606,7 +606,7 @@ long I, J;
#define JUGGLE(OBJECT) fJUGGLE(OBJECT) #define JUGGLE(OBJECT) fJUGGLE(OBJECT)
#undef MOVE #undef MOVE
void fMOVE(OBJECT,WHERE)long OBJECT, WHERE; { void fMOVE(long OBJECT, long WHERE) {
long FROM; long FROM;
/* Place any object anywhere by picking it up and dropping it. May already be /* Place any object anywhere by picking it up and dropping it. May already be
@ -627,7 +627,7 @@ L2: if(FROM > 0 && FROM <= 300)CARRY(OBJECT,FROM);
#define MOVE(OBJECT,WHERE) fMOVE(OBJECT,WHERE) #define MOVE(OBJECT,WHERE) fMOVE(OBJECT,WHERE)
#undef PUT #undef PUT
long fPUT(OBJECT,WHERE,PVAL)long OBJECT, PVAL, WHERE; { long fPUT(long OBJECT, long WHERE, long PVAL) {
long PUT; long PUT;
/* PUT is the same as MOVE, except it returns a value used to set up the /* PUT is the same as MOVE, except it returns a value used to set up the
@ -643,7 +643,7 @@ long PUT;
#define PUT(OBJECT,WHERE,PVAL) fPUT(OBJECT,WHERE,PVAL) #define PUT(OBJECT,WHERE,PVAL) fPUT(OBJECT,WHERE,PVAL)
#undef CARRY #undef CARRY
void fCARRY(OBJECT,WHERE)long OBJECT, WHERE; { void fCARRY(long OBJECT, long WHERE) {
long TEMP; long TEMP;
/* Start toting an object, removing it from the list of things at its former /* Start toting an object, removing it from the list of things at its former
@ -670,7 +670,7 @@ L8: LINK[TEMP]=LINK[OBJECT];
#define CARRY(OBJECT,WHERE) fCARRY(OBJECT,WHERE) #define CARRY(OBJECT,WHERE) fCARRY(OBJECT,WHERE)
#undef DROP #undef DROP
void fDROP(OBJECT,WHERE)long OBJECT, WHERE; { void fDROP(long OBJECT, long WHERE) {
; ;
/* Place an object at a given loc, prefixing it onto the ATLOC list. Decr /* Place an object at a given loc, prefixing it onto the ATLOC list. Decr
@ -692,7 +692,7 @@ L2: if(WHERE <= 0)return;
#define DROP(OBJECT,WHERE) fDROP(OBJECT,WHERE) #define DROP(OBJECT,WHERE) fDROP(OBJECT,WHERE)
#undef ATDWRF #undef ATDWRF
long fATDWRF(WHERE)long WHERE; { long fATDWRF(long WHERE) {
long ATDWRF, I; long ATDWRF, I;
/* Return the index of first dwarf at the given location, zero if no dwarf is /* Return the index of first dwarf at the given location, zero if no dwarf is
@ -723,7 +723,7 @@ L2: ATDWRF=I;
/* Utility routines (SETBIT, TSTBIT, RAN, RNDVOC, BUG) */ /* Utility routines (SETBIT, TSTBIT, RAN, RNDVOC, BUG) */
#undef SETBIT #undef SETBIT
long fSETBIT(BIT)long BIT; { long fSETBIT(long BIT) {
long I, SETBIT; long I, SETBIT;
/* Returns 2**bit for use in constructing bit-masks. */ /* Returns 2**bit for use in constructing bit-masks. */
@ -741,7 +741,7 @@ L1: SETBIT=SETBIT+SETBIT;
#define SETBIT(BIT) fSETBIT(BIT) #define SETBIT(BIT) fSETBIT(BIT)
#undef TSTBIT #undef TSTBIT
long fTSTBIT(MASK,BIT)long BIT, MASK; { long fTSTBIT(long MASK, long BIT) {
long TSTBIT; long TSTBIT;
/* Returns true if the specified bit is set in the mask. */ /* Returns true if the specified bit is set in the mask. */
@ -755,7 +755,7 @@ long TSTBIT;
#define TSTBIT(MASK,BIT) fTSTBIT(MASK,BIT) #define TSTBIT(MASK,BIT) fTSTBIT(MASK,BIT)
#undef RAN #undef RAN
long fRAN(RANGE)long RANGE; { long fRAN(long RANGE) {
static long D, R = 0, RAN, T; static long D, R = 0, RAN, T;
/* Since the ran function in LIB40 seems to be a real lose, we'll use one of /* Since the ran function in LIB40 seems to be a real lose, we'll use one of
@ -780,7 +780,7 @@ L2: R=MOD(R*1093L+221587L,1048576L);
#define RAN(RANGE) fRAN(RANGE) #define RAN(RANGE) fRAN(RANGE)
#undef RNDVOC #undef RNDVOC
long fRNDVOC(CHAR,FORCE)long CHAR, FORCE; { long fRNDVOC(long CHAR, long FORCE) {
long DIV, I, J, RNDVOC; long DIV, I, J, RNDVOC;
/* Searches the vocabulary for a word whose second character is char, and /* Searches the vocabulary for a word whose second character is char, and
@ -813,7 +813,7 @@ L8: ATAB[I]=RNDVOC+J*J;
#define RNDVOC(CHAR,FORCE) fRNDVOC(CHAR,FORCE) #define RNDVOC(CHAR,FORCE) fRNDVOC(CHAR,FORCE)
#undef BUG #undef BUG
void fBUG(NUM)long NUM; { void fBUG(long NUM) {
/* The following conditions are currently considered fatal bugs. Numbers < 20 /* The following conditions are currently considered fatal bugs. Numbers < 20
* are detected while reading the database; the others occur at "run time". * are detected while reading the database; the others occur at "run time".
@ -853,7 +853,7 @@ void fBUG(NUM)long NUM; {
#define BUG(NUM) fBUG(NUM) #define BUG(NUM) fBUG(NUM)
#undef MAPLIN #undef MAPLIN
void fMAPLIN(FIL)long FIL; { void fMAPLIN(long FIL) {
long I, VAL; static FILE *OPENED = NULL; long I, VAL; static FILE *OPENED = NULL;
/* Read a line of input, either from a file (if FIL=true) or from the /* Read a line of input, either from a file (if FIL=true) or from the
@ -916,7 +916,7 @@ L25: if(INLINE[I] != 0)LNLENG=I;
#define MAPLIN(FIL) fMAPLIN(FIL) #define MAPLIN(FIL) fMAPLIN(FIL)
#undef TYPE #undef TYPE
void fTYPE() { void fTYPE(void) {
long I, VAL; long I, VAL;
/* Type the first "LNLENG" characters stored in inline, mapping them /* Type the first "LNLENG" characters stored in inline, mapping them
@ -942,7 +942,7 @@ L20: {long x = VAL+1; INLINE[I]=MAP2[x];}
#define TYPE() fTYPE() #define TYPE() fTYPE()
#undef MPINIT #undef MPINIT
void fMPINIT() { void fMPINIT(void) {
long FIRST, I, J, LAST, VAL; long FIRST, I, J, LAST, VAL;
static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126}; static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126};
@ -980,7 +980,7 @@ L30: if(I >= 64)MAP2[VAL]=(I-64)*('B'-'A')+'@';
#define MPINIT() fMPINIT() #define MPINIT() fMPINIT()
#undef SAVEIO #undef SAVEIO
void fSAVEIO(OP,IN,ARR)long ARR[], IN, OP; { void fSAVEIO(long OP, long IN, long ARR[]) {
static FILE *F; char NAME[50]; static FILE *F; char NAME[50];
/* If OP=0, ask for a file name and open a file. (If IN=true, the file is for /* If OP=0, ask for a file name and open a file. (If IN=true, the file is for