diff options
author | Daniel Llorens <daniel.llorens@bluewin.ch> | 2013-04-17 15:12:15 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2014-02-07 15:46:03 +0100 |
commit | b3ceb8bc0e6786e65a3ca58ca6af0205b456ad22 (patch) | |
tree | 9f597a062d384eb8cb79cfcc7319a169394172a7 | |
parent | d9c9aa16e0768788013bcb35bd84f592066088b0 (diff) | |
download | guile-b3ceb8bc0e6786e65a3ca58ca6af0205b456ad22.tar.gz |
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.
-rw-r--r-- | libguile/srfi-4.c | 22 |
1 files changed, 1 insertions, 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"); \ } |