mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
(take_uvec): Make BASE pointer non-const.
(scm_take_u8vector, etc): Likewise. Thanks to Ludovic Courtès!
This commit is contained in:
parent
9d9ce2b576
commit
ab7acbb74e
3 changed files with 14 additions and 14 deletions
|
@ -304,7 +304,7 @@ uvec_assert (int type, SCM obj)
|
|||
}
|
||||
|
||||
static SCM
|
||||
take_uvec (int type, const void *base, size_t len)
|
||||
take_uvec (int type, void *base, size_t len)
|
||||
{
|
||||
SCM_RETURN_NEWSMOB3 (scm_tc16_uvec, type, len, (scm_t_bits) base);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ SCM_API void *scm_uniform_vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_u8vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_u8vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_u8vector (const scm_t_uint8 *data, size_t n);
|
||||
SCM_API SCM scm_take_u8vector (scm_t_uint8 *data, size_t n);
|
||||
SCM_API SCM scm_u8vector (SCM l);
|
||||
SCM_API SCM scm_u8vector_length (SCM uvec);
|
||||
SCM_API SCM scm_u8vector_ref (SCM uvec, SCM index);
|
||||
|
@ -76,7 +76,7 @@ SCM_API scm_t_uint8 *scm_u8vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_s8vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_s8vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_s8vector (const scm_t_int8 *data, size_t n);
|
||||
SCM_API SCM scm_take_s8vector (scm_t_int8 *data, size_t n);
|
||||
SCM_API SCM scm_s8vector (SCM l);
|
||||
SCM_API SCM scm_s8vector_length (SCM uvec);
|
||||
SCM_API SCM scm_s8vector_ref (SCM uvec, SCM index);
|
||||
|
@ -96,7 +96,7 @@ SCM_API scm_t_int8 *scm_s8vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_u16vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_u16vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_u16vector (const scm_t_uint16 *data, size_t n);
|
||||
SCM_API SCM scm_take_u16vector (scm_t_uint16 *data, size_t n);
|
||||
SCM_API SCM scm_u16vector (SCM l);
|
||||
SCM_API SCM scm_u16vector_length (SCM uvec);
|
||||
SCM_API SCM scm_u16vector_ref (SCM uvec, SCM index);
|
||||
|
@ -117,7 +117,7 @@ SCM_API scm_t_uint16 *scm_u16vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_s16vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_s16vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_s16vector (const scm_t_int16 *data, size_t n);
|
||||
SCM_API SCM scm_take_s16vector (scm_t_int16 *data, size_t n);
|
||||
SCM_API SCM scm_s16vector (SCM l);
|
||||
SCM_API SCM scm_s16vector_length (SCM uvec);
|
||||
SCM_API SCM scm_s16vector_ref (SCM uvec, SCM index);
|
||||
|
@ -137,7 +137,7 @@ SCM_API scm_t_int16 *scm_s16vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_u32vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_u32vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_u32vector (const scm_t_uint32 *data, size_t n);
|
||||
SCM_API SCM scm_take_u32vector (scm_t_uint32 *data, size_t n);
|
||||
SCM_API SCM scm_u32vector (SCM l);
|
||||
SCM_API SCM scm_u32vector_length (SCM uvec);
|
||||
SCM_API SCM scm_u32vector_ref (SCM uvec, SCM index);
|
||||
|
@ -158,7 +158,7 @@ SCM_API scm_t_uint32 *scm_u32vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_s32vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_s32vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_s32vector (const scm_t_int32 *data, size_t n);
|
||||
SCM_API SCM scm_take_s32vector (scm_t_int32 *data, size_t n);
|
||||
SCM_API SCM scm_s32vector (SCM l);
|
||||
SCM_API SCM scm_s32vector_length (SCM uvec);
|
||||
SCM_API SCM scm_s32vector_ref (SCM uvec, SCM index);
|
||||
|
@ -187,7 +187,7 @@ SCM_API SCM scm_list_to_u64vector (SCM l);
|
|||
SCM_API SCM scm_any_to_u64vector (SCM obj);
|
||||
|
||||
#if SCM_HAVE_T_UINT64
|
||||
SCM_API SCM scm_take_u64vector (const scm_t_uint64 *data, size_t n);
|
||||
SCM_API SCM scm_take_u64vector (scm_t_uint64 *data, size_t n);
|
||||
SCM_API const scm_t_uint64 *scm_array_handle_u64_elements (scm_t_array_handle *h);
|
||||
SCM_API scm_t_uint64 *scm_array_handle_u64_writable_elements (scm_t_array_handle *h);
|
||||
SCM_API const scm_t_uint64 *scm_u64vector_elements (SCM uvec,
|
||||
|
@ -211,7 +211,7 @@ SCM_API SCM scm_list_to_s64vector (SCM l);
|
|||
SCM_API SCM scm_any_to_s64vector (SCM obj);
|
||||
|
||||
#if SCM_HAVE_T_INT64
|
||||
SCM_API SCM scm_take_s64vector (const scm_t_int64 *data, size_t n);
|
||||
SCM_API SCM scm_take_s64vector (scm_t_int64 *data, size_t n);
|
||||
SCM_API const scm_t_int64 *scm_array_handle_s64_elements (scm_t_array_handle *h);
|
||||
SCM_API scm_t_int64 *scm_array_handle_s64_writable_elements (scm_t_array_handle *h);
|
||||
SCM_API const scm_t_int64 *scm_s64vector_elements (SCM uvec,
|
||||
|
@ -225,7 +225,7 @@ SCM_API scm_t_int64 *scm_s64vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_f32vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_f32vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_f32vector (const float *data, size_t n);
|
||||
SCM_API SCM scm_take_f32vector (float *data, size_t n);
|
||||
SCM_API SCM scm_f32vector (SCM l);
|
||||
SCM_API SCM scm_f32vector_length (SCM uvec);
|
||||
SCM_API SCM scm_f32vector_ref (SCM uvec, SCM index);
|
||||
|
@ -245,7 +245,7 @@ SCM_API float *scm_f32vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_f64vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_f64vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_f64vector (const double *data, size_t n);
|
||||
SCM_API SCM scm_take_f64vector (double *data, size_t n);
|
||||
SCM_API SCM scm_f64vector (SCM l);
|
||||
SCM_API SCM scm_f64vector_length (SCM uvec);
|
||||
SCM_API SCM scm_f64vector_ref (SCM uvec, SCM index);
|
||||
|
@ -265,7 +265,7 @@ SCM_API double *scm_f64vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_c32vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_c32vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_c32vector (const float *data, size_t n);
|
||||
SCM_API SCM scm_take_c32vector (float *data, size_t n);
|
||||
SCM_API SCM scm_c32vector (SCM l);
|
||||
SCM_API SCM scm_c32vector_length (SCM uvec);
|
||||
SCM_API SCM scm_c32vector_ref (SCM uvec, SCM index);
|
||||
|
@ -285,7 +285,7 @@ SCM_API float *scm_c32vector_writable_elements (SCM uvec,
|
|||
|
||||
SCM_API SCM scm_c64vector_p (SCM obj);
|
||||
SCM_API SCM scm_make_c64vector (SCM n, SCM fill);
|
||||
SCM_API SCM scm_take_c64vector (const double *data, size_t n);
|
||||
SCM_API SCM scm_take_c64vector (double *data, size_t n);
|
||||
SCM_API SCM scm_c64vector (SCM l);
|
||||
SCM_API SCM scm_c64vector_length (SCM uvec);
|
||||
SCM_API SCM scm_c64vector_ref (SCM uvec, SCM index);
|
||||
|
|
|
@ -135,7 +135,7 @@ SCM_DEFINE (F(scm_any_to_,TAG,vector), "any->"S(TAG)"vector", 1, 0, 0,
|
|||
#ifdef CTYPE
|
||||
|
||||
SCM
|
||||
F(scm_take_,TAG,vector) (const CTYPE *data, size_t n)
|
||||
F(scm_take_,TAG,vector) (CTYPE *data, size_t n)
|
||||
{
|
||||
scm_gc_register_collectable_memory ((void *)data, n*uvec_sizes[TYPE],
|
||||
uvec_names[TYPE]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue