diff options
author | Andy Wingo <wingo@pobox.com> | 2010-11-19 11:29:26 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-11-19 15:22:43 +0100 |
commit | e25f37271acde5b9e3c34420ad9d0faa62b7503d (patch) | |
tree | ab77d62427c4c4fa717f3c62aa79765c7633d88e /libguile/bytevectors.c | |
parent | d2aed81f7cb8b703b000962a1b9dddc8de91212e (diff) | |
download | guile-e25f37271acde5b9e3c34420ad9d0faa62b7503d.tar.gz |
fix a number of assuptions that a long could hold an inum
* libguile/bytevectors.c:
* libguile/goops.c:
* libguile/instructions.c:
* libguile/numbers.c:
* libguile/random.c:
* libguile/read.c:
* libguile/vm-i-scheme.c: Fix a number of assumptions that a long could
hold an inum. This is not the case on platforms whose void* is larger
than their long.
* libguile/numbers.c (scm_i_inum2big): New helper, only implemented for
sizeof(void*) == sizeof(long); produces a compile error on other
platforms. Basically gmp doesn't have a nice interface for converting
between mpz values and intmax_t.
Diffstat (limited to 'libguile/bytevectors.c')
-rw-r--r-- | libguile/bytevectors.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c index de8077e0c..31703bf2e 100644 --- a/libguile/bytevectors.c +++ b/libguile/bytevectors.c @@ -131,7 +131,7 @@ SCM_VALIDATE_SYMBOL (3, endianness); \ \ { \ - _sign long c_value; \ + scm_t_signed_bits c_value; \ INT_TYPE (_len, _sign) c_value_short; \ \ if (SCM_UNLIKELY (!SCM_I_INUMP (value))) \ @@ -156,7 +156,7 @@ INTEGER_ACCESSOR_PROLOGUE (_len, _sign); \ \ { \ - _sign long c_value; \ + scm_t_signed_bits c_value; \ INT_TYPE (_len, _sign) c_value_short; \ \ if (SCM_UNLIKELY (!SCM_I_INUMP (value))) \ @@ -735,7 +735,7 @@ SCM_DEFINE (scm_u8_list_to_bytevector, "u8-list->bytevector", 1, 0, 0, if (SCM_LIKELY (SCM_I_INUMP (item))) { - long c_item; + scm_t_signed_bits c_item; c_item = SCM_I_INUM (item); if (SCM_LIKELY ((c_item >= 0) && (c_item < 256))) @@ -951,7 +951,7 @@ bytevector_unsigned_ref (const char *c_bv, size_t c_size, SCM endianness) #define GENERIC_INTEGER_SET(_sign) \ if (c_size < 3) \ { \ - _sign int c_value; \ + scm_t_signed_bits c_value; \ \ if (SCM_UNLIKELY (!SCM_I_INUMP (value))) \ goto range_error; \ |