зеркало из https://github.com/github/ruby.git
include/ruby/backward/2/r_cast.h: deprecate
Remove all usages of RCAST() so that the header file can be excluded from ruby/ruby.h's dependency.
This commit is contained in:
Родитель
442525527e
Коммит
cd1d6d9029
2
gc.c
2
gc.c
|
@ -536,6 +536,8 @@ struct RMoved {
|
|||
} as;
|
||||
};
|
||||
|
||||
#define RMOVED(obj) ((struct RMoved *)(obj))
|
||||
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__)
|
||||
#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */
|
||||
#endif
|
||||
|
|
|
@ -24,4 +24,10 @@
|
|||
*/
|
||||
#define R_CAST(st) (struct st*)
|
||||
#define RMOVED(obj) (R_CAST(RMoved)(obj))
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# warning R_CAST and RMOVED are deprecated
|
||||
#elif defined(_MSC_VER)
|
||||
# pragma message("warning: R_CAST and RMOVED are deprecated")
|
||||
#endif
|
||||
#endif /* RUBY_BACKWARD2_R_CAST_H */
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "ruby/backward/2/inttypes.h"
|
||||
#include "ruby/backward/2/limits.h"
|
||||
#include "ruby/backward/2/rmodule.h"
|
||||
#include "ruby/backward/2/r_cast.h"
|
||||
|
||||
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
# define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
|
||||
#endif
|
||||
|
||||
#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
|
||||
#define RBIGNUM(obj) ((struct RBignum *)(obj))
|
||||
#define BIGNUM_SIGN_BIT FL_USER1
|
||||
#define BIGNUM_EMBED_FLAG ((VALUE)FL_USER2)
|
||||
#define BIGNUM_EMBED_LEN_NUMBITS 3
|
||||
|
|
|
@ -17,7 +17,7 @@ struct RComplex {
|
|||
VALUE imag;
|
||||
};
|
||||
|
||||
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
|
||||
#define RCOMPLEX(obj) ((struct RComplex *)(obj))
|
||||
|
||||
/* shortcut macro for internal only */
|
||||
#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))
|
||||
|
|
|
@ -54,7 +54,7 @@ struct RHash {
|
|||
} ar_hint;
|
||||
};
|
||||
|
||||
#define RHASH(obj) (R_CAST(RHash)(obj))
|
||||
#define RHASH(obj) ((struct RHash *)(obj))
|
||||
|
||||
#ifdef RHASH_IFNONE
|
||||
# undef RHASH_IFNONE
|
||||
|
|
|
@ -117,7 +117,7 @@ struct MEMO {
|
|||
/* ment is in method.h */
|
||||
|
||||
#define THROW_DATA_P(err) imemo_throw_data_p((VALUE)err)
|
||||
#define MEMO_CAST(m) (R_CAST(MEMO)(m))
|
||||
#define MEMO_CAST(m) ((struct MEMO *)(m))
|
||||
#define MEMO_NEW(a, b, c) ((struct MEMO *)rb_imemo_new(imemo_memo, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
|
||||
#define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value))
|
||||
#define NEW_MEMO_FOR(type, value) \
|
||||
|
|
|
@ -41,7 +41,7 @@ struct RFloat {
|
|||
double float_value;
|
||||
};
|
||||
|
||||
#define RFLOAT(obj) (R_CAST(RFloat)(obj))
|
||||
#define RFLOAT(obj) ((struct RFloat *)(obj))
|
||||
|
||||
/* numeric.c */
|
||||
int rb_num_to_uint(VALUE val, unsigned int *ret);
|
||||
|
|
|
@ -21,7 +21,7 @@ struct RRational {
|
|||
VALUE den;
|
||||
};
|
||||
|
||||
#define RRATIONAL(obj) (R_CAST(RRational)(obj))
|
||||
#define RRATIONAL(obj) ((struct RRational *)(obj))
|
||||
|
||||
/* rational.c */
|
||||
VALUE rb_rational_canonicalize(VALUE x);
|
||||
|
|
|
@ -31,7 +31,7 @@ struct RStruct {
|
|||
} as;
|
||||
};
|
||||
|
||||
#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
|
||||
#define RSTRUCT(obj) ((struct RStruct *)(obj))
|
||||
|
||||
#ifdef RSTRUCT_LEN
|
||||
# undef RSTRUCT_LEN
|
||||
|
|
2
node.h
2
node.h
|
@ -173,7 +173,7 @@ typedef struct RNode {
|
|||
int node_id;
|
||||
} NODE;
|
||||
|
||||
#define RNODE(obj) (R_CAST(RNode)(obj))
|
||||
#define RNODE(obj) ((struct RNode *)(obj))
|
||||
|
||||
/* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: UNUSED, 9: UNUSED, 10: EXIVAR, 11: FREEZE */
|
||||
/* NODE_FL: 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: NODE_FL_NEWLINE,
|
||||
|
|
2
symbol.h
2
symbol.h
|
@ -30,7 +30,7 @@ struct RSymbol {
|
|||
ID id;
|
||||
};
|
||||
|
||||
#define RSYMBOL(obj) (R_CAST(RSymbol)(obj))
|
||||
#define RSYMBOL(obj) ((struct RSymbol *)(obj))
|
||||
|
||||
#define is_notop_id(id) ((id)>tLAST_OP_ID)
|
||||
#define is_local_id(id) (id_type(id)==ID_LOCAL)
|
||||
|
|
Загрузка…
Ссылка в новой задаче