Merge commit '81d2c84674f03f9028f26474ab19d3d3f353881a'
authorAndy Wingo <wingo@pobox.com>
Thu, 22 Jan 2015 12:16:49 +0000 (13:16 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 22 Jan 2015 12:23:51 +0000 (13:23 +0100)
Some fixups in bytevectors.c.

1  2 
libguile/bytevectors.c

@@@ -1,4 -1,4 +1,4 @@@
--/* Copyright (C) 2009-2014 Free Software Foundation, Inc.
++/* Copyright (C) 2009-2015 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
@@@ -909,9 -888,9 +906,9 @@@ bytevector_large_set (char *c_bv, size_
    c_bv = (char *) SCM_BYTEVECTOR_CONTENTS (bv);                               \
                                                                        \
    /* C_SIZE must have its 3 higher bits set to zero so that           \
-      multiplying it by 8 yields a number that fits in an              \
-      unsigned long.  */                                                       \
-   if (SCM_UNLIKELY ((c_size == 0) || (c_size >= (ULONG_MAX >> 3L))))  \
+      multiplying it by 8 yields a number that fits in a                       \
+      size_t.  */                                                      \
 -  if (SCM_UNLIKELY (c_size == 0 || c_size >= (SCM_I_SIZE_MAX >> 3)))    \
++  if (SCM_UNLIKELY (c_size == 0 || c_size >= (SIZE_MAX >> 3)))                \
      scm_out_of_range (FUNC_NAME, size);                                       \
    if (SCM_UNLIKELY (c_index + c_size > c_len))                                \
      scm_out_of_range (FUNC_NAME, index);
@@@ -1185,12 -1160,12 +1182,12 @@@ SCM_DEFINE (scm_bytevector_to_uint_list
                                                                        \
    SCM_VALIDATE_LIST_COPYLEN (1, lst, c_len);                          \
    SCM_VALIDATE_SYMBOL (2, endianness);                                        \
-   c_size = scm_to_uint (size);                                                \
+   c_size = scm_to_size_t (size);                                      \
                                                                        \
-   if (SCM_UNLIKELY ((c_size == 0) || (c_size >= (ULONG_MAX >> 3L))))  \
 -  if (SCM_UNLIKELY (c_size == 0 || c_size >= (SCM_I_SIZE_MAX >> 3)))    \
++  if (SCM_UNLIKELY (c_size == 0 || c_size >= (SIZE_MAX >> 3)))                \
      scm_out_of_range (FUNC_NAME, size);                                       \
                                                                        \
-   bv = make_bytevector (c_len * c_size, SCM_ARRAY_ELEMENT_TYPE_VU8);     \
+   bv = make_bytevector (c_len * c_size, SCM_ARRAY_ELEMENT_TYPE_VU8);    \
    c_bv = (char *) SCM_BYTEVECTOR_CONTENTS (bv);                               \
                                                                        \
    for (c_bv_ptr = c_bv;                                                       \