From f3a1fc5a9ec0cea5dcd6e505bf9a440ee3651891 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 12 Jan 2010 00:20:10 +0100 Subject: [PATCH] fix srfi-4 shared vector access from c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Fix elements/writable_elements for shared vectors. Thanks to Daniel Llorens del Río for the info. --- libguile/srfi-4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libguile/srfi-4.c b/libguile/srfi-4.c index b807046eb..f9572d04d 100644 --- a/libguile/srfi-4.c +++ b/libguile/srfi-4.c @@ -119,13 +119,13 @@ { \ if (h->element_type != ETYPE (TAG)) \ scm_wrong_type_arg_msg (NULL, 0, h->array, #tag "vector"); \ - return h->elements; \ + return ((const ctype*) h->elements) + h->base; \ } \ ctype* scm_array_handle_##tag##_writable_elements (scm_t_array_handle *h) \ { \ if (h->element_type != ETYPE (TAG)) \ scm_wrong_type_arg_msg (NULL, 0, h->array, #tag "vector"); \ - return h->writable_elements; \ + return ((ctype*) h->writable_elements) + h->base; \ } \ const ctype *scm_##tag##vector_elements (SCM uvec, \ scm_t_array_handle *h, \