diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 2001-10-28 11:13:35 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 2001-10-28 11:13:35 +0000 |
commit | d245ce231d1b0eb29c229f4f0ccf148209dd56c4 (patch) | |
tree | a9b3b094f32b975043651e96c720c7ece42ec18a /libguile/unif.c | |
parent | a42b5e5b962686b6961e425e3cd8877f25ddfaf1 (diff) | |
download | guile-d245ce231d1b0eb29c229f4f0ccf148209dd56c4.tar.gz |
* unif.c (scm_uniform_array_read_x, scm_uniform_array_write):
Don't apply scm_uniform_vector_length on arrays.
Diffstat (limited to 'libguile/unif.c')
-rw-r--r-- | libguile/unif.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libguile/unif.c b/libguile/unif.c index 5b2af435c..2ace9239e 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -1511,7 +1511,9 @@ SCM_DEFINE (scm_uniform_array_read_x, "uniform-array-read!", 1, 3, 0, SCM_ASSERT (SCM_INUMP (port_or_fd) || (SCM_OPINPORTP (port_or_fd)), port_or_fd, SCM_ARG2, FUNC_NAME); - vlen = SCM_INUM (scm_uniform_vector_length (v)); + vlen = (SCM_TYP7 (v) == scm_tc7_smob + ? 0 + : SCM_INUM (scm_uniform_vector_length (v))); loop: switch SCM_TYP7 (v) @@ -1675,8 +1677,10 @@ SCM_DEFINE (scm_uniform_array_write, "uniform-array-write", 1, 3, 0, SCM_ASSERT (SCM_INUMP (port_or_fd) || (SCM_OPOUTPORTP (port_or_fd)), port_or_fd, SCM_ARG2, FUNC_NAME); - vlen = SCM_INUM (scm_uniform_vector_length (v)); - + vlen = (SCM_TYP7 (v) == scm_tc7_smob + ? 0 + : SCM_INUM (scm_uniform_vector_length (v))); + loop: switch SCM_TYP7 (v) { @@ -1686,8 +1690,8 @@ loop: SCM_ASRTGO (SCM_ARRAYP (v), badarg1); v = scm_ra2contig (v, 1); cstart = SCM_ARRAY_BASE (v); - vlen = SCM_ARRAY_DIMS (v)->inc - * (SCM_ARRAY_DIMS (v)->ubnd - SCM_ARRAY_DIMS (v)->lbnd + 1); + vlen = (SCM_ARRAY_DIMS (v)->inc + * (SCM_ARRAY_DIMS (v)->ubnd - SCM_ARRAY_DIMS (v)->lbnd + 1)); v = SCM_ARRAY_V (v); goto loop; case scm_tc7_string: |