summaryrefslogtreecommitdiff
path: root/libguile/srfi-4.i.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2004-10-29 14:06:02 +0000
committerMarius Vollmer <mvo@zagadka.de>2004-10-29 14:06:02 +0000
commitd2759570acd40f7181b4f890986d658e2c537dcc (patch)
tree365397ec987caf9ba1ad645299e303fd7772bc2f /libguile/srfi-4.i.c
parentbb9f50ae10815abb5cb2cbd596baa9fdc1bcd540 (diff)
downloadguile-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.c6
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);
}