aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-21 16:59:55 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-21 16:59:55 +0900
commit5b287481befe03cc3e3dbc4b5571e21dbc523bae (patch)
tree853e859aa58ac31d7df6df3a55c9aaf5d2fdf9e7
parent6f0446785b537994bceb9fc8574cdaa9b59cbef6 (diff)
downloadruby-5b287481befe03cc3e3dbc4b5571e21dbc523bae.tar.gz
Removed non-RUBY_INTEGER_UNIFICATION code
-rw-r--r--array.c2
-rw-r--r--bignum.c6
-rw-r--r--include/ruby/ruby.h6
-rw-r--r--internal/compar.h10
-rw-r--r--numeric.c6
-rw-r--r--spec/ruby/optional/capi/ext/constants_spec.c18
6 files changed, 3 insertions, 45 deletions
diff --git a/array.c b/array.c
index 0686eeca81..69f3f57d14 100644
--- a/array.c
+++ b/array.c
@@ -2760,7 +2760,7 @@ sort_2(const void *ap, const void *bp, void *dummy)
VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
int n;
- if (FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data->cmp_opt, Fixnum)) {
+ if (FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data->cmp_opt, Integer)) {
if ((long)a > (long)b) return 1;
if ((long)a < (long)b) return -1;
return 0;
diff --git a/bignum.c b/bignum.c
index 8eea0a156a..8b6a1e9ddc 100644
--- a/bignum.c
+++ b/bignum.c
@@ -45,9 +45,6 @@
#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
-#ifndef RUBY_INTEGER_UNIFICATION
-VALUE rb_cBignum;
-#endif
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
#ifndef SIZEOF_BDIGIT_DBL
@@ -7190,9 +7187,6 @@ rb_int_powm(int const argc, VALUE * const argv, VALUE const num)
void
Init_Bignum(void)
{
-#ifndef RUBY_INTEGER_UNIFICATION
- rb_cBignum = rb_cInteger;
-#endif
/* An obsolete class, use Integer */
rb_define_const(rb_cObject, "Bignum", rb_cInteger);
rb_deprecate_constant(rb_cObject, "Bignum");
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index b835bd69ad..395bdb97cd 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1956,9 +1956,6 @@ RUBY_EXTERN VALUE rb_mWaitWritable;
RUBY_EXTERN VALUE rb_cBasicObject;
RUBY_EXTERN VALUE rb_cObject;
RUBY_EXTERN VALUE rb_cArray;
-#ifndef RUBY_INTEGER_UNIFICATION
-RUBY_EXTERN VALUE rb_cBignum;
-#endif
RUBY_EXTERN VALUE rb_cBinding;
RUBY_EXTERN VALUE rb_cClass;
RUBY_EXTERN VALUE rb_cCont;
@@ -1968,9 +1965,6 @@ RUBY_EXTERN VALUE rb_cEncoding;
RUBY_EXTERN VALUE rb_cEnumerator;
RUBY_EXTERN VALUE rb_cFalseClass;
RUBY_EXTERN VALUE rb_cFile;
-#ifndef RUBY_INTEGER_UNIFICATION
-RUBY_EXTERN VALUE rb_cFixnum;
-#endif
RUBY_EXTERN VALUE rb_cComplex;
RUBY_EXTERN VALUE rb_cFloat;
RUBY_EXTERN VALUE rb_cHash;
diff --git a/internal/compar.h b/internal/compar.h
index 6a689ed11d..a2808d62be 100644
--- a/internal/compar.h
+++ b/internal/compar.h
@@ -9,18 +9,12 @@
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
-#include "ruby/ruby.h" /* for RUBY_INTEGER_UNIFICATION */
#include "internal/vm.h" /* for rb_method_basic_definition_p */
#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
-#ifdef RUBY_INTEGER_UNIFICATION
-# define rb_cFixnum rb_cInteger
-# define rb_cBignum rb_cInteger
-#endif
-
enum {
- cmp_opt_Fixnum,
+ cmp_opt_Integer,
cmp_opt_String,
cmp_opt_Float,
cmp_optimizable_count
@@ -42,7 +36,7 @@ struct cmp_opt_data {
((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
#define OPTIMIZED_CMP(a, b, data) \
- ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data, Fixnum)) ? \
+ ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data, Integer)) ? \
(((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \
(STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data, String)) ? \
rb_str_cmp(a, b) : \
diff --git a/numeric.c b/numeric.c
index b41838229f..f177788073 100644
--- a/numeric.c
+++ b/numeric.c
@@ -192,9 +192,6 @@ static ID id_coerce;
VALUE rb_cNumeric;
VALUE rb_cFloat;
VALUE rb_cInteger;
-#ifndef RUBY_INTEGER_UNIFICATION
-VALUE rb_cFixnum;
-#endif
VALUE rb_eZeroDivError;
VALUE rb_eFloatDomainError;
@@ -5687,9 +5684,6 @@ Init_Numeric(void)
rb_define_method(rb_cInteger, "bit_length", rb_int_bit_length, 0);
rb_define_method(rb_cInteger, "digits", rb_int_digits, -1);
-#ifndef RUBY_INTEGER_UNIFICATION
- rb_cFixnum = rb_cInteger;
-#endif
/* An obsolete class, use Integer */
rb_define_const(rb_cObject, "Fixnum", rb_cInteger);
rb_deprecate_constant(rb_cObject, "Fixnum");
diff --git a/spec/ruby/optional/capi/ext/constants_spec.c b/spec/ruby/optional/capi/ext/constants_spec.c
index c8ae843016..6f1e03f549 100644
--- a/spec/ruby/optional/capi/ext/constants_spec.c
+++ b/spec/ruby/optional/capi/ext/constants_spec.c
@@ -9,12 +9,6 @@ static VALUE constants_spec_rb_cArray(VALUE self) {
return rb_cArray;
}
-#ifndef RUBY_INTEGER_UNIFICATION
-static VALUE constants_spec_rb_cBignum(VALUE self) {
- return rb_cBignum;
-}
-#endif
-
static VALUE constants_spec_rb_cClass(VALUE self) {
return rb_cClass;
}
@@ -31,12 +25,6 @@ static VALUE constants_spec_rb_cFile(VALUE self) {
return rb_cFile;
}
-#ifndef RUBY_INTEGER_UNIFICATION
-static VALUE constants_spec_rb_cFixnum(VALUE self) {
- return rb_cFixnum;
-}
-#endif
-
static VALUE constants_spec_rb_cFloat(VALUE self) {
return rb_cFloat;
}
@@ -264,17 +252,11 @@ static VALUE constants_spec_rb_cDir(VALUE self) {
void Init_constants_spec(void) {
VALUE cls = rb_define_class("CApiConstantsSpecs", rb_cObject);
rb_define_method(cls, "rb_cArray", constants_spec_rb_cArray, 0);
-#ifndef RUBY_INTEGER_UNIFICATION
- rb_define_method(cls, "rb_cBignum", constants_spec_rb_cBignum, 0);
-#endif
rb_define_method(cls, "rb_cClass", constants_spec_rb_cClass, 0);
rb_define_method(cls, "rb_cData", constants_spec_rb_cData, 0);
rb_define_method(cls, "rb_cFalseClass", constants_spec_rb_cFalseClass, 0);
rb_define_method(cls, "rb_cFile", constants_spec_rb_cFile, 0);
-#ifndef RUBY_INTEGER_UNIFICATION
- rb_define_method(cls, "rb_cFixnum", constants_spec_rb_cFixnum, 0);
-#endif
rb_define_method(cls, "rb_cFloat", constants_spec_rb_cFloat, 0);
rb_define_method(cls, "rb_cHash", constants_spec_rb_cHash, 0);