ruby-changes:34425
From: shyouhei <ko1@a...>
Date: Mon, 23 Jun 2014 13:41:37 +0900 (JST)
Subject: [ruby-changes:34425] shyouhei:r46506 (trunk): * include/ruby/ruby.h (struct RComplex): no longer. [Feature #9888]
shyouhei 2014-06-23 13:41:27 +0900 (Mon, 23 Jun 2014) New Revision: 46506 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46506 Log: * 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. Modified files: trunk/ChangeLog trunk/complex.c trunk/include/ruby/intern.h trunk/include/ruby/ruby.h trunk/internal.h Index: complex.c =================================================================== --- complex.c (revision 46505) +++ complex.c (revision 46506) @@ -1342,6 +1342,20 @@ rb_Complex(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/complex.c#L1342 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 Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 46505) +++ include/ruby/intern.h (revision 46506) @@ -183,6 +183,8 @@ VALUE rb_complex_polar(VALUE, VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L183 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); Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 46505) +++ include/ruby/ruby.h (revision 46506) @@ -938,12 +938,6 @@ struct RFile { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L938 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 { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1074 #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) Index: ChangeLog =================================================================== --- ChangeLog (revision 46505) +++ ChangeLog (revision 46506) @@ -1,3 +1,21 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jun 23 13:30:11 2014 URABE Shyouhei <shyouhei@r...> + + * 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@r...> * include/ruby/ruby.h (struct RFloat): no longer. [Feature #9863] Index: internal.h =================================================================== --- internal.h (revision 46505) +++ internal.h (revision 46506) @@ -427,6 +427,21 @@ struct RFloat { https://github.com/ruby/ruby/blob/trunk/internal.h#L427 #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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/