summaryrefslogtreecommitdiff
path: root/libguile/deprecated.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-04-21 22:35:00 +0200
committerAndy Wingo <wingo@pobox.com>2020-04-29 11:14:17 +0200
commitb517a91ba4aaccf920a81eb8bf71ca090a9b457c (patch)
tree87766f92c0bf33de3a4ca4c4e6afa177f7cd8e72 /libguile/deprecated.c
parentbfd38b857757c767c1b94762aeb35db112c4f76b (diff)
downloadguile-b517a91ba4aaccf920a81eb8bf71ca090a9b457c.tar.gz
Deprecate useless C bitvector interface
C should use scm_c_bitvector_length, not scm_bitvector_length. * doc/ref/api-data.texi (Bit Vectors): Reorganize a bit to put typed C interfaces in their own section. * libguile/bitvectors.h: * libguile/bitvectors.c (bitvector-length, bitvector-count): Make SCM-flavored C interface private. (scm_c_bitvector_count): New function. * libguile/deprecated.c (scm_bitvector_length): Deprecate. (scm_bit_count): Adapt to changes.
Diffstat (limited to 'libguile/deprecated.c')
-rw-r--r--libguile/deprecated.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libguile/deprecated.c b/libguile/deprecated.c
index 861ade56a..1a480ecb1 100644
--- a/libguile/deprecated.c
+++ b/libguile/deprecated.c
@@ -89,6 +89,16 @@ scm_find_executable (const char *name)
SCM
+scm_bitvector_length (SCM vec)
+{
+ scm_c_issue_deprecation_warning
+ ("scm_bitvector_length is deprecated. Use scm_c_bitvector_length "
+ "instead.");
+
+ return scm_from_size_t (scm_c_bitvector_length (vec));
+}
+
+SCM
scm_c_bitvector_ref (SCM vec, size_t idx)
{
scm_c_issue_deprecation_warning
@@ -251,7 +261,7 @@ SCM_DEFINE (scm_bit_count, "bit-count", 2, 0, 0,
if (scm_is_bitvector (bitvector))
{
len = scm_to_size_t (scm_bitvector_length (bitvector));
- count = scm_to_size_t (scm_bitvector_count (bitvector));
+ count = scm_c_bitvector_count (bitvector);
}
else
{
@@ -309,7 +319,7 @@ SCM_DEFINE (scm_bit_count_star, "bit-count*", 3, 0, 0,
{
count = scm_c_bitvector_count_bits (v, kv);
if (count == 0)
- count = scm_to_size_t (scm_bitvector_count (kv)) - count;
+ count = scm_c_bitvector_count (kv) - count;
}
else
{