summaryrefslogtreecommitdiff
path: root/libguile/arrays.c
diff options
context:
space:
mode:
authorDaniel Llorens <daniel.llorens@bluewin.ch>2013-04-10 13:48:13 +0200
committerAndy Wingo <wingo@pobox.com>2014-02-06 21:40:38 +0100
commitc2cb82f85ad248eaa3d1d1b3b0149dbbb2510bde (patch)
treee8ee3861b171d47d18f12e9ded542d38f5fff9e2 /libguile/arrays.c
parent1080ce25bca18ef3a999995ab15664c2a10fd974 (diff)
downloadguile-c2cb82f85ad248eaa3d1d1b3b0149dbbb2510bde.tar.gz
Don't use scm_is_generalized_vector in shared-array-root
* libguile/arrays.c: (scm_shared_array_root): replace check for scm_is_generalized_vector.
Diffstat (limited to 'libguile/arrays.c')
-rw-r--r--libguile/arrays.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libguile/arrays.c b/libguile/arrays.c
index 188dba82e..0d39e8eae 100644
--- a/libguile/arrays.c
+++ b/libguile/arrays.c
@@ -60,21 +60,22 @@
(SCM_SET_CELL_WORD_0 ((x), SCM_CELL_WORD_0 (x) & ~(SCM_I_ARRAY_FLAG_CONTIGUOUS << 16)))
-SCM_DEFINE (scm_shared_array_root, "shared-array-root", 1, 0, 0,
+SCM_DEFINE (scm_shared_array_root, "shared-array-root", 1, 0, 0,
(SCM ra),
"Return the root vector of a shared array.")
#define FUNC_NAME s_scm_shared_array_root
{
- if (SCM_I_ARRAYP (ra))
+ if (!scm_is_array (ra))
+ scm_wrong_type_arg_msg (FUNC_NAME, SCM_ARG1, ra, "array");
+ else if (SCM_I_ARRAYP (ra))
return SCM_I_ARRAY_V (ra);
- else if (scm_is_generalized_vector (ra))
+ else
return ra;
- scm_wrong_type_arg_msg (FUNC_NAME, SCM_ARG1, ra, "array");
}
#undef FUNC_NAME
-SCM_DEFINE (scm_shared_array_offset, "shared-array-offset", 1, 0, 0,
+SCM_DEFINE (scm_shared_array_offset, "shared-array-offset", 1, 0, 0,
(SCM ra),
"Return the root vector index of the first element in the array.")
#define FUNC_NAME s_scm_shared_array_offset