Avoid signed overflow and use size_t in bytevectors.c.
authorMark H Weaver <mhw@netris.org>
Wed, 12 Nov 2014 05:35:34 +0000 (00:35 -0500)
committerMark H Weaver <mhw@netris.org>
Wed, 12 Nov 2014 05:37:00 +0000 (00:37 -0500)
commit81d2c84674f03f9028f26474ab19d3d3f353881a
tree2544cc62bfde7d328631641a4d9e710a6b8aa2b1
parentfdd319e9bd4121d844662d3d8ccc69b462b60840
Avoid signed overflow and use size_t in bytevectors.c.

* libguile/bytevectors.c (ULONG_MAX): Remove (unportable) fallback
  definition.  It is no longer used.
  (scm_make_bytevector): Use 'size_t' instead of 'unsigned' for
  indices.  Use 'scm_t_uint8' instead of 'signed char' for elements
  and c_fill.  Previously relied on GNU-C-specific behavior when
  casting integers in the range 128-255 to signed char.
  (GENERIC_INTEGER_ACCESSOR_PROLOGUE, INTEGER_LIST_TO_BYTEVECTOR)
  (scm_bytevector_eq_p, scm_bytevector_copy_x, scm_bytevector_copy)
  (scm_bytevector_to_u8_list, scm_u8_list_to_bytevector)
  (scm_bytevector_fill_x): Use 'size_t' instead of 'unsigned' for
  indices.  Use 'scm_t_uint8' for elements.
libguile/bytevectors.c