-rwxr-xr-x | gcl/ChangeLog | 5 | ||||
-rw-r--r-- | gcl/bin/makefile | 15 | ||||
-rw-r--r-- | gcl/clcs/makefile | 15 | ||||
-rw-r--r-- | gcl/cmpnew/makefile | 15 | ||||
-rw-r--r-- | gcl/comp/makefile | 15 | ||||
-rwxr-xr-x | gcl/configure | 8 | ||||
-rw-r--r-- | gcl/configure.in | 5 | ||||
-rw-r--r-- | gcl/doc/makefile | 15 | ||||
-rw-r--r-- | gcl/dos/makefile | 15 | ||||
-rw-r--r-- | gcl/elisp/makefile | 15 | ||||
-rw-r--r-- | gcl/gcl-tk/makefile | 15 | ||||
-rw-r--r-- | gcl/go/makefile | 15 | ||||
-rwxr-xr-x | gcl/h/cmponly.h | 17 | ||||
-rwxr-xr-x | gcl/h/mp.h | 2 | ||||
-rwxr-xr-x | gcl/h/object.h | 26 | ||||
-rw-r--r-- | gcl/info/makefile | 25 | ||||
-rwxr-xr-x | gcl/lsp/arraylib.data | 2 | ||||
-rwxr-xr-x | gcl/lsp/arraylib.lsp | 6 | ||||
-rw-r--r-- | gcl/lsp/makefile | 15 | ||||
-rw-r--r-- | gcl/makedefc.in | 5 | ||||
-rw-r--r-- | gcl/makefile | 17 | ||||
-rw-r--r-- | gcl/mp/makefile | 15 | ||||
-rwxr-xr-x | gcl/o/array.c | 75 | ||||
-rwxr-xr-x | gcl/o/cmac.c | 10 | ||||
-rwxr-xr-x | gcl/o/gmp_big.c | 57 | ||||
-rwxr-xr-x | gcl/o/main.c | 9 | ||||
-rw-r--r-- | gcl/o/makefile | 15 | ||||
-rwxr-xr-x | gcl/o/usig.c | 10 | ||||
-rwxr-xr-x | gcl/o/usig2.c | 2 | ||||
-rw-r--r-- | gcl/unixport/make_kcn | 15 | ||||
-rw-r--r-- | gcl/unixport/makefile | 15 |
diff --git a/gcl/ChangeLog b/gcl/ChangeLog index 7950b935b..e34340b5c 100755 --- a/gcl/ChangeLog +++ b/gcl/ChangeLog @@ -1,3 +1,8 @@ +2002年06月07日 Camm Maguire <camm@intech19.enhanced.com> + + * Backport of bug fixes from cvs head -- (declare (integer... + supported, array-displacement supported, gmp numeric error fixed + 2002年02月01日 Camm Maguire <camm@intech19.enhanced.com> * /cvsroot/gcl/gcl/h/solaris.h: Uncommented define of DBEGIN in h/solaris.h diff --git a/gcl/bin/makefile b/gcl/bin/makefile index 03d0ef47e..1b72a907e 100644 --- a/gcl/bin/makefile +++ b/gcl/bin/makefile @@ -47,11 +47,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -66,12 +63,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/clcs/makefile b/gcl/clcs/makefile index a0d1bd15b..7497cc6ce 100644 --- a/gcl/clcs/makefile +++ b/gcl/clcs/makefile @@ -47,11 +47,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -66,12 +63,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/cmpnew/makefile b/gcl/cmpnew/makefile index 559efc576..c5b31e236 100644 --- a/gcl/cmpnew/makefile +++ b/gcl/cmpnew/makefile @@ -73,11 +73,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -92,12 +89,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/comp/makefile b/gcl/comp/makefile index 8a513a4f4..ce8bf6574 100644 --- a/gcl/comp/makefile +++ b/gcl/comp/makefile @@ -78,11 +78,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -97,12 +94,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/configure b/gcl/configure index 9d8fe9556..0a72487d2 100755 --- a/gcl/configure +++ b/gcl/configure @@ -3048,9 +3048,10 @@ if test $gcl_ok = no ; then echo "$ac_t""no" 1>&6 ; fi rm -f makedefsafter +MP_INCLUDE="" if test $use_gmp = yes ; then echo $ac_n "checking use_gmp=yes, doing configure in gmp directory""... $ac_c" 1>&6 -echo "configure:3054: checking use_gmp=yes, doing configure in gmp directory" >&5 +echo "configure:3055: checking use_gmp=yes, doing configure in gmp directory" >&5 case "${canonical}" in i[5-9]86* | pentium* | k6* | athlon*) (cd gmp ; ./configure --target=i486) ;; @@ -3064,15 +3065,17 @@ echo "configure:3054: checking use_gmp=yes, doing configure in gmp directory" >& EOF + MP_INCLUDE=h/gmp.h echo > makedefsafter echo 'MPFILES=${GMP_DIR}libgmp.a' >> makedefsafter echo >> makedefsafter fi + # redhat/cygnus released for some reason a buggy version of gcc, # which no one else released. Catch that here. echo $ac_n "checking Checking for buggy gcc version from redhat""... $ac_c" 1>&6 -echo "configure:3076: checking Checking for buggy gcc version from redhat" >&5 +echo "configure:3079: checking Checking for buggy gcc version from redhat" >&5 if 2>&1 $CC -v | fgrep "gcc version 2.96" > /dev/null then BROKEN_O4_OPT=1 @@ -3262,6 +3265,7 @@ s%@TCL_DL_LIBS@%$TCL_DL_LIBS%g s%@TCL_LIBS@%$TCL_LIBS%g s%@NOTIFY@%$NOTIFY%g s%@GMP@%$GMP%g +s%@MP_INCLUDE@%$MP_INCLUDE%g s%@BROKEN_O4_OPT@%$BROKEN_O4_OPT%g s%@use@%$use%g diff --git a/gcl/configure.in b/gcl/configure.in index 68b5bcfc6..439394c47 100644 --- a/gcl/configure.in +++ b/gcl/configure.in @@ -782,6 +782,7 @@ if test $gcl_ok = no ; then AC_MSG_RESULT(no) ; fi rm -f makedefsafter +MP_INCLUDE="" if test $use_gmp = yes ; then AC_MSG_CHECKING([use_gmp=yes, doing configure in gmp directory]) case "${canonical}" in @@ -794,11 +795,13 @@ if test $use_gmp = yes ; then GMP=1 AC_DEFINE(GMP) AC_SUBST(GMP) + MP_INCLUDE=h/gmp.h echo > makedefsafter echo 'MPFILES=${GMP_DIR}libgmp.a' >> makedefsafter echo >> makedefsafter fi - +AC_SUBST(MP_INCLUDE) + # redhat/cygnus released for some reason a buggy version of gcc, # which no one else released. Catch that here. AC_MSG_CHECKING([Checking for buggy gcc version from redhat]) diff --git a/gcl/doc/makefile b/gcl/doc/makefile index 07b29bccf..e39f647a9 100644 --- a/gcl/doc/makefile +++ b/gcl/doc/makefile @@ -50,11 +50,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -69,12 +66,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/dos/makefile b/gcl/dos/makefile index 5122308ba..6ce48015e 100644 --- a/gcl/dos/makefile +++ b/gcl/dos/makefile @@ -49,11 +49,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -68,12 +65,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/elisp/makefile b/gcl/elisp/makefile index a35dfb557..afad85da1 100644 --- a/gcl/elisp/makefile +++ b/gcl/elisp/makefile @@ -44,11 +44,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -63,12 +60,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/gcl-tk/makefile b/gcl/gcl-tk/makefile index 21f31e3a9..8cbd404d5 100644 --- a/gcl/gcl-tk/makefile +++ b/gcl/gcl-tk/makefile @@ -58,11 +58,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -77,12 +74,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/go/makefile b/gcl/go/makefile index a0e7e2947..597ead519 100644 --- a/gcl/go/makefile +++ b/gcl/go/makefile @@ -78,11 +78,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -97,12 +94,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/h/cmponly.h b/gcl/h/cmponly.h index 411625b82..8c0f608e8 100755 --- a/gcl/h/cmponly.h +++ b/gcl/h/cmponly.h @@ -33,6 +33,23 @@ GEN setq_io(),setq_ii(); #define IDECL(a,b,c) our_ulong b[4];a =(b[0]=0x1010000 +4,b);object c #endif +#else + +typedef MP_INT * GEN; + +int obj_to_mpz(object,MP_INT *); +int mpz_to_mpz(MP_INT *,MP_INT *); +void isetq_fix(MP_INT *,int); +MP_INT * otoi(object x); + +#define IDECL(a,b,c) MP_INT b; a = (mpz_init(&b),&b) ; object c +#define SETQ_IO(var,alloc,val) { object _xx = (val); \ + obj_to_mpz(_xx,(var));} +#define SETQ_II(var,alloc,val) { MP_INT * _xx = (val); \ + mpz_to_mpz(_xx,(var));} +#define ISETQ_FIX(a,b,c) isetq_fix(a,c) + + #endif /* end no GMP */ #define cclosure_call funcall diff --git a/gcl/h/mp.h b/gcl/h/mp.h index b9af7a871..393fa5188 100755 --- a/gcl/h/mp.h +++ b/gcl/h/mp.h @@ -84,7 +84,7 @@ typedef struct #define SET_BIG_SIGN(x,sign) \ do{if (sign < 0) {if (big_sign(x) > 0) mpz_neg(MP(x),MP(x)); } \ else { if (big_sign(x) < 0) mpz_neg(MP(x),MP(x)); } } while(0) -#define MP_LOW(u,n) ((u)->_mp_d) +#define MP_LOW(u,n) (*(u)->_mp_d) /* the bit length of each word in bignum representation */ #define BIG_RADIX 32 diff --git a/gcl/h/object.h b/gcl/h/object.h index 4a4fc532c..f452dee03 100755 --- a/gcl/h/object.h +++ b/gcl/h/object.h @@ -129,19 +129,19 @@ struct longfloat_struct { -#ifdef _MP_H - -#else -typedef struct -{ - int _mp_alloc; /* Number of *limbs* allocated and pointed - to by the _mp_d field. */ - int _mp_size; /* abs(_mp_size) is the number of limbs the - last field points to. If _mp_size is - negative this is a negative number. */ - void *_mp_d; /* Pointer to the limbs. */ -} __mpz_struct; -#endif +/* #ifdef _MP_H */ + +/* #else */ +/* typedef struct */ +/* { */ +/* int _mp_alloc; Number of *limbs* allocated and pointed +/* to by the _mp_d field. +/* int _mp_size; abs(_mp_size) is the number of limbs the +/* last field points to. If _mp_size is +/* negative this is a negative number. +/* void *_mp_d; Pointer to the limbs. */ +/* } __mpz_struct; */ +/* #endif */ struct bignum { FIRSTWORD; diff --git a/gcl/info/makefile b/gcl/info/makefile index ac1affb82..564e19bfb 100644 --- a/gcl/info/makefile +++ b/gcl/info/makefile @@ -29,12 +29,12 @@ EMACS_DEFAULT_EL=/usr/local/share/emacs/20.7/site-lisp/default.el # numerous TCL/TK variables culled from the tkConfig.sh and tclConfig.sh # if these are found. -TK_CONFIG_PREFIX=/usr/lib/tk8.2 -TK_LIBRARY=/usr/lib/tk8.2/../tk8.2 -TCL_LIBRARY=/usr/lib/tk8.2/../tcl8.2 +TK_CONFIG_PREFIX=/usr/lib +TK_LIBRARY=/usr/lib/tk8.2 +TCL_LIBRARY=/usr/lib/tcl8.2 TK_XINCLUDES=-I/usr/X11R6/include -TK_INCLUDE=-I/usr/include/tcl8.2 -TCL_INCLUDE=-I/usr/include/tcl8.2 +TK_INCLUDE=-I/usr/lib/../include +TCL_INCLUDE=-I/usr/lib/../include TK_LIB_SPEC=-L/usr/lib -ltk8.2 TK_BUILD_LIB_SPEC=-L/usr/lib -ltk8.2 TK_XLIBSW=-L/usr/X11R6/lib -lX11 @@ -46,11 +46,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/mnt/i19/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -65,12 +62,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/lsp/arraylib.data b/gcl/lsp/arraylib.data index 94c393783..6b25550b0 100755 --- a/gcl/lsp/arraylib.data +++ b/gcl/lsp/arraylib.data @@ -1,7 +1,7 @@ #(#! (lisp::in-package (lisp::quote user::lisp))#! -(lisp::export (lisp::quote (lisp::make-array lisp::vector lisp::array-element-type lisp::array-rank lisp::array-dimension lisp::array-dimensions lisp::array-in-bounds-p lisp::array-row-major-index lisp::adjustable-array-p lisp::bit lisp::sbit lisp::bit-and lisp::bit-ior lisp::bit-xor lisp::bit-eqv lisp::bit-nand lisp::bit-nor lisp::bit-andc1 lisp::bit-andc2 lisp::bit-orc1 lisp::bit-orc2 lisp::bit-not lisp::array-has-fill-pointer-p lisp::fill-pointer lisp::vector-push lisp::vector-push-extend lisp::vector-pop lisp::adjust-array)))#! +(lisp::export (lisp::quote (lisp::make-array lisp::array-displacement lisp::vector lisp::array-element-type lisp::array-rank lisp::array-dimension lisp::array-dimensions lisp::array-in-bounds-p lisp::array-row-major-index lisp::adjustable-array-p lisp::bit lisp::sbit lisp::bit-and lisp::bit-ior lisp::bit-xor lisp::bit-eqv lisp::bit-nand lisp::bit-nor lisp::bit-andc1 lisp::bit-andc2 lisp::bit-orc1 lisp::bit-orc2 lisp::bit-not lisp::array-has-fill-pointer-p lisp::fill-pointer lisp::vector-push lisp::vector-push-extend lisp::vector-pop lisp::adjust-array)))#! (lisp::in-package (lisp::quote lisp::system)) #((lisp::bit lisp::unsigned-char lisp::signed-char lisp::unsigned-short lisp::signed-short lisp::fixnum) lisp::fixnum (lisp::bit lisp::unsigned-char lisp::signed-char lisp::unsigned-short lisp::signed-short) lisp::character lisp::string-char (lisp::string-char lisp::bit lisp::short-float lisp::long-float) "fill pointer for 1 dimensional arrays only" :initial-element :element-type :initial-contents "The rank of the array is ~R,~%~ ~7@Tbut ~R ~:*~[indices are~;index is~:;indices are~] ~ diff --git a/gcl/lsp/arraylib.lsp b/gcl/lsp/arraylib.lsp index 6449adc70..712e0add5 100755 --- a/gcl/lsp/arraylib.lsp +++ b/gcl/lsp/arraylib.lsp @@ -25,7 +25,7 @@ (in-package 'lisp) -(export '(make-array vector +(export '(make-array array-displacement vector array-element-type array-rank array-dimension array-dimensions array-in-bounds-p array-row-major-index @@ -64,6 +64,10 @@ (return v)))) t)))) +;(defun array-displacement (array) +; (let ((x (si:array-displacement1 array))) +; (values (car x) (cdr x))) +; ) (defun make-array (dimensions &key (element-type t) diff --git a/gcl/lsp/makefile b/gcl/lsp/makefile index de6ec3f26..148798b49 100644 --- a/gcl/lsp/makefile +++ b/gcl/lsp/makefile @@ -74,11 +74,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -93,12 +90,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/makedefc.in b/gcl/makedefc.in index 95af1d8e3..52e3d9fc7 100644 --- a/gcl/makedefc.in +++ b/gcl/makedefc.in @@ -43,7 +43,4 @@ TCL_LIBS=@TCL_LIBS@ NOTIFY=@NOTIFY@ GCC=@GCC@ - - - - +MP_INCLUDE=@MP_INCLUDE@ diff --git a/gcl/makefile b/gcl/makefile index a7e405550..199719824 100644 --- a/gcl/makefile +++ b/gcl/makefile @@ -55,11 +55,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -74,12 +71,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of @@ -232,7 +229,7 @@ clean: rm -f h/config.h h/gclincl.h h/cmpinclude.h rm -rf gmp/.deps gmp/libgmp.a -CMPINCLUDE_FILES=${HDIR}cmpincl1.h ${HDIR}gclincl.h ${HDIR}compbas.h ${HDIR}enum.h ${HDIR}object.h ${HDIR}vs.h \ +CMPINCLUDE_FILES=${HDIR}cmpincl1.h ${HDIR}gclincl.h ${HDIR}compbas.h ${HDIR}enum.h $(MP_INCLUDE) ${HDIR}object.h ${HDIR}vs.h \ ${HDIR}bds.h ${HDIR}frame.h \ ${HDIR}lex.h ${HDIR}eval.h ${HDIR}funlink.h \ ${HDIR}att_ext.h ${HDIR}new_decl.h ${HDIR}compbas2.h ${HDIR}/compat.h ${HDIR}/cmponly.h diff --git a/gcl/mp/makefile b/gcl/mp/makefile index 155724efc..cfc534cd9 100644 --- a/gcl/mp/makefile +++ b/gcl/mp/makefile @@ -52,11 +52,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -71,12 +68,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/o/array.c b/gcl/o/array.c index f0190382c..ca9b96377 100755 --- a/gcl/o/array.c +++ b/gcl/o/array.c @@ -551,6 +551,76 @@ DEFUN("MAKE-ARRAY1",object,fSmake_array1,SI,6,6, }} /* +(proclaim '(ftype (function (object t *)) array-displacement1)) +(defun array-displacement1 ( array ) +*/ + +/* DEFUNO("ARRAY-DISPLACEMENT1",object,fSarray_displacement,SI,1,1, */ +/* NONE,OO,OO,OO,OO,siLarray_displacement,"") */ +/* (object array) { */ + +/* object a; */ +/* int s,n; */ + +/* BEGIN_NO_INTERRUPT; */ +/* if (type_of(array)!=t_array && type_of(array)!=t_vector) */ +/* FEerror("Argument is not an array",0); */ +/* a=array->a.a_displaced->c.c_car; */ +/* if (a==Cnil) { */ +/* END_NO_INTERRUPT; */ +/* return make_cons(Cnil,make_fixnum(0)); */ +/* } */ +/* s=aet_sizes[Iarray_element_type(a)]; */ +/* n=(void *)array->a.a_self-(void *)a->a.a_self; */ +/* if (n%s) */ +/* FEerror("Array is displaced by fractional elements",0); */ +/* END_NO_INTERRUPT; */ +/* return make_cons(a,make_fixnum(n/s)); */ + +/* } */ + +void +Larray_displacement(void) { + + object array,a; + int s,n; + + BEGIN_NO_INTERRUPT; + + n = vs_top - vs_base; + if (n != 1) + FEerror("Wrong number of arguments",0); + array = vs_base[0]; + vs_base=vs_top; + + if (type_of(array)!=t_array && type_of(array)!=t_vector) + FEerror("Argument is not an array",0); + a=array->a.a_displaced->c.c_car; + + if (a==Cnil) { + + vs_push(Cnil); + vs_push(make_fixnum(0)); + END_NO_INTERRUPT; + + return; + + } + + s=aet_sizes[Iarray_element_type(a)]; + n=(void *)array->a.a_self-(void *)a->a.a_self; + if (n%s) + FEerror("Array is displaced by fractional elements",0); + + vs_push(a); + vs_push(make_fixnum(n/s)); + END_NO_INTERRUPT; + + return; + +} + +/* For the X->a.a_displaced field, the CAR is an array which X 's body is displaced to (ie body of X is part of Another array) and the (CDR) is the LIST of arrays whose bodies are displaced @@ -1086,7 +1156,10 @@ object array,val,cursor; RETURN1(array); } -init_array_function(){;} +void +init_array_function(void) { + make_function("ARRAY-DISPLACEMENT", Larray_displacement); +} diff --git a/gcl/o/cmac.c b/gcl/o/cmac.c index f297241cb..11be7d5b4 100755 --- a/gcl/o/cmac.c +++ b/gcl/o/cmac.c @@ -3,7 +3,7 @@ #include "include.h" #endif -#include "arith.h" +/* #include "arith.h" */ @@ -26,10 +26,10 @@ object *gclModulus; -#define MYmake_fixnum(doto,x) \ - {register int CMPt1; \ - doto \ - ((((CMPt1=(x))+1024)&-2048)==0?small_fixnum(CMPt1):make_fixnum(CMPt1));} +/* #define MYmake_fixnum(doto,x) \ */ +/* {register int CMPt1; \ */ +/* doto \ */ +/* ((((CMPt1=(x))+1024)&-2048)==0?small_fixnum(CMPt1):make_fixnum(CMPt1));} */ diff --git a/gcl/o/gmp_big.c b/gcl/o/gmp_big.c index 26e61018f..ad612549c 100755 --- a/gcl/o/gmp_big.c +++ b/gcl/o/gmp_big.c @@ -354,6 +354,63 @@ copy_to_big(x) } +/* put in to get (declare integer working with existing setup. + should be optimized at some point, as we're just converting + and reconverting integer data, it appears -- CM */ + +int +obj_to_mpz(object x,MP_INT * y) { + + int ret=0; + + switch(type_of(x)) { + case t_fixnum: + mpz_set_si(y,fix(x)); + break; + case t_bignum: + mpz_set(y,MP(x)); + break; + default: + FEerror("fixnum or bignum expected",0); + ret=1; + break; + } + + return ret; + +} + +int +mpz_to_mpz(MP_INT * x,MP_INT * y) { + + int ret=0; + + mpz_set(y,x); + return ret; + +} + +void +isetq_fix(MP_INT * var,int s) +{ + mpz_set_si(var,s); +} + +MP_INT * +otoi(object x) { + if (type_of(x)==t_fixnum) { + object y = new_bignum(); + mpz_set_si(MP(y),fix(x)); + return MP(y); + } + if (type_of(x)==t_bignum) + return (MP(x)); + FEwrong_type_argument(sLinteger,x); + return NULL; +} +/* end added section for declare integer -- CM */ + + /* return object like *xpt coercing to a fixnum if necessary, diff --git a/gcl/o/main.c b/gcl/o/main.c index 6a2bc0888..6fdda080e 100755 --- a/gcl/o/main.c +++ b/gcl/o/main.c @@ -83,6 +83,10 @@ object sSAmultiply_stacksA; int stack_multiple=1; static object stack_space; +#ifdef _WIN32 +unsigned int _dbegin = 0x10100000; +unsigned int _stacktop, _stackbottom; +#endif int cssize; @@ -103,6 +107,7 @@ int argc; char **argv, **envp; { FILE *i; + unsigned int dummy; #ifdef BSD #ifdef RLIMIT_STACK struct rlimit rl; @@ -121,6 +126,10 @@ char **argv, **envp; RECREATE_HEAP #endif +#ifdef _WIN32 + _stackbottom = (unsigned int ) &dummy; + _stacktop = _stackbottom - 0x10000; // ??? +#endif setbuf(stdin, stdin_buf); setbuf(stdout, stdout_buf); diff --git a/gcl/o/makefile b/gcl/o/makefile index 795329904..47c3b1557 100644 --- a/gcl/o/makefile +++ b/gcl/o/makefile @@ -80,11 +80,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -99,12 +96,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/o/usig.c b/gcl/o/usig.c index 3e7603154..efe8b1919 100755 --- a/gcl/o/usig.c +++ b/gcl/o/usig.c @@ -19,6 +19,10 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifdef __MINGW32__ +#include <sys/types.h> /* sigset_t */ +#endif + #ifndef IN_UNIXINT @@ -131,9 +135,9 @@ unblock_sigusr_sigio() void -sigfpe() +sigfpe1() { - gcl_signal(SIGFPE, sigfpe); + gcl_signal(SIGFPE, sigfpe1); FEerror("Floating-point exception.", 0); } sigpipe() @@ -177,7 +181,7 @@ sigio() void install_default_signals() -{ gcl_signal(SIGFPE, sigfpe); +{ gcl_signal(SIGFPE, sigfpe1); gcl_signal(SIGPIPE, sigpipe); gcl_signal(SIGINT, sigint); gcl_signal(SIGUSR1, sigusr1); diff --git a/gcl/o/usig2.c b/gcl/o/usig2.c index 4f298e286..29e6b1c1c 100755 --- a/gcl/o/usig2.c +++ b/gcl/o/usig2.c @@ -27,7 +27,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #ifndef USIG2 #include <signal.h> #include "usig.h" -#include "arith.h" +/* #include "arith.h" */ #endif #endif diff --git a/gcl/unixport/make_kcn b/gcl/unixport/make_kcn index c5eb05d2d..db7bfcc54 100644 --- a/gcl/unixport/make_kcn +++ b/gcl/unixport/make_kcn @@ -45,11 +45,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -64,12 +61,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of diff --git a/gcl/unixport/makefile b/gcl/unixport/makefile index 1b4ef0b3b..780b63eac 100644 --- a/gcl/unixport/makefile +++ b/gcl/unixport/makefile @@ -62,11 +62,8 @@ TCL_LIBS=-ldl -lm NOTIFY=yes GCC=gcc - - - - -GCLDIR=/fix/f/debian/mm/gcl/gcl +MP_INCLUDE=h/gmp.h +GCLDIR=/home/camm/gcl/tmp/gcl-2.4.1 SHELL=/bin/sh MACHINE=386-linux @@ -81,12 +78,12 @@ MACHINE=386-linux LBINDIR=/usr/local/bin -#OFLAG = -O -OFLAG = -g +OFLAG = -O +#OFLAG = -g LIBS = -lm -#ODIR_DEBUG= -O4 -ODIR_DEBUG= -g +ODIR_DEBUG= -O4 +#ODIR_DEBUG= -g # This CC string will be used for compilation of the system, # and also in the compiler::*cc* variable for later compilation of |