diff options
author | Daniel Llorens <daniel.llorens@bluewin.ch> | 2013-04-11 18:11:35 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2014-01-27 21:45:17 +0100 |
commit | 70a63479ad8498a1cac085247361b3b5ebd8ea06 (patch) | |
tree | e729abed4a67ec6530c0e86025e5ae9dd60b2cb8 /libguile/filesys.c | |
parent | 413c7156795cedb453ebf68c3dd6fd376a64a12b (diff) | |
download | guile-70a63479ad8498a1cac085247361b3b5ebd8ea06.tar.gz |
Identify scm_is_vector with scm_is_simple_vector
This patch fixes the bug (vector-ref #1@1(1 2 3) 1) => 2.
* libguile/vectors.c: (scm_is_vector): just as scm_is_simple_vector.
* libguile/filesys.c, libguile/random.c, libguile/stime.c, libguile/trees.c,
libguile/validate.h: use scm_is_vector instead of scm_is_simple_vector.
* libguile/sort.c
- scm_restricted_vector_sort_x: use scm_array_handle_writable_elements
instead of scm_vector_writable_elements, to work with non-vector
rank-1 array objects.
- scm_sort_x: check for scm_is_array instead of scm_is_vector. Rank
check is in restricted_vector_sort_x.
- scm_sort: ditto.
- scm_stable_sort_x: like scm_restricted_vector_sort_x.
- scm_stable_sort: like scm_sort.
* test-suite/tests/arrays.test: fix header.
* test-suite/tests/random.test: new coverage test covering
random:normal-vector!
* test-suite/Makefile.am: include random.test in make check.
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r-- | libguile/filesys.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c index 8597f9096..aa3e67165 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -694,7 +694,7 @@ fill_select_type (fd_set *set, SCM *ports_ready, SCM list_or_vec, int pos) { int max_fd = 0; - if (scm_is_simple_vector (list_or_vec)) + if (scm_is_vector (list_or_vec)) { int i = SCM_SIMPLE_VECTOR_LENGTH (list_or_vec); @@ -755,7 +755,7 @@ retrieve_select_type (fd_set *set, SCM ports_ready, SCM list_or_vec) { SCM answer_list = ports_ready; - if (scm_is_simple_vector (list_or_vec)) + if (scm_is_vector (list_or_vec)) { int i = SCM_SIMPLE_VECTOR_LENGTH (list_or_vec); @@ -824,7 +824,7 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0, SCM write_ports_ready = SCM_EOL; int max_fd; - if (scm_is_simple_vector (reads)) + if (scm_is_vector (reads)) { read_count = SCM_SIMPLE_VECTOR_LENGTH (reads); } @@ -833,7 +833,7 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0, read_count = scm_ilength (reads); SCM_ASSERT (read_count >= 0, reads, SCM_ARG1, FUNC_NAME); } - if (scm_is_simple_vector (writes)) + if (scm_is_vector (writes)) { write_count = SCM_SIMPLE_VECTOR_LENGTH (writes); } @@ -842,7 +842,7 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0, write_count = scm_ilength (writes); SCM_ASSERT (write_count >= 0, writes, SCM_ARG2, FUNC_NAME); } - if (scm_is_simple_vector (excepts)) + if (scm_is_vector (excepts)) { except_count = SCM_SIMPLE_VECTOR_LENGTH (excepts); } |