mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Removed non-RUBY_INTEGER_UNIFICATION code
This commit is contained in:
parent
6f0446785b
commit
5b287481be
6 changed files with 3 additions and 45 deletions
2
array.c
2
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;
|
VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
|
||||||
int n;
|
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;
|
||||||
if ((long)a < (long)b) return -1;
|
if ((long)a < (long)b) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
6
bignum.c
6
bignum.c
|
@ -45,9 +45,6 @@
|
||||||
|
|
||||||
#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
|
#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";
|
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||||
|
|
||||||
#ifndef SIZEOF_BDIGIT_DBL
|
#ifndef SIZEOF_BDIGIT_DBL
|
||||||
|
@ -7190,9 +7187,6 @@ rb_int_powm(int const argc, VALUE * const argv, VALUE const num)
|
||||||
void
|
void
|
||||||
Init_Bignum(void)
|
Init_Bignum(void)
|
||||||
{
|
{
|
||||||
#ifndef RUBY_INTEGER_UNIFICATION
|
|
||||||
rb_cBignum = rb_cInteger;
|
|
||||||
#endif
|
|
||||||
/* An obsolete class, use Integer */
|
/* An obsolete class, use Integer */
|
||||||
rb_define_const(rb_cObject, "Bignum", rb_cInteger);
|
rb_define_const(rb_cObject, "Bignum", rb_cInteger);
|
||||||
rb_deprecate_constant(rb_cObject, "Bignum");
|
rb_deprecate_constant(rb_cObject, "Bignum");
|
||||||
|
|
|
@ -1956,9 +1956,6 @@ RUBY_EXTERN VALUE rb_mWaitWritable;
|
||||||
RUBY_EXTERN VALUE rb_cBasicObject;
|
RUBY_EXTERN VALUE rb_cBasicObject;
|
||||||
RUBY_EXTERN VALUE rb_cObject;
|
RUBY_EXTERN VALUE rb_cObject;
|
||||||
RUBY_EXTERN VALUE rb_cArray;
|
RUBY_EXTERN VALUE rb_cArray;
|
||||||
#ifndef RUBY_INTEGER_UNIFICATION
|
|
||||||
RUBY_EXTERN VALUE rb_cBignum;
|
|
||||||
#endif
|
|
||||||
RUBY_EXTERN VALUE rb_cBinding;
|
RUBY_EXTERN VALUE rb_cBinding;
|
||||||
RUBY_EXTERN VALUE rb_cClass;
|
RUBY_EXTERN VALUE rb_cClass;
|
||||||
RUBY_EXTERN VALUE rb_cCont;
|
RUBY_EXTERN VALUE rb_cCont;
|
||||||
|
@ -1968,9 +1965,6 @@ RUBY_EXTERN VALUE rb_cEncoding;
|
||||||
RUBY_EXTERN VALUE rb_cEnumerator;
|
RUBY_EXTERN VALUE rb_cEnumerator;
|
||||||
RUBY_EXTERN VALUE rb_cFalseClass;
|
RUBY_EXTERN VALUE rb_cFalseClass;
|
||||||
RUBY_EXTERN VALUE rb_cFile;
|
RUBY_EXTERN VALUE rb_cFile;
|
||||||
#ifndef RUBY_INTEGER_UNIFICATION
|
|
||||||
RUBY_EXTERN VALUE rb_cFixnum;
|
|
||||||
#endif
|
|
||||||
RUBY_EXTERN VALUE rb_cComplex;
|
RUBY_EXTERN VALUE rb_cComplex;
|
||||||
RUBY_EXTERN VALUE rb_cFloat;
|
RUBY_EXTERN VALUE rb_cFloat;
|
||||||
RUBY_EXTERN VALUE rb_cHash;
|
RUBY_EXTERN VALUE rb_cHash;
|
||||||
|
|
|
@ -9,18 +9,12 @@
|
||||||
* modify this file, provided that the conditions mentioned in the
|
* modify this file, provided that the conditions mentioned in the
|
||||||
* file COPYING are met. Consult the file for details.
|
* 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 */
|
#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)
|
#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 {
|
enum {
|
||||||
cmp_opt_Fixnum,
|
cmp_opt_Integer,
|
||||||
cmp_opt_String,
|
cmp_opt_String,
|
||||||
cmp_opt_Float,
|
cmp_opt_Float,
|
||||||
cmp_optimizable_count
|
cmp_optimizable_count
|
||||||
|
@ -42,7 +36,7 @@ struct cmp_opt_data {
|
||||||
((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
|
((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
|
||||||
|
|
||||||
#define OPTIMIZED_CMP(a, b, data) \
|
#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) : \
|
(((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \
|
||||||
(STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data, String)) ? \
|
(STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data, String)) ? \
|
||||||
rb_str_cmp(a, b) : \
|
rb_str_cmp(a, b) : \
|
||||||
|
|
|
@ -192,9 +192,6 @@ static ID id_coerce;
|
||||||
VALUE rb_cNumeric;
|
VALUE rb_cNumeric;
|
||||||
VALUE rb_cFloat;
|
VALUE rb_cFloat;
|
||||||
VALUE rb_cInteger;
|
VALUE rb_cInteger;
|
||||||
#ifndef RUBY_INTEGER_UNIFICATION
|
|
||||||
VALUE rb_cFixnum;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VALUE rb_eZeroDivError;
|
VALUE rb_eZeroDivError;
|
||||||
VALUE rb_eFloatDomainError;
|
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, "bit_length", rb_int_bit_length, 0);
|
||||||
rb_define_method(rb_cInteger, "digits", rb_int_digits, -1);
|
rb_define_method(rb_cInteger, "digits", rb_int_digits, -1);
|
||||||
|
|
||||||
#ifndef RUBY_INTEGER_UNIFICATION
|
|
||||||
rb_cFixnum = rb_cInteger;
|
|
||||||
#endif
|
|
||||||
/* An obsolete class, use Integer */
|
/* An obsolete class, use Integer */
|
||||||
rb_define_const(rb_cObject, "Fixnum", rb_cInteger);
|
rb_define_const(rb_cObject, "Fixnum", rb_cInteger);
|
||||||
rb_deprecate_constant(rb_cObject, "Fixnum");
|
rb_deprecate_constant(rb_cObject, "Fixnum");
|
||||||
|
|
|
@ -9,12 +9,6 @@ static VALUE constants_spec_rb_cArray(VALUE self) {
|
||||||
return rb_cArray;
|
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) {
|
static VALUE constants_spec_rb_cClass(VALUE self) {
|
||||||
return rb_cClass;
|
return rb_cClass;
|
||||||
}
|
}
|
||||||
|
@ -31,12 +25,6 @@ static VALUE constants_spec_rb_cFile(VALUE self) {
|
||||||
return rb_cFile;
|
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) {
|
static VALUE constants_spec_rb_cFloat(VALUE self) {
|
||||||
return rb_cFloat;
|
return rb_cFloat;
|
||||||
}
|
}
|
||||||
|
@ -264,17 +252,11 @@ static VALUE constants_spec_rb_cDir(VALUE self) {
|
||||||
void Init_constants_spec(void) {
|
void Init_constants_spec(void) {
|
||||||
VALUE cls = rb_define_class("CApiConstantsSpecs", rb_cObject);
|
VALUE cls = rb_define_class("CApiConstantsSpecs", rb_cObject);
|
||||||
rb_define_method(cls, "rb_cArray", constants_spec_rb_cArray, 0);
|
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_cClass", constants_spec_rb_cClass, 0);
|
||||||
rb_define_method(cls, "rb_cData", constants_spec_rb_cData, 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_cFalseClass", constants_spec_rb_cFalseClass, 0);
|
||||||
rb_define_method(cls, "rb_cFile", constants_spec_rb_cFile, 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_cFloat", constants_spec_rb_cFloat, 0);
|
||||||
rb_define_method(cls, "rb_cHash", constants_spec_rb_cHash, 0);
|
rb_define_method(cls, "rb_cHash", constants_spec_rb_cHash, 0);
|
||||||
|
|
Loading…
Reference in a new issue