Well, I cleaned up and started again to measure the progress.
-makefile_tru64 ---> add the "-ieee" compilerflag so (test-pmt) passes.
makefile_tru64 looks like this now:
# makefile for newLISP v. 8.x.x on HP Tru64Unix
#
#
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o tru64.o pcre.o
CFLAGS = -ieee -pedantic -c -O2 -DNANOSLEEP -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET
CC = cc
default: $(OBJS)
# $(CC) $(OBJS) -taso -lm -lrt -ldb -Lffi-tru64-5.1 -lffi -o newlisp
$(CC) $(OBJS) -taso -lm -lrt -ldb -Lffi-tru64-4.0 -lffi -o newlisp
strip newlisp
.c.o:
$(CC) $(CFLAGS) $<
$(OBJS): primes.h protos.h makefile_tru64
Changed the following:
-'newlisp.c' ---> line2872 cast to (int)
-'nl-math.c' ---> line 123 cast to (int)
-'nl-math.c' ---> line 138 cast to (int)
-'nl-math.c' ---> line 139 cast to (int)
-'nl-math.c' ---> line 140 cast to (int)
-'nl-math.c' ---> line 143 cast to (int)
-'nl-math.c' ---> line 144 cast to (int)
-'nl-math.c' ---> line 145 cast to (int)
-'nl-math.c' ---> line 146 cast to (int)
-'nl-math.c' ---> line 147 cast to (int)
-'nl-math.c' ---> line 148 cast to (int)
-'nl-math.c' ---> line 151 cast to (int)
-'nl-math.c' ---> line 279 cast to (int)
-'nl-math.c' ---> line 573 cast to (int)
-'nl-math.c' ---> line 574 cast to (int)
-'nl-math.c' ---> line 745 cast to (int)
-'nl-math.c' ---> line 1595 cast to (int)
As a result, 12 functions are left to test:
>>>> array-list failed nil
>>>> array? failed nil
>>>> binomial failed nil
>>>> exec failed nil
>>>> fv failed nil
>>>> int failed nil
>>>> integer failed nil
>>>> net-receive-udp failed nil
>>>> net-send-udp failed nil
>>>> npv failed nil
>>>> semaphore failed nil
>>>> share failed nil
---------------------------------
Started to work on the EXEC statement. I found that the C-function 'fgetc' (which is used in 'nl-filesys.c' lines 407-431 function 'readStreamLine') returns EOF when encountered an error or a signal. Unfortunately, the 'fgetc' function is interrupted by Tru64Unix continuously, thereore generating "Interrupted system call" or the EINTR signal all the time.
This means that sometimes the stream is read, sometimes not.
So, it was necessary to adjust the function 'readStreamLine' in a way, that it will continue when EINTR was received. I did it like this:
Code: Select all
char * readStreamLine(STREAM * stream, FILE * inStream)
{
int chr;
openStrStream(stream, MAX_STRING, 1);
do { <--------------------------------------------added
errno = 0; <-------------------------------------added
while((chr = fgetc(inStream)) != EOF)
{
if(chr == '\n') break;
if(chr == '\r')
{
chr = fgetc(inStream);
if(chr == '\n' || chr == EOF) break;
}
writeStreamChar(stream, chr);
}
} while (errno == EINTR); <------------------------added
if(chr == EOF && stream->position == 0) return(NULL);
return(stream->buffer);
}
Ugly, but it works. I hope you have a better idea on how to change this. After a "./newlisp qa_dot", this is the result:
>>>> array-list failed nil
>>>> array? failed nil
>>>> binomial failed nil
>>>> fv failed nil
>>>> int failed nil
>>>> integer failed nil
>>>> net-receive-udp failed nil
>>>> net-send-udp failed nil
>>>> npv failed nil
>>>> semaphore failed nil
>>>> share failed nil
So the EXEC statement works now. Only 11 functions left... :-)
I will post the adjusted newLisp package with the changes I mention here before the weekend. If you can approve and merge these changes....??
Continuing with the other statements now...
--