1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

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.
This commit is contained in:
Andy Wingo 2020-04-21 22:35:00 +02:00
parent bfd38b8577
commit b517a91ba4
5 changed files with 37 additions and 24 deletions

View file

@ -88,6 +88,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)
{
@ -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
{