summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-14 15:29:10 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-14 15:29:10 +0000
commitab9bc151e828843b9d9170754f4ba4d92ef85750 (patch)
tree83b20f332afc1f38ba0a0ad5f7319f07125ea022 /include
parentd8633ac16c91cce0ecf83f089fb6fd89e04d0029 (diff)
* include/ruby/ruby.h,
internal.h, ext/-test-/bignum/bigzero.c: Hide a Bignum definition. [ruby-core:42891] [Feature #6083] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h43
1 files changed, 0 insertions, 43 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 53f5ecc..07477b0 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1069,48 +1069,6 @@ struct RStruct {
#define RSTRUCT_SET(st, idx, v) RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[idx], (v))
#define RSTRUCT_GET(st, idx) (RSTRUCT_CONST_PTR(st)[idx])
-#define RBIGNUM_EMBED_LEN_NUMBITS 3
-#ifndef RBIGNUM_EMBED_LEN_MAX
-# if (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1
-# define RBIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT)
-# else
-# define RBIGNUM_EMBED_LEN_MAX ((1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
-# endif
-#endif
-struct RBignum {
- struct RBasic basic;
- union {
- struct {
- long len;
- BDIGIT *digits;
- } heap;
- BDIGIT ary[RBIGNUM_EMBED_LEN_MAX];
- } as;
-};
-#define RBIGNUM_SIGN_BIT FL_USER1
-/* sign: positive:1, negative:0 */
-#define RBIGNUM_SIGN(b) ((RBASIC(b)->flags & RBIGNUM_SIGN_BIT) != 0)
-#define RBIGNUM_SET_SIGN(b,sign) \
- ((sign) ? (RBASIC(b)->flags |= RBIGNUM_SIGN_BIT) \
- : (RBASIC(b)->flags &= ~RBIGNUM_SIGN_BIT))
-#define RBIGNUM_POSITIVE_P(b) RBIGNUM_SIGN(b)
-#define RBIGNUM_NEGATIVE_P(b) (!RBIGNUM_SIGN(b))
-
-#define RBIGNUM_EMBED_FLAG FL_USER2
-#define RBIGNUM_EMBED_LEN_MASK (FL_USER5|FL_USER4|FL_USER3)
-#define RBIGNUM_EMBED_LEN_SHIFT (FL_USHIFT+RBIGNUM_EMBED_LEN_NUMBITS)
-#define RBIGNUM_LEN(b) \
- ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
- (long)((RBASIC(b)->flags >> RBIGNUM_EMBED_LEN_SHIFT) & \
- (RBIGNUM_EMBED_LEN_MASK >> RBIGNUM_EMBED_LEN_SHIFT)) : \
- RBIGNUM(b)->as.heap.len)
-/* LSB:RBIGNUM_DIGITS(b)[0], MSB:RBIGNUM_DIGITS(b)[RBIGNUM_LEN(b)-1] */
-#define RBIGNUM_DIGITS(b) \
- ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
- RBIGNUM(b)->as.ary : \
- RBIGNUM(b)->as.heap.digits)
-#define RBIGNUM_LENINT(b) rb_long2int(RBIGNUM_LEN(b))
-
#define R_CAST(st) (struct st*)
#define RBASIC(obj) (R_CAST(RBasic)(obj))
#define ROBJECT(obj) (R_CAST(RObject)(obj))
@@ -1124,7 +1082,6 @@ struct RBignum {
#define RDATA(obj) (R_CAST(RData)(obj))
#define RTYPEDDATA(obj) (R_CAST(RTypedData)(obj))
#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
-#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
#define RFILE(obj) (R_CAST(RFile)(obj))
#define RRATIONAL(obj) (R_CAST(RRational)(obj))
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))