1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

* 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.
This commit is contained in:
Dirk Herrmann 2000-05-16 12:11:08 +00:00
parent 3c9f20f849
commit 5610071627
9 changed files with 51 additions and 79 deletions

View file

@ -1,3 +1,22 @@
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> 2000-05-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
* numbers.c (scm_logcount, scm_integer_length): Reordered * numbers.c (scm_logcount, scm_integer_length): Reordered

View file

@ -224,7 +224,4 @@ MOSTLYCLEANFILES = \
cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \ cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new
CLEANFILES = libpath.h CLEANFILES = libpath.h *.x *.doc
DISTCLEANFILES = *.x *.doc

View file

@ -147,7 +147,8 @@
* *
* Note: Some SCM_DEBUG_XXX options are not settable at configure time. * 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 * 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 #define SCM_DEBUG_DEPRECATED 0
#endif #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 #ifdef HAVE_LONG_LONGS

View file

@ -121,12 +121,6 @@
extern int errno; extern int errno;
# endif /* def ARM_ULIB */ # endif /* def ARM_ULIB */
#endif /* ndef MSDOS */ #endif /* ndef MSDOS */
#ifdef __TURBOC__
# if (__TURBOC__==1)
/* Needed for TURBOC V1.0 */
extern int errno;
# endif /* (__TURBOC__==1) */
#endif /* def __TURBOC__ */

View file

@ -63,11 +63,7 @@ typedef struct scm_cell
/* SCM_CELLPTR is a pointer to a cons cell which may be compared or /* SCM_CELLPTR is a pointer to a cons cell which may be compared or
* differenced. * differenced.
*/ */
#if !defined (__TURBOC__) || defined (__TOS__) || defined (PROT386) typedef scm_cell * SCM_CELLPTR;
typedef scm_cell * SCM_CELLPTR;
#else
typedef scm_cell huge * SCM_CELLPTR;
#endif
/* Cray machines have pointers that are incremented once for each word, /* Cray machines have pointers that are incremented once for each word,
@ -134,21 +130,12 @@ typedef struct scm_cell
* same scm_array). * same scm_array).
*/ */
#if !defined(__TURBOC__) || defined(__TOS__) #ifdef nosve
#ifdef nosve #define SCM_PTR_MASK 0xffffffffffff
#define SCM_PTR_MASK 0xffffffffffff #define SCM_PTR_LT(x, y) (((int) (x) & SCM_PTR_MASK) < ((int) (y) & SCM_PTR_MASK))
#define SCM_PTR_LT(x, y)\ #else
(((int) (x) & SCM_PTR_MASK) < ((int) (y) & SCM_PTR_MASK)) #define SCM_PTR_LT(x, y) ((x) < (y))
#else #endif /* def nosve */
#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__) */
#define SCM_PTR_GT(x, y) SCM_PTR_LT (y, x) #define SCM_PTR_GT(x, y) SCM_PTR_LT (y, x)
#define SCM_PTR_LE(x, y) (!SCM_PTR_GT (x, y)) #define SCM_PTR_LE(x, y) (!SCM_PTR_GT (x, y))

View file

@ -168,9 +168,7 @@ remark_port (SCM port)
int int
gdb_maybe_valid_type_p (SCM value) gdb_maybe_valid_type_p (SCM value)
{ {
if (SCM_IMP (value) || scm_cellp (value)) return SCM_IMP (value) || scm_cellp (value);
return (! SCM_EQ_P (scm_tag (value), SCM_MAKINUM (-1)));
return 0;
} }

View file

@ -265,11 +265,7 @@ scm_remainder (SCM x, SCM y)
if (yy == 0) { if (yy == 0) {
scm_num_overflow (s_remainder); scm_num_overflow (s_remainder);
} else { } else {
#if (__TURBOC__ == 1)
long z = SCM_INUM (x) % (yy < 0 ? -yy : yy);
#else
long z = SCM_INUM (x) % yy; long z = SCM_INUM (x) % yy;
#endif
return SCM_MAKINUM (z); return SCM_MAKINUM (z);
} }
} else if (SCM_BIGP (y)) { } else if (SCM_BIGP (y)) {
@ -310,11 +306,7 @@ scm_modulo (SCM x, SCM y)
if (yy == 0) { if (yy == 0) {
scm_num_overflow (s_modulo); scm_num_overflow (s_modulo);
} else { } else {
#if (__TURBOC__ == 1)
long z = ((yy < 0) ? -xx : xx) % yy;
#else
long z = xx % yy; long z = xx % yy;
#endif
return SCM_MAKINUM (((yy < 0) ? (z > 0) : (z < 0)) ? z + yy : z); return SCM_MAKINUM (((yy < 0) ? (z > 0) : (z < 0)) ? z + yy : z);
} }
} else if (SCM_BIGP (y)) { } else if (SCM_BIGP (y)) {

View file

@ -63,40 +63,21 @@
* SCM_INUMP (SCM_CAR (x)) can give wrong answers. * SCM_INUMP (SCM_CAR (x)) can give wrong answers.
*/ */
/* SCM_SRS is signed right shift */
#if (-1 == (((-1) << 2) + 2) >> 2)
# define SCM_SRS(x, y) ((x) >> (y))
#else
# define SCM_SRS(x, y) ((SCM_UNPACK (x) < 0) ? ~((~SCM_UNPACK (x)) >> (y)) : (SCM_UNPACK (x) >> (y)))
#endif /* (-1 == (((-1) << 2) + 2) >> 2) */
#define SCM_INUMP(x) (2 & SCM_UNPACK (x)) #define SCM_INUMP(x) (2 & SCM_UNPACK (x))
#define SCM_NINUMP(x) (!SCM_INUMP (x)) #define SCM_NINUMP(x) (!SCM_INUMP (x))
#define SCM_MAKINUM(x) (SCM_PACK (((x) << 2) + 2L))
#ifdef __TURBOC__ #define SCM_INUM(x) (SCM_SRS (SCM_UNPACK (x), 2))
/* 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))
#else
# define SCM_MAKINUM(x) (SCM_PACK (((x) << 2) + 2L))
#endif /* def __TURBOC__ */
/* SCM_SRS is signed right shift */ /* A name for 0. */
/* 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) */
/* A name for 0.
*/
#define SCM_INUM0 (SCM_MAKINUM (0)) #define SCM_INUM0 (SCM_MAKINUM (0))

View file

@ -54,7 +54,6 @@
/* #define SCM_STRICT_TYPING */
/* #define SCM_VOIDP_TEST */ /* #define SCM_VOIDP_TEST */
/* In the beginning was the Word: /* 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 /* But as external interface, we use SCM, which may, according to the desired
* level of type checking, be defined in several ways: * level of type checking, be defined in several ways:
*/ */
#if defined (SCM_STRICT_TYPING) #if (SCM_DEBUG_TYPING_STRICTNESS == 1)
/* 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'.
*/
typedef union { struct { scm_bits_t n; } n; } SCM; 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; } static SCM scm_pack(scm_bits_t b) { SCM s; s.n.n = b; return s; }
#define SCM_UNPACK(x) ((x).n.n) #define SCM_UNPACK(x) ((x).n.n)