1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-25 20:50:31 +02:00

Remove all deprecated interfaces

We're on a new version series, let's remove deprecated things.  Also
reduces the amount of work we need to do in adapting to a new GC,
notably for bignums.

* configure.ac (--disable-tmpnam): Remove flag, tmpnam is gone.
* doc/ref/posix.texi (File System): Remove tmpnam docs.
* libguile/bitvectors.c (scm_bitvector_to_list): Remove deprecated
branch treating arrays as bitvectors.
* libguile/deprecated.c: Remove all deprecated code.  Whee!
* libguile/deprecated.h: Remove deprecated decls.
* libguile/posix.c (scm_tmpnam): Remove.
* libguile/struct.c (scm_is_valid_vtable_layout): Remove support for 'r'
fields.
* libguile/vectors.c (scm_vector_copy_partial, scm_vector_to_list)
(scm_vector_move_left_x, scm_vector_move_right_x): Remove generalized
array cases.
* test-suite/tests/vectors.test ("vector->list"): Remove shared array
test
This commit is contained in:
Andy Wingo 2025-04-30 13:14:58 +02:00
parent dd0e455755
commit 1a3f427d4e
10 changed files with 78 additions and 1221 deletions

View file

@ -1,4 +1,4 @@
/* Copyright 1995-1998,2000-2006,2009-2014,2018,2020
/* Copyright 1995-1998,2000-2006,2009-2014,2018,2020,2025
Free Software Foundation, Inc.
This file is part of Guile.
@ -432,36 +432,17 @@ SCM_DEFINE (scm_bitvector_to_list, "bitvector->list", 1, 0, 0,
{
SCM res = SCM_EOL;
if (IS_BITVECTOR (vec))
VALIDATE_BITVECTOR (1, vec);
const uint32_t *bits = BITVECTOR_BITS (vec);
size_t len = BITVECTOR_LENGTH (vec);
size_t word_len = (len + 31) / 32;
for (size_t i = 0; i < word_len; i++, len -= 32)
{
const uint32_t *bits = BITVECTOR_BITS (vec);
size_t len = BITVECTOR_LENGTH (vec);
size_t word_len = (len + 31) / 32;
for (size_t i = 0; i < word_len; i++, len -= 32)
{
uint32_t mask = 1;
for (size_t j = 0; j < 32 && j < len; j++, mask <<= 1)
res = scm_cons ((bits[i] & mask)? SCM_BOOL_T : SCM_BOOL_F, res);
}
}
else
{
scm_t_array_handle handle;
size_t off, len;
ssize_t inc;
scm_bitvector_elements (vec, &handle, &off, &len, &inc);
scm_c_issue_deprecation_warning
("Using bitvector->list on arrays is deprecated. "
"Use array->list instead.");
for (size_t i = 0; i < len; i++)
res = scm_cons (scm_array_handle_ref (&handle, i*inc), res);
scm_array_handle_release (&handle);
uint32_t mask = 1;
for (size_t j = 0; j < 32 && j < len; j++, mask <<= 1)
res = scm_cons ((bits[i] & mask)? SCM_BOOL_T : SCM_BOOL_F, res);
}
return scm_reverse_x (res, SCM_EOL);