diff options
author | Daniel Llorens <daniel.llorens@bluewin.ch> | 2013-04-17 17:29:36 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2014-01-27 21:45:18 +0100 |
commit | 3e226ece5fc6f87cac2d02948177cafe61977bc4 (patch) | |
tree | ec4709e44b9387a52c236189095ba8bea67a7bc7 /libguile/bytevectors.c | |
parent | 95cd688421175870b22f71409fb4ef24124d68d0 (diff) | |
download | guile-3e226ece5fc6f87cac2d02948177cafe61977bc4.tar.gz |
Avoid using array_handle fields in impl->vref/vset
* libguile/bytevectors.c: (bv_handle_set_x, bv_handle_ref): get length
and element type fields from the bytevector, not from the handle.
* libguile/vectors.c: (vector_handle_set, vector_handle_ref): get length
from the vector, not from the handle.
Diffstat (limited to 'libguile/bytevectors.c')
-rw-r--r-- | libguile/bytevectors.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c index 70663880b..f197be342 100644 --- a/libguile/bytevectors.c +++ b/libguile/bytevectors.c @@ -2154,7 +2154,7 @@ bv_handle_ref (scm_t_array_handle *h, size_t index) SCM byte_index; scm_t_bytevector_ref_fn ref_fn; - ref_fn = bytevector_ref_fns[h->element_type]; + ref_fn = bytevector_ref_fns[SCM_BYTEVECTOR_ELEMENT_TYPE (h->array)]; byte_index = scm_from_size_t (index * SCM_BYTEVECTOR_TYPE_SIZE (h->array)); return ref_fn (h->array, byte_index); @@ -2217,7 +2217,7 @@ bv_handle_set_x (scm_t_array_handle *h, size_t index, SCM val) SCM byte_index; scm_t_bytevector_set_fn set_fn; - set_fn = bytevector_set_fns[h->element_type]; + set_fn = bytevector_set_fns[SCM_BYTEVECTOR_ELEMENT_TYPE (h->array)]; byte_index = scm_from_size_t (index * SCM_BYTEVECTOR_TYPE_SIZE (h->array)); set_fn (h->array, byte_index, val); |