From: Jason S. Ninneman Date: Sun, 4 Jun 2017 15:58:43 +0000 (-0700) Subject: Remove a disused function, thereby upping the code coverage. X-Git-Tag: 1.0~17 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=83048ee832577455d26db2f6c6f2c130b454094f;p=open-adventure.git Remove a disused function, thereby upping the code coverage. --- diff --git a/advent.h b/advent.h index 631cce2..e23f88e 100644 --- a/advent.h +++ b/advent.h @@ -29,7 +29,6 @@ extern bool fGETIN(FILE *,long*,long*,long*,long*); #define GETIN(input,WORD1,WORD1X,WORD2,WORD2X) fGETIN(input,&WORD1,&WORD1X,&WORD2,&WORD2X) extern long YES(FILE *,long,long,long); -extern long GETNUM(FILE *); extern long GETTXT(long,long,long); extern long MAKEWD(long); diff --git a/misc.c b/misc.c index 04792eb..b7b132b 100644 --- a/misc.c +++ b/misc.c @@ -215,7 +215,7 @@ L20: YEAH=false; } -/* 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 @@ -223,39 +223,6 @@ L20: YEAH=false; * 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