From 95cd688421175870b22f71409fb4ef24124d68d0 Mon Sep 17 00:00:00 2001 From: Daniel Llorens Date: Wed, 17 Apr 2013 15:12:15 +0200 Subject: [PATCH] Remove undocumented casting behavior in srfi4 vector_elements * libguile/srfi-4.c: scm_##tag##vector_writable_elements: if the argument's type doesn't match the tag, throw type error. --- libguile/srfi-4.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/libguile/srfi-4.c b/libguile/srfi-4.c index 2491284bc..c98681b18 100644 --- a/libguile/srfi-4.c +++ b/libguile/srfi-4.c @@ -142,27 +142,7 @@ 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; \ - } \ + scm_wrong_type_arg_msg (NULL, 0, h->array, #tag "vector"); \ }