-/* Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
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))) \
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))) \
for (i = 0; i < c_len; i++)
contents[i] = c_fill;
}
+ else
+ memset (SCM_BYTEVECTOR_CONTENTS (bv), 0, c_len);
return bv;
}
c_len1 = SCM_BYTEVECTOR_LENGTH (bv1);
c_len2 = SCM_BYTEVECTOR_LENGTH (bv2);
- if (c_len1 == c_len2)
+ if (c_len1 == c_len2 && (SCM_BYTEVECTOR_ELEMENT_TYPE (bv1)
+ == SCM_BYTEVECTOR_ELEMENT_TYPE (bv2)))
{
signed char *c_bv1, *c_bv2;
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)))
#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; \
scm_bootstrap_bytevectors (void)
{
/* This must be instantiated here because the generalized-vector API may
- want to access bytevectors even though `(rnrs bytevector)' hasn't been
+ want to access bytevectors even though `(rnrs bytevectors)' hasn't been
loaded. */
scm_null_bytevector = make_bytevector (0, SCM_ARRAY_ELEMENT_TYPE_VU8);
#ifdef WORDS_BIGENDIAN
- scm_i_native_endianness = scm_from_locale_symbol ("big");
+ scm_i_native_endianness = scm_from_latin1_symbol ("big");
#else
- scm_i_native_endianness = scm_from_locale_symbol ("little");
+ scm_i_native_endianness = scm_from_latin1_symbol ("little");
#endif
scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,