diff options
author | Marius Vollmer <mvo@zagadka.de> | 2004-10-29 14:06:02 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2004-10-29 14:06:02 +0000 |
commit | d2759570acd40f7181b4f890986d658e2c537dcc (patch) | |
tree | 365397ec987caf9ba1ad645299e303fd7772bc2f /libguile/srfi-4.i.c | |
parent | bb9f50ae10815abb5cb2cbd596baa9fdc1bcd540 (diff) | |
download | guile-d2759570acd40f7181b4f890986d658e2c537dcc.tar.gz |
(scm_take_u8vector, etc): use uvec_sizes instead of
sizeof(CTYPE) as explained in the comment.
Diffstat (limited to 'libguile/srfi-4.i.c')
-rw-r--r-- | libguile/srfi-4.i.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libguile/srfi-4.i.c b/libguile/srfi-4.i.c index 1df4c3651..ca181a1df 100644 --- a/libguile/srfi-4.i.c +++ b/libguile/srfi-4.i.c @@ -18,7 +18,9 @@ - CTYPE - The C type of the elements, for example scm_t_uint8. + The C type of the elements, for example scm_t_uint8. The code + below will never do sizeof (CTYPE), thus you can use just 'float' + for the c32 type, for example. */ /* The first level does not expand macros in the arguments. */ @@ -56,7 +58,7 @@ SCM_DEFINE (F(scm_make_,TAG,vector), "make-"S(TAG)"vector", 1, 1, 0, SCM F(scm_take_,TAG,vector) (const CTYPE *data, size_t n) { - scm_gc_register_collectable_memory ((void *)data, n*sizeof(CTYPE), + scm_gc_register_collectable_memory ((void *)data, n*uvec_sizes[TYPE], uvec_names[TYPE]); return take_uvec (TYPE, data, n); } |