[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/16: Remove scm_from_contiguous_array
From: |
Daniel Llorens |
Subject: |
[Guile-commits] 02/16: Remove scm_from_contiguous_array |
Date: |
Fri, 13 Nov 2015 14:30:44 +0000 |
lloda pushed a commit to branch lloda-array-support
in repository guile.
commit 0453b9be1b237d6c86ed6c60259e6b476bf9a6d4
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 c7c155c..1f7b8cf 100644
--- a/libguile/arrays.c
+++ b/libguile/arrays.c
@@ -270,41 +270,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 (5adfbef -> fea3974), Daniel Llorens, 2015/11/13
- [Guile-commits] 01/16: Avoid unneeded internal use of array handles, Daniel Llorens, 2015/11/13
- [Guile-commits] 04/16: Reuse SCM_BYTEVECTOR_TYPED_LENGTH in scm_array_get_handle, Daniel Llorens, 2015/11/13
- [Guile-commits] 02/16: Remove scm_from_contiguous_array,
Daniel Llorens <=
- [Guile-commits] 05/16: Compile in C99 mode, Daniel Llorens, 2015/11/13
- [Guile-commits] 06/16: New functions array-from, array-from*, array-set-from!, Daniel Llorens, 2015/11/13
- [Guile-commits] 07/16: Tests & doc for array-from, array-from*, array-set-from!, Daniel Llorens, 2015/11/13
- [Guile-commits] 10/16: Fix compilation of rank 0 typed array literals, Daniel Llorens, 2015/11/13
- [Guile-commits] 09/16: Don't use array handles in scm_c_array_rank, Daniel Llorens, 2015/11/13
- [Guile-commits] 03/16: Unuse array 'contiguous' flag, Daniel Llorens, 2015/11/13
- [Guile-commits] 11/16: Remove deprecated array functions, Daniel Llorens, 2015/11/13
- [Guile-commits] 08/16: Rename array-set-from!, scm_array_set_from_x to array-amend!, scm_array_amend_x, Daniel Llorens, 2015/11/13
- [Guile-commits] 12/16: Speed up for multi-arg cases of scm_ramap functions, Daniel Llorens, 2015/11/13
- [Guile-commits] 13/16: Remove deprecated and unused generalized-vector functions, Daniel Llorens, 2015/11/13