mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
Move bitvector functions using array_handle to libguile/array-handle.[ch]
This commit is contained in:
parent
88d690e15e
commit
efe2317aff
8 changed files with 35 additions and 30 deletions
|
@ -333,6 +333,10 @@ scm_array_handle_release (scm_t_array_handle *h)
|
|||
*/
|
||||
}
|
||||
|
||||
// -----------------------------------------------
|
||||
// scm_array_handle_TYPE_(writable_)elements FIXME
|
||||
// -----------------------------------------------
|
||||
|
||||
const SCM *
|
||||
scm_array_handle_elements (scm_t_array_handle *h)
|
||||
{
|
||||
|
@ -352,9 +356,31 @@ scm_array_handle_writable_elements (scm_t_array_handle *h)
|
|||
}
|
||||
|
||||
// -----------------------------------------------
|
||||
// FIXME adding scm_array1_xxx_(writable_)elements
|
||||
// scm_array1_TYPE_(writable_)elements FIXME
|
||||
// -----------------------------------------------
|
||||
|
||||
const uint32_t *
|
||||
scm_array_handle_bit_elements (scm_t_array_handle *h)
|
||||
{
|
||||
if (h->element_type != SCM_ARRAY_ELEMENT_TYPE_BIT)
|
||||
scm_wrong_type_arg_msg (NULL, 0, h->array, "bit array");
|
||||
return ((const uint32_t *) h->elements) + h->base/32;
|
||||
}
|
||||
|
||||
uint32_t *
|
||||
scm_array_handle_bit_writable_elements (scm_t_array_handle *h)
|
||||
{
|
||||
if (h->writable_elements != h->elements)
|
||||
scm_wrong_type_arg_msg (NULL, 0, h->array, "mutable bit array");
|
||||
return (uint32_t *) scm_array_handle_bit_elements (h);
|
||||
}
|
||||
|
||||
size_t
|
||||
scm_array_handle_bit_elements_offset (scm_t_array_handle *h)
|
||||
{
|
||||
return h->base % 32;
|
||||
}
|
||||
|
||||
const uint32_t *
|
||||
scm_array1_bit_elements (SCM vec, size_t *lenp, ssize_t *incp, size_t *offp)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue