diff options
author | Andy Wingo <wingo@pobox.com> | 2014-02-08 21:42:53 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2014-02-08 21:46:06 +0100 |
commit | 2b5625ad0c93045d181d6c05eb9b94dc21462f22 (patch) | |
tree | e5063c5d5ea81147af934d588130206164962a7b /libguile/generalized-arrays.c | |
parent | 7070f12b9dc13f3b204acf2bd68c68b26e764990 (diff) | |
download | guile-2b5625ad0c93045d181d6c05eb9b94dc21462f22.tar.gz |
Inline scm_i_array_implementation_for_obj in scm_i_array
* libguile/generalized-arrays.c (scm_is_array, scm_is_typed_array): In
preparation for removing the registry of array implementations, remove
a couple uss of scm_i_array_implementation_for_obj.
Diffstat (limited to 'libguile/generalized-arrays.c')
-rw-r--r-- | libguile/generalized-arrays.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libguile/generalized-arrays.c b/libguile/generalized-arrays.c index 88c1cdeab..9a001eb3c 100644 --- a/libguile/generalized-arrays.c +++ b/libguile/generalized-arrays.c @@ -42,7 +42,20 @@ SCM_INTERNAL SCM scm_i_array_set_x (SCM v, SCM obj, int scm_is_array (SCM obj) { - return scm_i_array_implementation_for_obj (obj) ? 1 : 0; + if (!SCM_HEAP_OBJECT_P (obj)) + return 0; + + switch (SCM_TYP7 (obj)) + { + case scm_tc7_string: + case scm_tc7_vector: + case scm_tc7_bitvector: + case scm_tc7_bytevector: + case scm_tc7_array: + return 1; + default: + return 0; + } } SCM_DEFINE (scm_array_p_2, "array?", 1, 0, 0, @@ -69,7 +82,7 @@ int scm_is_typed_array (SCM obj, SCM type) { int ret = 0; - if (scm_i_array_implementation_for_obj (obj)) + if (scm_is_array (obj)) { scm_t_array_handle h; |