mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-02 15:40:38 +02:00
Deprecate SCM_SIMPLE_VECTOR_REF et al
* libguile/vectors.h: * libguile/deprecated.c: * libguile/deprecated.h (SCM_SIMPLE_VECTOR_LENGTH): (SCM_SIMPLE_VECTOR_REF): (SCM_SIMPLE_VECTOR_SET): Deprecate.
This commit is contained in:
parent
da51198ce8
commit
05e868892b
3 changed files with 35 additions and 6 deletions
|
@ -33,6 +33,7 @@
|
|||
#include "symbols.h"
|
||||
#include "threads.h"
|
||||
#include "variable.h"
|
||||
#include "vectors.h"
|
||||
|
||||
#include "deprecated.h"
|
||||
|
||||
|
@ -738,6 +739,32 @@ scm_regexp_exec (SCM rx, SCM str, SCM start, SCM flags)
|
|||
|
||||
|
||||
|
||||
size_t
|
||||
scm_i_simple_vector_length (SCM v)
|
||||
{
|
||||
scm_c_issue_deprecation_warning
|
||||
("SCM_SIMPLE_VECTOR_LENGTH is deprecated. Use scm_c_vector_length instead.");
|
||||
return scm_c_vector_length (v);
|
||||
}
|
||||
|
||||
SCM
|
||||
scm_i_simple_vector_ref (SCM v, size_t k)
|
||||
{
|
||||
scm_c_issue_deprecation_warning
|
||||
("SCM_SIMPLE_VECTOR_REF is deprecated. Use scm_c_vector_ref instead.");
|
||||
return scm_c_vector_ref (v, k);
|
||||
}
|
||||
|
||||
void
|
||||
scm_i_simple_vector_set_x (SCM v, size_t k, SCM val)
|
||||
{
|
||||
scm_c_issue_deprecation_warning
|
||||
("SCM_SIMPLE_VECTOR_SET is deprecated. Use scm_c_vector_set_x instead.");
|
||||
scm_c_vector_set_x (v, k, val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
scm_i_init_deprecated ()
|
||||
{
|
||||
|
|
|
@ -122,6 +122,14 @@ SCM_DEPRECATED SCM scm_regexp_exec (SCM rx, SCM str, SCM start, SCM flags);
|
|||
|
||||
#define SCM_VALIDATE_PAIR(cell, expr) SCM_VALIDATE_PAIR__Gone__Inline_second_argument_at_use
|
||||
|
||||
SCM_DEPRECATED size_t scm_i_simple_vector_length (SCM v);
|
||||
SCM_DEPRECATED SCM scm_i_simple_vector_ref (SCM v, size_t k);
|
||||
SCM_DEPRECATED void scm_i_simple_vector_set_x (SCM v, size_t k, SCM val);
|
||||
|
||||
#define SCM_SIMPLE_VECTOR_LENGTH(x) (scm_i_simple_vector_length (x))
|
||||
#define SCM_SIMPLE_VECTOR_REF(x,idx) (scm_i_simple_vector_ref (x, idx))
|
||||
#define SCM_SIMPLE_VECTOR_SET(x,idx,val) (scm_i_simple_vector_set_x (x, idx, val))
|
||||
|
||||
/* Deprecated declarations go here. */
|
||||
|
||||
void scm_i_init_deprecated (void);
|
||||
|
|
|
@ -66,12 +66,6 @@ SCM_API SCM *scm_vector_writable_elements (SCM array,
|
|||
SCM_ASSERT (scm_is_vector (v) && len == scm_c_vector_length (v), v, pos, FUNC_NAME); \
|
||||
} while (0)
|
||||
|
||||
/* Fast, non-checking accessors
|
||||
*/
|
||||
#define SCM_SIMPLE_VECTOR_LENGTH(x) SCM_I_VECTOR_LENGTH(x)
|
||||
#define SCM_SIMPLE_VECTOR_REF(x,idx) ((SCM_I_VECTOR_ELTS(x))[idx])
|
||||
#define SCM_SIMPLE_VECTOR_SET(x,idx,val) ((SCM_I_VECTOR_WELTS(x))[idx]=(val))
|
||||
|
||||
|
||||
/* Internals */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue