diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2000-05-16 12:11:08 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2000-05-16 12:11:08 +0000 |
commit | 56100716270fae40cfa71a69c45a2ed03f2510da (patch) | |
tree | 3f665f188e7f5339bb1e909019233afde2b4aa41 | |
parent | 3c9f20f849ad67b8ba6f35b6f0eca2cde1c3e103 (diff) | |
download | guile-56100716270fae40cfa71a69c45a2ed03f2510da.tar.gz |
* Makefile.am: Let 'make clean' remove *.x and *.doc files.
* Renamed SCM_STRICT_TYPING to SCM_DEBUG_TYPING_STRICTNESS.
* Removed conditionally compiled code for Turbo C.
* gdbint.c: Eliminated call to scm_tag.
-rw-r--r-- | libguile/ChangeLog | 19 | ||||
-rw-r--r-- | libguile/Makefile.am | 5 | ||||
-rw-r--r-- | libguile/__scm.h | 12 | ||||
-rw-r--r-- | libguile/_scm.h | 6 | ||||
-rw-r--r-- | libguile/gc.h | 27 | ||||
-rw-r--r-- | libguile/gdbint.c | 4 | ||||
-rw-r--r-- | libguile/numbers.c | 8 | ||||
-rw-r--r-- | libguile/numbers.h | 39 | ||||
-rw-r--r-- | libguile/tags.h | 8 |
9 files changed, 50 insertions, 78 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index e487e3bc7..d0b2c2b9d 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,24 @@ 2000-05-16 Dirk Herrmann <D.Herrmann@tu-bs.de> + * Makefile.am: Let 'make clean' remove *.x and *.doc files. + + * __scm.h: Improved explanation of giving options to make. + + * __scm.h (SCM_DEBUG_TYPING_STRICTNESS), tags.h + (SCM_STRICT_TYPING, SCM_DEBUG_TYPING_STRICTNESS): Renamed + SCM_STRICT_TYPING to SCM_DEBUG_TYPING_STRICTNESS and moved the + corresponding declaration and comment to __scm.h. + + * _scm.h (errno), gc.h (SCM_CELLPTR, SCM_PTR_LT), numbers.c + (scm_remainder, scm_modulo), numbers.h (SCM_SRS, SCM_MAKINUM, + SCM_INUM): Removed conditionally compiled code for Turbo C. + + * gdbint.c (gdb_maybe_valid_type_p): Eliminated call to scm_tag. + That check can be assumed to be redundant except for very rare + conditions that actually indicate broken heap data. + +2000-05-16 Dirk Herrmann <D.Herrmann@tu-bs.de> + * numbers.c (scm_logcount, scm_integer_length): Reordered dispatch sequence. diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 279cd5898..66fc92563 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -224,7 +224,4 @@ MOSTLYCLEANFILES = \ cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \ cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new -CLEANFILES = libpath.h - -DISTCLEANFILES = *.x *.doc - +CLEANFILES = libpath.h *.x *.doc diff --git a/libguile/__scm.h b/libguile/__scm.h index cb10c5142..da510f385 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -147,7 +147,8 @@ * * Note: Some SCM_DEBUG_XXX options are not settable at configure time. * To change the value of such options you will have to edit this header - * file or give -DSCM_DEBUG_XXX options to make. + * file or give suitable options to make, like: + * make all CFLAGS="-DSCM_DEBUG_XXX=1 ..." */ @@ -158,6 +159,15 @@ #define SCM_DEBUG_DEPRECATED 0 #endif +/* Use this for _compile time_ type checking only, since the compiled result + * will be quite inefficient. The right way to make use of this option is to + * do a 'make clean; make CFLAGS=-DSCM_DEBUG_TYPING_STRICTNESS=1', fix your + * errors, and then do 'make clean; make'. +*/ +#ifndef SCM_DEBUG_TYPING_STRICTNESS +#define SCM_DEBUG_TYPING_STRICTNESS 0 +#endif + #ifdef HAVE_LONG_LONGS diff --git a/libguile/_scm.h b/libguile/_scm.h index c61717036..f87a303e7 100644 --- a/libguile/_scm.h +++ b/libguile/_scm.h @@ -121,12 +121,6 @@ extern int errno; # endif /* def ARM_ULIB */ #endif /* ndef MSDOS */ -#ifdef __TURBOC__ -# if (__TURBOC__==1) - /* Needed for TURBOC V1.0 */ - extern int errno; -# endif /* (__TURBOC__==1) */ -#endif /* def __TURBOC__ */ diff --git a/libguile/gc.h b/libguile/gc.h index 34008691a..ee5c54157 100644 --- a/libguile/gc.h +++ b/libguile/gc.h @@ -63,11 +63,7 @@ typedef struct scm_cell /* SCM_CELLPTR is a pointer to a cons cell which may be compared or * differenced. */ -#if !defined (__TURBOC__) || defined (__TOS__) || defined (PROT386) - typedef scm_cell * SCM_CELLPTR; -#else - typedef scm_cell huge * SCM_CELLPTR; -#endif +typedef scm_cell * SCM_CELLPTR; /* Cray machines have pointers that are incremented once for each word, @@ -134,21 +130,12 @@ typedef struct scm_cell * same scm_array). */ -#if !defined(__TURBOC__) || defined(__TOS__) - #ifdef nosve - #define SCM_PTR_MASK 0xffffffffffff - #define SCM_PTR_LT(x, y)\ - (((int) (x) & SCM_PTR_MASK) < ((int) (y) & SCM_PTR_MASK)) - #else - #define SCM_PTR_LT(x, y) ((x) < (y)) - #endif /* def nosve */ -#else /* defined(__TURBOC__) && !defined(__TOS__) */ - #ifdef PROT386 - #define SCM_PTR_LT(x, y) (((long) (x)) < ((long) (y))) - #else - #define SCM_PTR_LT(x, y) ((x) < (y)) - #endif /* def PROT386 */ -#endif /* defined(__TURBOC__) && !defined(__TOS__) */ +#ifdef nosve + #define SCM_PTR_MASK 0xffffffffffff + #define SCM_PTR_LT(x, y) (((int) (x) & SCM_PTR_MASK) < ((int) (y) & SCM_PTR_MASK)) +#else + #define SCM_PTR_LT(x, y) ((x) < (y)) +#endif /* def nosve */ #define SCM_PTR_GT(x, y) SCM_PTR_LT (y, x) #define SCM_PTR_LE(x, y) (!SCM_PTR_GT (x, y)) diff --git a/libguile/gdbint.c b/libguile/gdbint.c index 3c2c90450..3bdb7c7a5 100644 --- a/libguile/gdbint.c +++ b/libguile/gdbint.c @@ -168,9 +168,7 @@ remark_port (SCM port) int gdb_maybe_valid_type_p (SCM value) { - if (SCM_IMP (value) || scm_cellp (value)) - return (! SCM_EQ_P (scm_tag (value), SCM_MAKINUM (-1))); - return 0; + return SCM_IMP (value) || scm_cellp (value); } diff --git a/libguile/numbers.c b/libguile/numbers.c index c21b9caf3..20950fc2d 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -265,11 +265,7 @@ scm_remainder (SCM x, SCM y) if (yy == 0) { scm_num_overflow (s_remainder); } else { -#if (__TURBOC__ == 1) - long z = SCM_INUM (x) % (yy < 0 ? -yy : yy); -#else long z = SCM_INUM (x) % yy; -#endif return SCM_MAKINUM (z); } } else if (SCM_BIGP (y)) { @@ -310,11 +306,7 @@ scm_modulo (SCM x, SCM y) if (yy == 0) { scm_num_overflow (s_modulo); } else { -#if (__TURBOC__ == 1) - long z = ((yy < 0) ? -xx : xx) % yy; -#else long z = xx % yy; -#endif return SCM_MAKINUM (((yy < 0) ? (z > 0) : (z < 0)) ? z + yy : z); } } else if (SCM_BIGP (y)) { diff --git a/libguile/numbers.h b/libguile/numbers.h index b3922f8ad..b21729e55 100644 --- a/libguile/numbers.h +++ b/libguile/numbers.h @@ -63,40 +63,21 @@ * SCM_INUMP (SCM_CAR (x)) can give wrong answers. */ -#define SCM_INUMP(x) (2 & SCM_UNPACK (x)) -#define SCM_NINUMP(x) (!SCM_INUMP (x)) - -#ifdef __TURBOC__ -/* shifts of more than one are done by a library call, single shifts are - * performed in registers - */ -# define SCM_MAKINUM(x) (SCM_PACK ((((x) << 1) << 1) + 2L)) +/* SCM_SRS is signed right shift */ +#if (-1 == (((-1) << 2) + 2) >> 2) +# define SCM_SRS(x, y) ((x) >> (y)) #else -# define SCM_MAKINUM(x) (SCM_PACK (((x) << 2) + 2L)) -#endif /* def __TURBOC__ */ +# define SCM_SRS(x, y) ((SCM_UNPACK (x) < 0) ? ~((~SCM_UNPACK (x)) >> (y)) : (SCM_UNPACK (x) >> (y))) +#endif /* (-1 == (((-1) << 2) + 2) >> 2) */ -/* SCM_SRS is signed right shift */ -/* SCM_INUM makes a C int from an SCM immediate number. */ -/* Turbo C++ v1.0 has a bug with right shifts of signed longs! - * It is believed to be fixed in Turbo C++ v1.01 - */ -#if (-1==(((-1)<<2)+2)>>2) && (__TURBOC__ != 0x295) -# define SCM_SRS(x, y) ((x) >> y) -# ifdef __TURBOC__ -# define SCM_INUM(x) ((SCM_UNPACK (x) >>1) >>1) -# else -# define SCM_INUM(x) SCM_SRS (SCM_UNPACK (x), 2) -# endif /* def __TURBOC__ */ -#else -# define SCM_SRS(x, y)\ - ((SCM_UNPACK (x) < 0) ? ~( (~SCM_UNPACK (x)) >> y) : (SCM_UNPACK (x) >> y)) -# define SCM_INUM(x) SCM_SRS (SCM_UNPACK (x), 2) -#endif /* (-1==(((-1)<<2)+2)>>2) && (__TURBOC__ != 0x295) */ +#define SCM_INUMP(x) (2 & SCM_UNPACK (x)) +#define SCM_NINUMP(x) (!SCM_INUMP (x)) +#define SCM_MAKINUM(x) (SCM_PACK (((x) << 2) + 2L)) +#define SCM_INUM(x) (SCM_SRS (SCM_UNPACK (x), 2)) -/* A name for 0. - */ +/* A name for 0. */ #define SCM_INUM0 (SCM_MAKINUM (0)) diff --git a/libguile/tags.h b/libguile/tags.h index 3e26bd8e5..956fca89d 100644 --- a/libguile/tags.h +++ b/libguile/tags.h @@ -54,7 +54,6 @@ -/* #define SCM_STRICT_TYPING */ /* #define SCM_VOIDP_TEST */ /* In the beginning was the Word: @@ -64,12 +63,7 @@ typedef long scm_bits_t; /* But as external interface, we use SCM, which may, according to the desired * level of type checking, be defined in several ways: */ -#if defined (SCM_STRICT_TYPING) -/* Use this for _compile time_ type checking only, since the compiled result - * will be quite inefficient. The right way to make use of this mode is to do - * a 'make clean' of your project, 'make all CFLAGS=-DSCM_STRICT_TYPING', fix - * your errors, and then do 'make clean; make all'. -*/ +#if (SCM_DEBUG_TYPING_STRICTNESS == 1) typedef union { struct { scm_bits_t n; } n; } SCM; static SCM scm_pack(scm_bits_t b) { SCM s; s.n.n = b; return s; } #define SCM_UNPACK(x) ((x).n.n) |