[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 16/27: Pull generalized-vectors from under bitvector/str
From: |
Daniel Llorens |
Subject: |
[Guile-commits] 16/27: Pull generalized-vectors from under bitvector/string/vector |
Date: |
Wed, 8 Apr 2020 04:03:51 -0400 (EDT) |
lloda pushed a commit to branch wip-vector-cleanup
in repository guile.
commit 2d40bda5e9659ac5d305f5dc78752a496fe6520c
Author: Daniel Llorens <address@hidden>
AuthorDate: Thu Feb 6 15:18:14 2020 +0100
Pull generalized-vectors from under bitvector/string/vector
* libguile/generalized-vectors.c: Collect the register array type functions
here.
* libguile/strings.c: Remove array registry code. Fix includes.
* libguile/vectors.c: Remove array registry code. Fix includes.
* libguile/bitvectors.c: Remove array registry code. Fix includes.
---
libguile/bitvectors.c | 14 ++++++--------
libguile/generalized-vectors.c | 10 +++++++++-
libguile/srfi-4.h | 2 ++
libguile/strings.c | 3 ---
libguile/vectors.c | 7 -------
5 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/libguile/bitvectors.c b/libguile/bitvectors.c
index 9ae410d..3b305fe 100644
--- a/libguile/bitvectors.c
+++ b/libguile/bitvectors.c
@@ -25,21 +25,21 @@
#endif
#include <string.h>
+#include <stdbool.h>
-#include "array-handle.h"
-#include "arrays.h"
#include "boolean.h"
-#include "generalized-vectors.h"
#include "gsubr.h"
#include "list.h"
#include "numbers.h"
#include "pairs.h"
#include "ports.h"
-#include "srfi-4.h"
-#include <stdbool.h>
-
#include "bitvectors.h"
+/* FIXME move functions using these (operating on rank-1 bit arrays, not
+ bitvectors) to a separate source file
+*/
+#include "arrays.h"
+#include "srfi-4.h"
/* Bit vectors. Would be nice if they were implemented on top of bytevectors,
* but alack, all we have is this crufty C.
@@ -756,8 +756,6 @@ scm_istr2bve (SCM str)
return res;
}
-SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_BIT, scm_make_bitvector)
-
void
scm_init_bitvectors ()
{
diff --git a/libguile/generalized-vectors.c b/libguile/generalized-vectors.c
index b7516a3..68c1d23 100644
--- a/libguile/generalized-vectors.c
+++ b/libguile/generalized-vectors.c
@@ -28,7 +28,10 @@
#include "gsubr.h"
#include "generalized-vectors.h"
-
+#include "array-handle.h"
+#include "vectors.h"
+#include "bitvectors.h"
+#include "strings.h"
struct scm_t_vector_ctor
{
@@ -67,6 +70,11 @@ SCM_DEFINE (scm_make_generalized_vector,
"make-generalized-vector", 2, 1, 0,
}
#undef FUNC_NAME
+
+SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_SCM, scm_make_vector)
+SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_BIT, scm_make_bitvector)
+SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_CHAR, scm_make_string)
+
void
scm_init_generalized_vectors ()
{
diff --git a/libguile/srfi-4.h b/libguile/srfi-4.h
index b519dfc..6ce5900 100644
--- a/libguile/srfi-4.h
+++ b/libguile/srfi-4.h
@@ -22,6 +22,8 @@
<https://www.gnu.org/licenses/>. */
+/* FIXME move array-handle functions to array-handle.[hc] */
+
#include "libguile/array-handle.h"
SCM_API SCM scm_make_srfi_4_vector (SCM type, SCM len, SCM fill);
diff --git a/libguile/strings.c b/libguile/strings.c
index aab1044..00f2141 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -37,7 +37,6 @@
#include "chars.h"
#include "deprecation.h"
#include "error.h"
-#include "generalized-vectors.h"
#include "gsubr.h"
#include "numbers.h"
#include "pairs.h"
@@ -2493,8 +2492,6 @@ scm_i_get_substring_spec (size_t len,
*cend = scm_to_unsigned_integer (end, *cstart, len);
}
-SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_CHAR, scm_make_string)
-
void
scm_init_strings ()
{
diff --git a/libguile/vectors.c b/libguile/vectors.c
index 9093e6b..add267c 100644
--- a/libguile/vectors.c
+++ b/libguile/vectors.c
@@ -34,10 +34,6 @@
#include "vectors.h"
#include <string.h>
-// You're next
-#include "array-handle.h"
-#include "generalized-vectors.h"
-
#define VECTOR_MAX_LENGTH (SCM_T_BITS_MAX >> 8)
@@ -429,9 +425,6 @@ SCM_DEFINE (scm_vector_move_right_x, "vector-move-right!",
5, 0, 0,
}
#undef FUNC_NAME
-
-SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_SCM, scm_make_vector)
-
void
scm_init_vectors ()
{
- [Guile-commits] 04/27: Remove the unused argument from scm_array_p, (continued)
- [Guile-commits] 04/27: Remove the unused argument from scm_array_p, Daniel Llorens, 2020/04/08
- [Guile-commits] 06/27: Simplify interfaces to scm_vector_elements and scm_vector_writable_elements, Daniel Llorens, 2020/04/08
- [Guile-commits] 09/27: Simplify interfaces to scm_TYPEvector_(writable_)elements, Daniel Llorens, 2020/04/08
- [Guile-commits] 10/27: Add lenp parameter back to scm_vector_(writable_)elements, Daniel Llorens, 2020/04/08
- [Guile-commits] 11/27: Add lenp parameter back to scm_bitvector_(writable_)elements, Daniel Llorens, 2020/04/08
- [Guile-commits] 07/27: Simplify interfaces to scm_bitvector_elements and scm_bitvector_writable_elements, Daniel Llorens, 2020/04/08
- [Guile-commits] 12/27: Remove generalized vector support for vector-move-right!, vector-move-left!, Daniel Llorens, 2020/04/08
- [Guile-commits] 13/27: Move bitvector functions using array_handle to libguile/array-handle.[ch], Daniel Llorens, 2020/04/08
- [Guile-commits] 15/27: Rewrite vector-copy! using memmove, Daniel Llorens, 2020/04/08
- [Guile-commits] 14/27: Golf in srfi-4.h, Daniel Llorens, 2020/04/08
- [Guile-commits] 16/27: Pull generalized-vectors from under bitvector/string/vector,
Daniel Llorens <=
- [Guile-commits] 17/27: Pull generalized-vectors from under typed vectors, Daniel Llorens, 2020/04/08
- [Guile-commits] 20/27: Update branch news file, Daniel Llorens, 2020/04/08
- [Guile-commits] 19/27: Remove generalized-vectors.[hc], Daniel Llorens, 2020/04/08
- [Guile-commits] 25/27: Remove superfluous type check in bitvector->list, Daniel Llorens, 2020/04/08
- [Guile-commits] 27/27: Reuse SCM_ASSERT_RANGE in scm_c_vector_ref, scm_c_vector_set_x, Daniel Llorens, 2020/04/08
- [Guile-commits] 21/27: Merge generalized-arrays.[ch] in arrays.[ch], Daniel Llorens, 2020/04/08
- [Guile-commits] 05/27: Simple vectors are just vectors, Daniel Llorens, 2020/04/08
- [Guile-commits] 23/27: Remove 'contiguous' flag in arrays, Daniel Llorens, 2020/04/08
- [Guile-commits] 22/27: Remove scm_from_contiguous_typed_array, Daniel Llorens, 2020/04/08
- [Guile-commits] 18/27: Pull generalized-vectors from under bytevectors, Daniel Llorens, 2020/04/08