defs/id.def: predefine to_f ID
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
34560d950b
commit
86d9071e0b
@ -33,14 +33,14 @@ static VALUE nucomp_arg(VALUE self);
|
|||||||
|
|
||||||
static ID id_abs, id_arg,
|
static ID id_abs, id_arg,
|
||||||
id_denominator, id_fdiv, id_numerator, id_quo,
|
id_denominator, id_fdiv, id_numerator, id_quo,
|
||||||
id_real_p, id_to_f,
|
id_real_p, id_i_real, id_i_imag,
|
||||||
id_i_real, id_i_imag,
|
|
||||||
id_finite_p, id_infinite_p, id_rationalize,
|
id_finite_p, id_infinite_p, id_rationalize,
|
||||||
id_PI;
|
id_PI;
|
||||||
#define id_to_i idTo_i
|
#define id_to_i idTo_i
|
||||||
#define id_to_r idTo_r
|
#define id_to_r idTo_r
|
||||||
#define id_negate idUMinus
|
#define id_negate idUMinus
|
||||||
#define id_expt idPow
|
#define id_expt idPow
|
||||||
|
#define id_to_f idTo_f
|
||||||
|
|
||||||
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
|
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
|
||||||
|
|
||||||
@ -2125,7 +2125,6 @@ Init_Complex(void)
|
|||||||
id_numerator = rb_intern("numerator");
|
id_numerator = rb_intern("numerator");
|
||||||
id_quo = rb_intern("quo");
|
id_quo = rb_intern("quo");
|
||||||
id_real_p = rb_intern("real?");
|
id_real_p = rb_intern("real?");
|
||||||
id_to_f = rb_intern("to_f");
|
|
||||||
id_i_real = rb_intern("@real");
|
id_i_real = rb_intern("@real");
|
||||||
id_i_imag = rb_intern("@image"); /* @image, not @imag */
|
id_i_imag = rb_intern("@image"); /* @image, not @imag */
|
||||||
id_finite_p = rb_intern("finite?");
|
id_finite_p = rb_intern("finite?");
|
||||||
|
@ -38,6 +38,7 @@ firstline, predefined = __LINE__+1, %[\
|
|||||||
to_a
|
to_a
|
||||||
to_s
|
to_s
|
||||||
to_i
|
to_i
|
||||||
|
to_f
|
||||||
to_r
|
to_r
|
||||||
bt
|
bt
|
||||||
bt_locations
|
bt_locations
|
||||||
|
3
object.c
3
object.c
@ -50,7 +50,7 @@ VALUE rb_cFalseClass; /*!< FalseClass class */
|
|||||||
#define id_init_clone idInitialize_clone
|
#define id_init_clone idInitialize_clone
|
||||||
#define id_init_dup idInitialize_dup
|
#define id_init_dup idInitialize_dup
|
||||||
#define id_const_missing idConst_missing
|
#define id_const_missing idConst_missing
|
||||||
static ID id_to_f;
|
#define id_to_f idTo_f
|
||||||
|
|
||||||
#define CLASS_OR_MODULE_P(obj) \
|
#define CLASS_OR_MODULE_P(obj) \
|
||||||
(!SPECIAL_CONST_P(obj) && \
|
(!SPECIAL_CONST_P(obj) && \
|
||||||
@ -4117,7 +4117,6 @@ InitVM_Object(void)
|
|||||||
void
|
void
|
||||||
Init_Object(void)
|
Init_Object(void)
|
||||||
{
|
{
|
||||||
id_to_f = rb_intern_const("to_f");
|
|
||||||
id_dig = rb_intern_const("dig");
|
id_dig = rb_intern_const("dig");
|
||||||
InitVM(Object);
|
InitVM(Object);
|
||||||
}
|
}
|
||||||
|
@ -962,7 +962,7 @@ nurat_fdiv(VALUE self, VALUE other)
|
|||||||
return nurat_to_f(div);
|
return nurat_to_f(div);
|
||||||
if (RB_FLOAT_TYPE_P(div))
|
if (RB_FLOAT_TYPE_P(div))
|
||||||
return div;
|
return div;
|
||||||
return rb_funcall(div, rb_intern("to_f"), 0);
|
return rb_funcall(div, idTo_f, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static VALUE
|
inline static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user