summaryrefslogtreecommitdiff
path: root/libguile/array-handle.c
diff options
context:
space:
mode:
authorDaniel Llorens <daniel.llorens@bluewin.ch>2015-02-11 12:58:01 +0100
committerDaniel Llorens <daniel.llorens@bluewin.ch>2016-11-23 11:49:35 +0100
commit85ac9cce0aa0d50274377244cf73c8776fb36db6 (patch)
treedab37284c85fc1b2e5ade9a2cacdfa6d4d18176d /libguile/array-handle.c
parent4e766795b2412f42a9c71441e6cc0b36d8a4c5dc (diff)
downloadguile-85ac9cce0aa0d50274377244cf73c8776fb36db6.tar.gz
Reuse SCM_BYTEVECTOR_TYPED_LENGTH in scm_array_get_handle
* libguile/bytevectors.h (SCM_BYTEVECTOR_TYPE_SIZE, SCM_BYTEVECTOR_TYPED_LENGTH): Moved from libguile/bytevectors.c. * libguile/array-handle.c (scm_array_get_handle): Reuse SCM_BYTEVECTOR_TYPED_LENGTH.
Diffstat (limited to 'libguile/array-handle.c')
-rw-r--r--libguile/array-handle.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libguile/array-handle.c b/libguile/array-handle.c
index 2252ecc9a..3595266ff 100644
--- a/libguile/array-handle.c
+++ b/libguile/array-handle.c
@@ -185,15 +185,13 @@ scm_array_get_handle (SCM array, scm_t_array_handle *h)
break;
case scm_tc7_bytevector:
{
- size_t byte_length, length, element_byte_size;
+ size_t length;
scm_t_array_element_type element_type;
scm_t_vector_ref vref;
scm_t_vector_set vset;
- byte_length = scm_c_bytevector_length (array);
element_type = SCM_BYTEVECTOR_ELEMENT_TYPE (array);
- element_byte_size = scm_i_array_element_type_sizes[element_type] / 8;
- length = byte_length / element_byte_size;
+ length = SCM_BYTEVECTOR_TYPED_LENGTH (array);
switch (element_type)
{