- scm_uniform_vector_elements (uvec, h, lenp, incp); \
- if (h->element_type == ETYPE (TAG)) \
- return ((ctype*)h->writable_elements) + h->base*width; \
- /* otherwise... */ \
- else \
- { \
- size_t sfrom, sto, lfrom, lto; \
- if (h->dims != &h->dim0) \
- { \
- h->dim0 = h->dims[0]; \
- h->dims = &h->dim0; \
- } \
- sfrom = scm_i_array_element_type_sizes [h->element_type]; \
- sto = scm_i_array_element_type_sizes [ETYPE (TAG)]; \
- lfrom = h->dim0.ubnd - h->dim0.lbnd + 1; \
- lto = lfrom * sfrom / sto; \
- if (lto * sto != lfrom * sfrom) \
- { \
- scm_array_handle_release (h); \
- scm_wrong_type_arg (#tag"vector-elements", SCM_ARG1, uvec); \
- } \
- h->dim0.ubnd = h->dim0.lbnd + lto; \
- h->base = h->base * sto / sfrom; \
- h->element_type = ETYPE (TAG); \
- return ((ctype*)h->writable_elements) + h->base*width; \
- } \
+ if (!scm_is_bytevector (uvec) \
+ || (scm_c_bytevector_length (uvec) % width)) \
+ scm_wrong_type_arg_msg (NULL, 0, uvec, #tag "vector"); \
+ scm_array_get_handle (uvec, h); \
+ if (lenp) \
+ *lenp = scm_c_bytevector_length (uvec) / width; \
+ if (incp) \
+ *incp = 1; \
+ return ((ctype *)h->writable_elements); \