diff options
author | Martin Grabmüller <mgrabmue@cs.tu-berlin.de> | 2001-06-27 13:15:20 +0000 |
---|---|---|
committer | Martin Grabmüller <mgrabmue@cs.tu-berlin.de> | 2001-06-27 13:15:20 +0000 |
commit | b858464a0a34381caf8661ec32a27bb94ce8c6cc (patch) | |
tree | f1daf07e502ac9b3256b9fdbe2ba45a60db9c541 /libguile/num2integral.i.c | |
parent | dbfadc85884aadbe0b905b66e2ff62200c2758a1 (diff) | |
download | guile-b858464a0a34381caf8661ec32a27bb94ce8c6cc.tar.gz |
* read.c (scm_lreadr): When reading a hash token, check for a
user-defined hash procedure first, so that overriding the builtin
hash characters is possible (this was needed for implementing
SRFI-4's read synax `f32(...)').
* num2integral.i.c: Use scm_t_signed_bits instead of scm_t_bits,
because the latter is unsigned now and breaks comparisons like
(n < (scm_t_signed_bits)MIN_VALUE).
Diffstat (limited to 'libguile/num2integral.i.c')
-rw-r--r-- | libguile/num2integral.i.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/num2integral.i.c b/libguile/num2integral.i.c index 5498c2828..f273eef89 100644 --- a/libguile/num2integral.i.c +++ b/libguile/num2integral.i.c @@ -6,22 +6,22 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) if (SCM_INUMP (num)) { /* immediate */ - scm_t_bits n = SCM_INUM (num); + scm_t_signed_bits n = SCM_INUM (num); #ifdef UNSIGNED if (n < 0) scm_out_of_range (s_caller, num); #endif - if (sizeof (ITYPE) >= sizeof (scm_t_bits)) + if (sizeof (ITYPE) >= sizeof (scm_t_signed_bits)) /* can't fit anything too big for this type in an inum anyway */ return (ITYPE) n; else { /* an inum can be out of range, so check */ - if (n > (scm_t_bits)MAX_VALUE + if (n > (scm_t_signed_bits)MAX_VALUE #ifndef UNSIGNED - || n < (scm_t_bits)MIN_VALUE + || n < (scm_t_signed_bits)MIN_VALUE #endif ) scm_out_of_range (s_caller, num); @@ -84,7 +84,7 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) SCM INTEGRAL2NUM (ITYPE n) { - if (sizeof (ITYPE) < sizeof (scm_t_bits) + if (sizeof (ITYPE) < sizeof (scm_t_signed_bits) || #ifndef UNSIGNED SCM_FIXABLE (n) |