1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

Turn all deprecated features that once were macros but are now

functions back into macros.
This commit is contained in:
Marius Vollmer 2005-01-12 11:10:02 +00:00
parent 8f3054016a
commit fe78c51aa2
4 changed files with 76 additions and 48 deletions

View file

@ -1108,7 +1108,7 @@ SCM_DEFINE (scm_gentemp, "gentemp", 0, 2, 0,
#undef FUNC_NAME
SCM
SCM_MAKINUM (scm_t_signed_bits val)
scm_i_makinum (scm_t_signed_bits val)
{
scm_c_issue_deprecation_warning
("SCM_MAKINUM is deprecated. Use scm_from_int or similar instead.");
@ -1116,7 +1116,7 @@ SCM_MAKINUM (scm_t_signed_bits val)
}
int
SCM_INUMP (SCM obj)
scm_i_inump (SCM obj)
{
scm_c_issue_deprecation_warning
("SCM_INUMP is deprecated. Use scm_is_integer or similar instead.");
@ -1124,7 +1124,7 @@ SCM_INUMP (SCM obj)
}
scm_t_signed_bits
SCM_INUM (SCM obj)
scm_i_inum (SCM obj)
{
scm_c_issue_deprecation_warning
("SCM_INUM is deprecated. Use scm_to_int or similar instead.");
@ -1205,7 +1205,7 @@ scm_round (double x)
}
char *
SCM_SYMBOL_CHARS (SCM sym)
scm_i_deprecated_symbol_chars (SCM sym)
{
scm_c_issue_deprecation_warning
("SCM_SYMBOL_CHARS is deprecated. Use scm_symbol_to_string.");
@ -1214,7 +1214,7 @@ SCM_SYMBOL_CHARS (SCM sym)
}
size_t
SCM_SYMBOL_LENGTH (SCM sym)
scm_i_deprecated_symbol_length (SCM sym)
{
scm_c_issue_deprecation_warning
("SCM_SYMBOL_LENGTH is deprecated. Use scm_symbol_to_string.");
@ -1222,7 +1222,7 @@ SCM_SYMBOL_LENGTH (SCM sym)
}
int
SCM_KEYWORDP (SCM obj)
scm_i_keywordp (SCM obj)
{
scm_c_issue_deprecation_warning
("SCM_KEYWORDP is deprecated. Use scm_is_keyword instead.");
@ -1230,7 +1230,7 @@ SCM_KEYWORDP (SCM obj)
}
SCM
SCM_KEYWORDSYM (SCM keyword)
scm_i_keywordsym (SCM keyword)
{
scm_c_issue_deprecation_warning
("SCM_KEYWORDSYM is deprecated. See scm_keyword_to_symbol instead.");
@ -1238,7 +1238,7 @@ SCM_KEYWORDSYM (SCM keyword)
}
int
SCM_VECTORP (SCM x)
scm_i_vectorp (SCM x)
{
scm_c_issue_deprecation_warning
("SCM_VECTORP is deprecated. Use scm_is_vector instead.");
@ -1246,7 +1246,7 @@ SCM_VECTORP (SCM x)
}
unsigned long
SCM_VECTOR_LENGTH (SCM x)
scm_i_vector_length (SCM x)
{
scm_c_issue_deprecation_warning
("SCM_VECTOR_LENGTH is deprecated. Use scm_c_vector_length instead.");
@ -1254,7 +1254,7 @@ SCM_VECTOR_LENGTH (SCM x)
}
const SCM *
SCM_VELTS (SCM x)
scm_i_velts (SCM x)
{
scm_c_issue_deprecation_warning
("SCM_VELTS is deprecated. Use scm_vector_elements instead.");
@ -1262,7 +1262,7 @@ SCM_VELTS (SCM x)
}
SCM *
SCM_WRITABLE_VELTS (SCM x)
scm_i_writable_velts (SCM x)
{
scm_c_issue_deprecation_warning
("SCM_WRITABLE_VELTS is deprecated. "
@ -1271,7 +1271,7 @@ SCM_WRITABLE_VELTS (SCM x)
}
SCM
SCM_VECTOR_REF (SCM x, size_t idx)
scm_i_vector_ref (SCM x, size_t idx)
{
scm_c_issue_deprecation_warning
("SCM_VECTOR_REF is deprecated. "
@ -1280,7 +1280,7 @@ SCM_VECTOR_REF (SCM x, size_t idx)
}
void
SCM_VECTOR_SET (SCM x, size_t idx, SCM val)
scm_i_vector_set (SCM x, size_t idx, SCM val)
{
scm_c_issue_deprecation_warning
("SCM_VECTOR_SET is deprecated. "
@ -1298,7 +1298,7 @@ scm_vector_equal_p (SCM x, SCM y)
}
int
SCM_ARRAYP (SCM a)
scm_i_arrayp (SCM a)
{
scm_c_issue_deprecation_warning
("SCM_ARRAYP is deprecated. Use scm_is_array instead.");
@ -1306,7 +1306,7 @@ SCM_ARRAYP (SCM a)
}
size_t
SCM_ARRAY_NDIM (SCM a)
scm_i_array_ndim (SCM a)
{
scm_c_issue_deprecation_warning
("SCM_ARRAY_NDIM is deprecated. "
@ -1315,7 +1315,7 @@ SCM_ARRAY_NDIM (SCM a)
}
int
SCM_ARRAY_CONTP (SCM a)
scm_i_array_contp (SCM a)
{
scm_c_issue_deprecation_warning
("SCM_ARRAY_CONTP is deprecated. Do not use it.");
@ -1323,7 +1323,7 @@ SCM_ARRAY_CONTP (SCM a)
}
scm_t_array *
SCM_ARRAY_MEM (SCM a)
scm_i_array_mem (SCM a)
{
scm_c_issue_deprecation_warning
("SCM_ARRAY_MEM is deprecated. Do not use it.");
@ -1331,7 +1331,7 @@ SCM_ARRAY_MEM (SCM a)
}
SCM
SCM_ARRAY_V (SCM a)
scm_i_array_v (SCM a)
{
/* We could use scm_shared_array_root here, but it is better to move
them away from expecting vectors as the basic storage for arrays.
@ -1342,7 +1342,7 @@ SCM_ARRAY_V (SCM a)
}
size_t
SCM_ARRAY_BASE (SCM a)
scm_i_array_base (SCM a)
{
scm_c_issue_deprecation_warning
("SCM_ARRAY_BASE is deprecated. Do not use it.");
@ -1350,7 +1350,7 @@ SCM_ARRAY_BASE (SCM a)
}
scm_t_array_dim *
SCM_ARRAY_DIMS (SCM a)
scm_i_array_dims (SCM a)
{
scm_c_issue_deprecation_warning
("SCM_ARRAY_DIMS is deprecated. Use scm_array_handle_dims instead.");

View file

@ -308,10 +308,14 @@ SCM_API SCM scm_gentemp (SCM prefix, SCM obarray);
/* Users shouldn't know about INUMs.
*/
SCM_API SCM SCM_MAKINUM (scm_t_signed_bits val);
SCM_API int SCM_INUMP (SCM obj);
#define SCM_NINUMP(x) (!SCM_INUMP(x))
SCM_API scm_t_signed_bits SCM_INUM (SCM obj);
SCM_API SCM scm_i_makinum (scm_t_signed_bits val);
SCM_API int scm_i_inump (SCM obj);
SCM_API scm_t_signed_bits scm_i_inum (SCM obj);
#define SCM_MAKINUM(x) scm_i_makinum(x)
#define SCM_INUM(x) scm_i_inum(x)
#define SCM_INUMP(x) scm_i_inump(x)
#define SCM_NINUMP(x) (!SCM_INUMP(x))
#define SCM_VALIDATE_INUM(pos, k) SCM_MAKE_VALIDATE_MSG (pos, k, INUMP, "exact integer")
@ -453,39 +457,59 @@ SCM_API double scm_round (double x);
symbols directly.
*/
SCM_API char *SCM_SYMBOL_CHARS (SCM sym);
SCM_API size_t SCM_SYMBOL_LENGTH (SCM sym);
SCM_API char *scm_i_deprecated_symbol_chars (SCM sym);
SCM_API size_t scm_i_deprecated_symbol_length (SCM sym);
#define SCM_SYMBOL_CHARS(x) scm_i_deprecated_symbol_chars(x)
#define SCM_SYMBOL_LENGTH(x) scm_i_deprecated_symbol_length(x)
/* Deprecated because the macros used to evaluate the arguments more
than once and because the symbol of a keyword now has no dash.
*/
SCM_API int SCM_KEYWORDP (SCM obj);
SCM_API SCM SCM_KEYWORDSYM (SCM keyword);
SCM_API int scm_i_keywordp (SCM obj);
SCM_API SCM scm_i_keywordsym (SCM keyword);
#define SCM_KEYWORDP(x) scm_i_keywordp(x)
#define SCM_KEYWORDSYM(x) scm_i_keywordsym(x)
/* Deprecated because we don't want to hand out unprotected pointers
to arrays, vectors, etc. */
#define SCM_VECTOR_MAX_LENGTH ((1L << 24) - 1)
SCM_API int SCM_VECTORP (SCM x);
SCM_API unsigned long SCM_VECTOR_LENGTH (SCM x);
SCM_API const SCM *SCM_VELTS (SCM x);
SCM_API SCM *SCM_WRITABLE_VELTS (SCM x);
SCM_API SCM SCM_VECTOR_REF (SCM x, size_t idx);
SCM_API void SCM_VECTOR_SET (SCM x, size_t idx, SCM val);
SCM_API int scm_i_vectorp (SCM x);
SCM_API unsigned long scm_i_vector_length (SCM x);
SCM_API const SCM *scm_i_velts (SCM x);
SCM_API SCM *scm_i_writable_velts (SCM x);
SCM_API SCM scm_i_vector_ref (SCM x, size_t idx);
SCM_API void scm_i_vector_set (SCM x, size_t idx, SCM val);
SCM_API SCM scm_vector_equal_p (SCM x, SCM y);
#define SCM_VECTORP(x) scm_i_vectorp(x)
#define SCM_VECTOR_LENGTH(x) scm_i_vector_length(x)
#define SCM_VELTS(x) scm_i_velts(x)
#define SCM_WRITABLE_VELTS(x) scm_i_writable_velts(x)
#define SCM_VECTOR_REF(x,y) scm_i_vector_ref(x,y)
#define SCM_VECTOR_SET(x,y,z) scm_i_vector_set(x,y,z)
typedef scm_i_t_array scm_t_array;
SCM_API int SCM_ARRAYP (SCM a);
SCM_API size_t SCM_ARRAY_NDIM (SCM a);
SCM_API int SCM_ARRAY_CONTP (SCM a);
SCM_API int scm_i_arrayp (SCM a);
SCM_API size_t scm_i_array_ndim (SCM a);
SCM_API int scm_i_array_contp (SCM a);
SCM_API scm_t_array *scm_i_array_mem (SCM a);
SCM_API SCM scm_i_array_v (SCM a);
SCM_API size_t scm_i_array_base (SCM a);
SCM_API scm_t_array_dim *scm_i_array_dims (SCM a);
SCM_API scm_t_array *SCM_ARRAY_MEM (SCM a);
SCM_API SCM SCM_ARRAY_V (SCM a);
SCM_API size_t SCM_ARRAY_BASE (SCM a);
SCM_API scm_t_array_dim *SCM_ARRAY_DIMS (SCM a);
#define SCM_ARRAYP(a) scm_i_arrayp(a)
#define SCM_ARRAY_NDIM(a) scm_i_array_ndim(a)
#define SCM_ARRAY_CONTP(a) scm_i_array_contp(a)
#define SCM_ARRAY_MEM(a) scm_i_array_mem(a)
#define SCM_ARRAY_V(a) scm_i_array_v(a)
#define SCM_ARRAY_BASE(a) scm_i_array_base(a)
#define SCM_ARRAY_DIMS(a) scm_i_attay_dims(a)
void scm_i_init_deprecated (void);

View file

@ -986,7 +986,7 @@ scm_i_get_substring_spec (size_t len,
*/
int
SCM_STRINGP (SCM str)
scm_i_deprecated_stringp (SCM str)
{
scm_c_issue_deprecation_warning
("SCM_STRINGP is deprecated. Use scm_is_string instead.");
@ -995,7 +995,7 @@ SCM_STRINGP (SCM str)
}
char *
SCM_STRING_CHARS (SCM str)
scm_i_deprecated_string_chars (SCM str)
{
char *chars;
@ -1027,7 +1027,7 @@ SCM_STRING_CHARS (SCM str)
}
size_t
SCM_STRING_LENGTH (SCM str)
scm_i_deprecated_string_length (SCM str)
{
scm_c_issue_deprecation_warning
("SCM_STRING_LENGTH is deprecated. Use scm_c_string_length instead.");

View file

@ -149,10 +149,14 @@ SCM_API void scm_i_get_substring_spec (size_t len,
#if SCM_ENABLE_DEPRECATED
SCM_API int SCM_STRINGP (SCM obj);
SCM_API char *SCM_STRING_CHARS (SCM str);
SCM_API size_t SCM_STRING_LENGTH (SCM str);
#define SCM_STRING_UCHARS ((unsigned char *)SCM_STRING_CHARS (str))
SCM_API int scm_i_deprecated_stringp (SCM obj);
SCM_API char *scm_i_deprecated_string_chars (SCM str);
SCM_API size_t scm_i_deprecated_string_length (SCM str);
#define SCM_STRINGP(x) scm_i_deprecated_stringp(x)
#define SCM_STRING_CHARS(x) scm_i_deprecated_string_chars(x)
#define SCM_STRING_LENGTH(x) scm_i_deprecated_string_length(x)
#define SCM_STRING_UCHARS ((unsigned char *)SCM_STRING_CHARS (str))
#endif