[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/12: Remove scm_from_contiguous_array
From: |
Daniel Llorens |
Subject: |
[Guile-commits] 02/12: Remove scm_from_contiguous_array |
Date: |
Mon, 16 Feb 2015 08:12:36 +0000 |
lloda pushed a commit to branch lloda-array-support
in repository guile.
commit 32a6283e08e54e4be60f686759415bdf7174214a
Author: Daniel Llorens <address@hidden>
Date: Mon Feb 9 17:27:33 2015 +0100
Remove scm_from_contiguous_array
This function is undocumented, unused within Guile, and can be trivially
replaced by make-array + array-copy without requiring contiguity.
* libguile/arrays.h (scm_from_contiguous_array): remove declaration.
* libguile/arrays.c (scm_from_contiguous_array): remove.
---
libguile/arrays.c | 35 -----------------------------------
libguile/arrays.h | 2 --
2 files changed, 0 insertions(+), 37 deletions(-)
diff --git a/libguile/arrays.c b/libguile/arrays.c
index beda494..78e8496 100644
--- a/libguile/arrays.c
+++ b/libguile/arrays.c
@@ -269,41 +269,6 @@ scm_from_contiguous_typed_array (SCM type, SCM bounds,
const void *bytes,
}
#undef FUNC_NAME
-SCM
-scm_from_contiguous_array (SCM bounds, const SCM *elts, size_t len)
-#define FUNC_NAME "scm_from_contiguous_array"
-{
- size_t k, rlen = 1;
- scm_t_array_dim *s;
- SCM ra;
- scm_t_array_handle h;
-
- ra = scm_i_shap2ra (bounds);
- SCM_SET_ARRAY_CONTIGUOUS_FLAG (ra);
- s = SCM_I_ARRAY_DIMS (ra);
- k = SCM_I_ARRAY_NDIM (ra);
-
- while (k--)
- {
- s[k].inc = rlen;
- SCM_ASSERT_RANGE (1, bounds, s[k].lbnd <= s[k].ubnd + 1);
- rlen = (s[k].ubnd - s[k].lbnd + 1) * s[k].inc;
- }
- if (rlen != len)
- SCM_MISC_ERROR ("element length and dimensions do not match", SCM_EOL);
-
- SCM_I_ARRAY_SET_V (ra, scm_c_make_vector (rlen, SCM_UNDEFINED));
- scm_array_get_handle (ra, &h);
- memcpy (h.writable_elements, elts, rlen * sizeof(SCM));
- scm_array_handle_release (&h);
-
- if (1 == SCM_I_ARRAY_NDIM (ra) && 0 == SCM_I_ARRAY_BASE (ra))
- if (0 == s->lbnd)
- return SCM_I_ARRAY_V (ra);
- return ra;
-}
-#undef FUNC_NAME
-
SCM_DEFINE (scm_make_array, "make-array", 1, 0, 1,
(SCM fill, SCM bounds),
"Create and return an array.")
diff --git a/libguile/arrays.h b/libguile/arrays.h
index 5f40597..c486f20 100644
--- a/libguile/arrays.h
+++ b/libguile/arrays.h
@@ -37,8 +37,6 @@
/** Arrays */
SCM_API SCM scm_make_array (SCM fill, SCM bounds);
-SCM_API SCM scm_from_contiguous_array (SCM bounds, const SCM *elts,
- size_t len);
SCM_API SCM scm_make_typed_array (SCM type, SCM fill, SCM bounds);
SCM_API SCM scm_from_contiguous_typed_array (SCM type, SCM bounds,
const void *bytes,
- [Guile-commits] branch lloda-array-support updated (3159664 -> 6590864), Daniel Llorens, 2015/02/16
- [Guile-commits] 01/12: Avoid unneeded internal use of array handles, Daniel Llorens, 2015/02/16
- [Guile-commits] 03/12: Unuse array 'contiguous' flag, Daniel Llorens, 2015/02/16
- [Guile-commits] 02/12: Remove scm_from_contiguous_array,
Daniel Llorens <=
- [Guile-commits] 05/12: Compile in C99 mode, Daniel Llorens, 2015/02/16
- [Guile-commits] 06/12: New functions array-from, array-from*, array-set-from!, Daniel Llorens, 2015/02/16
- [Guile-commits] 04/12: Reuse SCM_BYTEVECTOR_TYPED_LENGTH in scm_array_get_handle, Daniel Llorens, 2015/02/16
- [Guile-commits] 08/12: Rename array-set-from!, scm_array_set_from_x to array-amend!, scm_array_amend_x, Daniel Llorens, 2015/02/16
- [Guile-commits] 07/12: Tests & doc for array-from, array-from*, array-set-from!, Daniel Llorens, 2015/02/16
- [Guile-commits] 09/12: Don't use array handles in scm_c_array_rank, Daniel Llorens, 2015/02/16
- [Guile-commits] 10/12: Fix compilation of rank 0 typed array literals, Daniel Llorens, 2015/02/16
- [Guile-commits] 11/12: Remove deprecated array functions, Daniel Llorens, 2015/02/16
- [Guile-commits] 12/12: Speed up for multi-arg cases of scm_ramap functions, Daniel Llorens, 2015/02/16