BLANK=BLKLIN;
K=N;
NPARMS=1;
-L10: L=IABS(LINES[K])-1;
+L10: L=labs(LINES[K])-1;
K=K+1;
LNLENG=0;
LNPOSN=1;
if(PRMTYP < 1 || PRMTYP > 9) goto L30;
SHFTXT(LNPOSN+2,PRMTYP-2);
LNPOSN=LNPOSN+PRMTYP;
- PARM=IABS(PARMS[NPARMS]);
+ PARM=labs(PARMS[NPARMS]);
NEG=0;
if(PARMS[NPARMS] < 0)NEG=9;
/* 390 */ for (I=1; I<=PRMTYP; I++) {
M=PTEXT[MSG];
if(SKIP < 0) goto L9;
for (I=0; I<=SKIP; I++) {
-L1: M=IABS(LINES[M]);
+L1: M=labs(LINES[M]);
if(LINES[M] >= 0) goto L1;
/*etc*/ ;
} /* end loop */
}
-/* Line-parsing routines (GETNUM, GETTXT, MAKEWD, PUTTXT, SHFTXT, TYPE0)
+/* Line-parsing routines (GETTXT, MAKEWD, PUTTXT, SHFTXT, TYPE0)
*/
/* The routines on this page handle all the stuff that would normally be
* taken care of by format statements. We do it this way instead so that
* machine dependent i/o stuff is on the following page. See that page
* for a description of MAPCOM's inline array. */
-long GETNUM(FILE *source) {
-long DIGIT, NUMBER, SIGN;
-
-/* Obtain the next integer from an input line. If K>0, we first read a
- * new input line from a file; if K<0, we read a line from the keyboard;
- * if K=0 we use a line that has already been read (and perhaps partially
- * scanned). If we're at the end of the line or encounter an illegal
- * character (not a digit, hyphen, or blank), we return 0. */
-
-
- if(source != NULL)MAPLIN(source);
- NUMBER=0;
-L10: if(LNPOSN > LNLENG)return(NUMBER);
- if(INLINE[LNPOSN] != 0) goto L20;
- LNPOSN=LNPOSN+1;
- goto L10;
-
-L20: SIGN=1;
- if(INLINE[LNPOSN] != 9) goto L32;
- SIGN= -1;
-L30: LNPOSN=LNPOSN+1;
-L32: if(LNPOSN > LNLENG || INLINE[LNPOSN] == 0) goto L42;
- DIGIT=INLINE[LNPOSN]-64;
- if(DIGIT < 0 || DIGIT > 9) goto L40;
- NUMBER=NUMBER*10+DIGIT;
- goto L30;
-
-L40: NUMBER=0;
-L42: NUMBER=NUMBER*SIGN;
- LNPOSN=LNPOSN+1;
- return(NUMBER);
-}
-
long GETTXT(long SKIP,long ONEWRD, long UPPER) {
/* Take characters from an input line and pack them into 30-bit words.
* Skip says to skip leading blanks. ONEWRD says stop if we come to a
* end of the line, the word is filled up with blanks (which encode as 0's).
* If we're already at end of line when TEXT is called, we return -1. */
- long CHAR;
long TEXT;
static long SPLITTING = -1;
TEXT=TEXT*64;
if(LNPOSN > LNLENG || (ONEWRD && INLINE[LNPOSN] == 0))
continue;
- CHAR=INLINE[LNPOSN];
- if(CHAR < 63) {
+ char current=INLINE[LNPOSN];
+ if(current < 63) {
SPLITTING = -1;
- if(UPPER && CHAR >= 37)
- CHAR=CHAR-26;
- TEXT=TEXT+CHAR;
+ if(UPPER && current >= 37)
+ current=current-26;
+ TEXT=TEXT+current;
LNPOSN=LNPOSN+1;
continue;
}
continue;
}
- TEXT=TEXT+CHAR-63;
+ TEXT=TEXT+current-63;
SPLITTING = -1;
LNPOSN=LNPOSN+1;
}
ALPH1=13*CASE+24;
- ALPH2=26*IABS(CASE)+ALPH1;
- if(IABS(CASE) > 1)ALPH1=ALPH2;
+ ALPH2=26*labs(CASE)+ALPH1;
+ if(labs(CASE) > 1)ALPH1=ALPH2;
/* ALPH1&2 DEFINE RANGE OF WRONG-CASE CHARS, 11-36 OR 37-62 OR EMPTY. */
DIV=64L*64L*64L*64L;
W=WORD;
/* 18 */ for (I=1; I<=5; I++) {
- if(W <= 0 && STATE == 0 && IABS(CASE) <= 1)return;
+ if(W <= 0 && STATE == 0 && labs(CASE) <= 1)return;
BYTE=W/DIV;
if(STATE != 0 || BYTE != 63) goto L12;
STATE=63;
long SETBIT(long bit) {
/* Returns 2**bit for use in constructing bit-masks. */
- 2 << bit;
+ return(2 << bit);
}
bool TSTBIT(long mask, int bit) {
if(MAP2[1] == 0)MPINIT();
- if (!oldstyle && SETUP && OPENED == stdin)
+ if (!oldstyle && OPENED == stdin)
fputs("> ", stdout);
do {
IGNORE(fgets(rawbuf,sizeof(rawbuf)-1,OPENED));
*T = (long) tv.tv_usec;
}
-long IABS(N)long N; {return(N<0? -N : N);}
long MOD(N,M)long N, M; {return(N%M);}