Add type and range checks to the complex generalized vector accessors.
authorLudovic Courtès <ludo@gnu.org>
Fri, 1 Jul 2011 17:09:29 +0000 (19:09 +0200)
committerLudovic Courtès <ludo@gnu.org>
Fri, 1 Jul 2011 17:09:29 +0000 (19:09 +0200)
commit4bc95fccad7288004515ce78d50611499cbca2db
tree21cbe4bb4050d91aaaa1b4dd9f95f38ccaaa70e4
parent1e8f93922922b09c7003a357d86777b2a79e9735
Add type and range checks to the complex generalized vector accessors.

* libguile/bytevectors.c (COMPLEX_ACCESSOR_PROLOGUE, COMPLEX_NATIVE_REF,
  COMPLEX_NATIVE_SET): New macros.
  (bytevector_ref_c32, bytevector_ref_c64): Defined in terms of
  `COMPLEX_NATIVE_REF'.
  (bytevector_set_c32, bytevector_set_c64): Defined in terms of
  `COMPLEX_NATIVE_SET'.
  (bytevector_ref_fns): Make `static'.

* test-suite/tests/srfi-4.test ("c32 vectors")["generalized-vector-ref",
  "generalized-vector-set!", "generalized-vector-ref, out-of-range",
  "generalized-vector-set!, out-of-range"]: New tests.
  ("c64 vectors")["generalized-vector-ref", "generalized-vector-set!",
  "generalized-vector-ref, out-of-range",
  "generalized-vector-set!, out-of-range"]: New tests.
libguile/bytevectors.c
test-suite/tests/srfi-4.test