mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* include/ruby/ruby.h (struct RComplex): no longer. [Feature #9888]
* include/ruby/ruby.h (RCOMPLEX): ditto. * include/ruby/ruby.h (RCOMPLEX_SET_REAL): deprecated. Will be deleted later. * include/ruby/ruby.h (RCOMPLEX_SET_IMAG): ditto. * internal.h (struct RFloat): moved here. * internal.h (RCOMPLEX): ditto. * complex.c (rb_complex_set_real): do not use this. * complex.c (rb_complex_set_imag): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6adcf6a898
commit
62bfc4f24e
5 changed files with 49 additions and 7 deletions
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
|||
Mon Jun 23 13:30:11 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (struct RComplex): no longer. [Feature #9888]
|
||||
|
||||
* include/ruby/ruby.h (RCOMPLEX): ditto.
|
||||
|
||||
* include/ruby/ruby.h (RCOMPLEX_SET_REAL): deprecated. Will be deleted later.
|
||||
|
||||
* include/ruby/ruby.h (RCOMPLEX_SET_IMAG): ditto.
|
||||
|
||||
* internal.h (struct RFloat): moved here.
|
||||
|
||||
* internal.h (RCOMPLEX): ditto.
|
||||
|
||||
* complex.c (rb_complex_set_real): do not use this.
|
||||
|
||||
* complex.c (rb_complex_set_imag): ditto.
|
||||
|
||||
Mon Jun 23 13:10:15 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (struct RFloat): no longer. [Feature #9863]
|
||||
|
|
14
complex.c
14
complex.c
|
@ -1342,6 +1342,20 @@ rb_Complex(VALUE x, VALUE y)
|
|||
return nucomp_s_convert(2, a, rb_cComplex);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_complex_set_real(VALUE cmp, VALUE r)
|
||||
{
|
||||
RCOMPLEX_SET_REAL(cmp, r);
|
||||
return cmp;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_complex_set_imag(VALUE cmp, VALUE i)
|
||||
{
|
||||
RCOMPLEX_SET_REAL(cmp, i);
|
||||
return cmp;
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* cmp.to_i -> integer
|
||||
|
|
|
@ -183,6 +183,8 @@ VALUE rb_complex_polar(VALUE, VALUE);
|
|||
VALUE rb_Complex(VALUE, VALUE);
|
||||
#define rb_Complex1(x) rb_Complex((x), INT2FIX(0))
|
||||
#define rb_Complex2(x,y) rb_Complex((x), (y))
|
||||
DEPRECATED(VALUE rb_complex_set_real(VALUE, VALUE));
|
||||
DEPRECATED(VALUE rb_complex_set_imag(VALUE, VALUE));
|
||||
/* class.c */
|
||||
VALUE rb_class_boot(VALUE);
|
||||
VALUE rb_class_new(VALUE);
|
||||
|
|
|
@ -938,12 +938,6 @@ struct RFile {
|
|||
struct rb_io_t *fptr;
|
||||
};
|
||||
|
||||
struct RComplex {
|
||||
struct RBasic basic;
|
||||
const VALUE real;
|
||||
const VALUE imag;
|
||||
};
|
||||
|
||||
#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->real,(r))
|
||||
#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
|
||||
|
||||
|
@ -1080,7 +1074,6 @@ struct RStruct {
|
|||
#define RTYPEDDATA(obj) (R_CAST(RTypedData)(obj))
|
||||
#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
|
||||
#define RFILE(obj) (R_CAST(RFile)(obj))
|
||||
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
|
||||
|
||||
#define FL_SINGLETON FL_USER0
|
||||
#define FL_WB_PROTECTED (((VALUE)1)<<5)
|
||||
|
|
15
internal.h
15
internal.h
|
@ -427,6 +427,21 @@ struct RFloat {
|
|||
|
||||
#define RFLOAT(obj) (R_CAST(RFloat)(obj))
|
||||
|
||||
struct RComplex {
|
||||
struct RBasic basic;
|
||||
const VALUE real;
|
||||
const VALUE imag;
|
||||
};
|
||||
|
||||
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
|
||||
|
||||
#ifdef RCOMPLEX_SET_REAL /* shortcut macro for internal only */
|
||||
#undef RCOMPLEX_SET_REAL
|
||||
#undef RCOMPLEX_SET_REAL
|
||||
#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->real,(r))
|
||||
#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
|
||||
#endif
|
||||
|
||||
/* class.c */
|
||||
void rb_class_subclass_add(VALUE super, VALUE klass);
|
||||
void rb_class_remove_from_super_subclasses(VALUE);
|
||||
|
|
Loading…
Add table
Reference in a new issue