From: Eric S. Raymond Date: Fri, 19 May 2017 05:28:38 +0000 (-0400) Subject: More ANSI prototype conversions. X-Git-Tag: seed~101 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=d93746d0789dc9bd7a9d1a380656680ce8be3c07;p=open-adventure.git More ANSI prototype conversions. --- diff --git a/misc.c b/misc.c index e760830..15932ec 100644 --- a/misc.c +++ b/misc.c @@ -10,7 +10,7 @@ /* I/O ROUTINES (SPEAK, PSPEAK, RSPEAK, SETPRM, GETIN, YES) */ #undef SPEAK -void fSPEAK(N)long N; { +void fSPEAK(long N) { long BLANK, CASE, I, K, L, NEG, NPARMS, PARM, PRMTYP, STATE; /* PRINT THE MESSAGE WHICH STARTS AT LINES(N). PRECEDE IT WITH A BLANK LINE @@ -114,7 +114,7 @@ L40: if(BLANK)TYPE0(); #define SPEAK(N) fSPEAK(N) #undef PSPEAK -void fPSPEAK(MSG,SKIP)long MSG, SKIP; { +void fPSPEAK(long MSG,long SKIP) { long I, M; /* FIND THE SKIP+1ST MESSAGE FROM MSG AND PRINT IT. MSG SHOULD BE THE INDEX OF @@ -136,7 +136,7 @@ L9: SPEAK(M); #define PSPEAK(MSG,SKIP) fPSPEAK(MSG,SKIP) #undef RSPEAK -void fRSPEAK(I)long I; { +void fRSPEAK(long I) { ; /* PRINT THE I-TH "RANDOM" MESSAGE (SECTION 6 OF DATABASE). */ @@ -150,7 +150,7 @@ void fRSPEAK(I)long I; { #define RSPEAK(I) fRSPEAK(I) #undef SETPRM -void fSETPRM(FIRST,P1,P2)long FIRST, P1, P2; { +void fSETPRM(long FIRST, long P1, long P2) { ; /* STORES PARAMETERS INTO THE PRMCOM PARMS ARRAY FOR USE BY SPEAK. P1 AND P2 @@ -171,7 +171,7 @@ void fSETPRM(FIRST,P1,P2)long FIRST, P1, P2; { #define WORD1X (*wORD1X) #define WORD2 (*wORD2) #define WORD2X (*wORD2X) -void fGETIN(wORD1,wORD1X,wORD2,wORD2X)long *wORD1, *wORD1X, *wORD2, *wORD2X; { +void fGETIN(long *wORD1, long *wORD1X, long *wORD2, long *wORD2X) { long JUNK; /* GET A COMMAND FROM THE ADVENTURER. SNARF OUT THE FIRST WORD, PAD IT WITH @@ -205,7 +205,7 @@ L22: JUNK=GETTXT(false,true,true,0); #undef WORD2X #define GETIN(WORD1,WORD1X,WORD2,WORD2X) fGETIN(&WORD1,&WORD1X,&WORD2,&WORD2X) #undef YES -long fYES(X,Y,Z)long X, Y, Z; { +long fYES(long X, long Y, long Z) { long YES, REPLY, JUNK1, JUNK2, JUNK3; @@ -241,7 +241,7 @@ L20: YES=false; #define YES(X,Y,Z) fYES(X,Y,Z) #undef GETNUM -long fGETNUM(K)long K; { +long fGETNUM(long K) { long DIGIT, GETNUM, SIGN; /* OBTAIN THE NEXT INTEGER FROM AN INPUT LINE. IF K>0, WE FIRST READ A @@ -278,7 +278,7 @@ L42: GETNUM=GETNUM*SIGN; #define GETNUM(K) fGETNUM(K) #undef GETTXT -long fGETTXT(SKIP,ONEWRD,UPPER,HASH)long HASH, ONEWRD, SKIP, UPPER; { +long fGETTXT(long SKIP,long ONEWRD, long UPPER, long HASH) { long CHAR, GETTXT, I; static long SPLITTING = -1; /* TAKE CHARACTERS FROM AN INPUT LINE AND PACK THEM INTO 30-BIT WORDS. @@ -326,7 +326,7 @@ L15: /*etc*/ ; #define GETTXT(SKIP,ONEWRD,UPPER,HASH) fGETTXT(SKIP,ONEWRD,UPPER,HASH) #undef MAKEWD -long fMAKEWD(LETTRS)long LETTRS; { +long fMAKEWD(long LETTRS) { long I, L, MAKEWD; /* COMBINE FIVE UPPERCASE LETTERS (REPRESENTED BY PAIRS OF DECIMAL DIGITS @@ -355,7 +355,7 @@ L10: MAKEWD=MAKEWD+I*(MOD(L,50)+10); #define MAKEWD(LETTRS) fMAKEWD(LETTRS) #undef PUTTXT #define STATE (*sTATE) -void fPUTTXT(WORD,sTATE,CASE,HASH)long CASE, HASH, *sTATE, WORD; { +void fPUTTXT(long WORD, long *sTATE, long CASE, long HASH) { long ALPH1, ALPH2, BYTE, DIV, I, W; /* UNPACK THE 30-BIT VALUE IN WORD TO OBTAIN UP TO 5 INTEGER-ENCODED CHARS, @@ -400,7 +400,7 @@ L18: W=(W-BYTE*DIV)*64; #undef STATE #define PUTTXT(WORD,STATE,CASE,HASH) fPUTTXT(WORD,&STATE,CASE,HASH) #undef SHFTXT -void fSHFTXT(FROM,DELTA)long DELTA, FROM; { +void fSHFTXT(long FROM, long DELTA) { long I, II, JJ; /* MOVE INLINE(N) TO INLINE(N+DELTA) FOR N=FROM,LNLENG. DELTA CAN BE @@ -444,8 +444,7 @@ long TEMP; /* SUSPEND/RESUME I/O ROUTINES (SAVWDS, SAVARR, SAVWRD) */ #undef SAVWDS -void fSAVWDS(W1,W2,W3,W4,W5,W6,W7)long *W1, *W2, *W3, *W4, *W5, *W6, *W7; { -; +void fSAVWDS(long *W1, long *W2, long *W3, long *W4, long *W5, long *W6, long *W7) { /* WRITE OR READ 7 VARIABLES. SEE SAVWRD. */ @@ -463,7 +462,7 @@ void fSAVWDS(W1,W2,W3,W4,W5,W6,W7)long *W1, *W2, *W3, *W4, *W5, *W6, *W7; { #define SAVWDS(W1,W2,W3,W4,W5,W6,W7) fSAVWDS(&W1,&W2,&W3,&W4,&W5,&W6,&W7) #undef SAVARR -void fSAVARR(ARR,N)long ARR[], N; { +void fSAVARR(long ARR[], long N) { long I; /* WRITE OR READ AN ARRAY OF N WORDS. SEE SAVWRD. */ @@ -480,7 +479,7 @@ L1: SAVWRD(0,ARR[I]); #define SAVARR(ARR,N) fSAVARR(ARR,N) #undef SAVWRD #define WORD (*wORD) -void fSAVWRD(OP,wORD)long OP, *wORD; { +void fSAVWRD(long OP, long *wORD) { static long BUF[250], CKSUM = 0, H1, HASH = 0, N = 0, STATE = 0; /* IF OP<0, START WRITING A FILE, USING WORD TO INITIALISE ENCRYPTION; SAVE @@ -542,7 +541,7 @@ L32: N--; WORD=BUF[N]-CKSUM; N++; #undef WORD #define SAVWRD(OP,WORD) fSAVWRD(OP,&WORD) #undef VOCAB -long fVOCAB(ID,INIT)long ID, INIT; { +long fVOCAB(long ID, long INIT) { long HASH, I, VOCAB; /* LOOK UP ID IN THE VOCABULARY (ATAB) AND RETURN ITS "DEFINITION" (KTAB), OR @@ -575,7 +574,7 @@ L3: VOCAB=KTAB[I]; #define VOCAB(ID,INIT) fVOCAB(ID,INIT) #undef DSTROY -void fDSTROY(OBJECT)long OBJECT; { +void fDSTROY(long OBJECT) { ; /* PERMANENTLY ELIMINATE "OBJECT" BY MOVING TO A NON-EXISTENT LOCATION. */