diff options
-rw-r--r-- | big.c | 2 | ||||
-rw-r--r-- | big.h | 2 | ||||
-rw-r--r-- | reduce.c | 14 |
3 files changed, 9 insertions, 9 deletions
@@ -373,7 +373,7 @@ int isnat(word x) } /* store C long long as mira bigint */ -word sto_int(long long i) +word big_fromll(long long i) { word sign = 0; @@ -23,7 +23,7 @@ #define stosmallint(x) make(INT,(x)<0?SIGNBIT|(-(x)):(x),0) long long big_toll(word); -word sto_int(long long); +word big_fromll(long long); double bigtodbl(word); double biglog(word); double biglog10(word); @@ -669,7 +669,7 @@ word e; /* cannot make static because of ### below */ while((lastarg=reduce(lastarg))!=NIL) /* ### */ lastarg=tl[lastarg],n++; - simpl(sto_int(n)); } + simpl(big_fromll(n)); } goto DONE; case DROP: @@ -1636,7 +1636,7 @@ L3: if(arg1==NIL)lexfail(lastarg); { long long n=big_toll(arg1); if(n<=0||(lastarg=reduce(lastarg))==NIL) /* ### */ { simpl(NIL); goto DONE; } - setcell(CONS,hd[lastarg],ap2(TAKE,sto_int(n-1),tl[lastarg])); } + setcell(CONS,hd[lastarg],ap2(TAKE,big_fromll(n-1),tl[lastarg])); } goto DONE; case READY(FILEMODE): /* FILEMODE string => string' @@ -1660,9 +1660,9 @@ L3: if(arg1==NIL)lexfail(lastarg); Non-existent file has conventional ((inode,dev),mtime) of ((0,-1),0) We assume time_t can be stored in int field, this may not port */ if(!stat(getstring(lastarg,"filestat"),&buf)) - setcell(CONS,cons(sto_int(buf.st_ino), - sto_int(buf.st_dev) ), - sto_int(buf.st_mtime) ); + setcell(CONS,cons(big_fromll(buf.st_ino), + big_fromll(buf.st_dev) ), + big_fromll(buf.st_mtime) ); else setcell(CONS,cons(stosmallint(0), stosmallint(-1) ), stosmallint(0) ); @@ -1714,7 +1714,7 @@ L3: if(arg1==NIL)lexfail(lastarg); fp=(FILE *)fdopen(fd[0],"r"), fp_a=(FILE *)fdopen(fd_a[0],"r"); if(pid== -1||!fp||!fp_a) - setcell(CONS,NIL,cons(piperrmess(pid),sto_int(-1))); else + setcell(CONS,NIL,cons(piperrmess(pid),big_fromll(-1))); else setcell(CONS,ap(READ,fp),cons(ap(READ,fp_a),ap(WAIT,pid))); } else { /* child (writer) */ @@ -2245,7 +2245,7 @@ word lexstate(x) /* extracts initial state info from list of chars labelled by LEX_COUNT - x is evaluated and known to be non-empty */ word x; { x = hd[hd[x]]; /* count field of first char */ - return(cons(sto_int(x>>8),stosmallint(x&255))); + return(cons(big_fromll(x>>8),stosmallint(x&255))); } word piperrmess(pid) |