ruby-changes:8499
From: yugui <ko1@a...>
Date: Thu, 30 Oct 2008 01:11:47 +0900 (JST)
Subject: [ruby-changes:8499] Ruby:r20033 (ruby_1_9_1): merged 20011 from trunk into ruby_1_9_1.
yugui 2008-10-30 01:11:12 +0900 (Thu, 30 Oct 2008) New Revision: 20033 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20033 Log: merged 20011 from trunk into ruby_1_9_1. * complex.c: uses macro in declarations. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/complex.c branches/ruby_1_9_1/win32/win32.c Index: ruby_1_9_1/complex.c =================================================================== --- ruby_1_9_1/complex.c (revision 20032) +++ ruby_1_9_1/complex.c (revision 20033) @@ -426,31 +426,41 @@ return rb_funcall2(rb_cComplex, id_convert, argc, argv); } -extern VALUE rb_math_atan2(VALUE x, VALUE y); -extern VALUE rb_math_cos(VALUE x); -extern VALUE rb_math_cosh(VALUE x); -extern VALUE rb_math_exp(VALUE x); -extern VALUE rb_math_hypot(VALUE x, VALUE y); +#define imp1(n) \ +extern VALUE rb_math_##n(VALUE x);\ +inline static VALUE \ +m_##n##_bang(x)\ +{\ + return rb_math_##n(x);\ +} + +#define imp2(n) \ +extern VALUE rb_math_##n(VALUE x, VALUE y);\ +inline static VALUE \ +m_##n##_bang(x, y)\ +{\ + return rb_math_##n(x, y);\ +} + +imp2(atan2) +imp1(cos) +imp1(cosh) +imp1(exp) +imp2(hypot) + +#define m_hypot(x,y) m_hypot_bang(x,y) + extern VALUE rb_math_log(int argc, VALUE *argv); -extern VALUE rb_math_sin(VALUE x); -extern VALUE rb_math_sinh(VALUE x); -extern VALUE rb_math_sqrt(VALUE x); -#define m_atan2_bang(x,y) rb_math_atan2(x,y) -#define m_cos_bang(x) rb_math_cos(x) -#define m_cosh_bang(x) rb_math_cosh(x) -#define m_exp_bang(x) rb_math_exp(x) -#define m_hypot(x,y) rb_math_hypot(x,y) - static VALUE m_log_bang(VALUE x) { return rb_math_log(1, &x); } -#define m_sin_bang(x) rb_math_sin(x) -#define m_sinh_bang(x) rb_math_sinh(x) -#define m_sqrt_bang(x) rb_math_sqrt(x) +imp1(sin) +imp1(sinh) +imp1(sqrt) static VALUE m_cos(VALUE x) Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20032) +++ ruby_1_9_1/ChangeLog (revision 20033) @@ -25,6 +25,10 @@ * win32/win32.c (rb_w32_write): write to the end of the file when FAPPEND is specified. +Wed Oct 29 00:43:39 2008 Tadayoshi Funaba <tadf@d...> + + * complex.c: uses macro in declarations. + Wed Oct 29 00:29:46 2008 NAKAMURA Usaku <usa@r...> * win32/win32.c (rb_w32_open): need to seek to the end of the file when Index: ruby_1_9_1/win32/win32.c =================================================================== --- ruby_1_9_1/win32/win32.c (revision 20032) +++ ruby_1_9_1/win32/win32.c (revision 20033) @@ -4129,8 +4129,10 @@ fd = -1; goto quit; } - if (!(flags & (FDEV | FPIPE)) && (oflag & O_APPEND)) + if (!(flags & (FDEV | FPIPE)) && (oflag & O_APPEND)) { flags |= FAPPEND; + SetFilePointer(h, 0, NULL, FILE_END); + } _set_osfhnd(fd, (long)h); _osfile(fd) = flags | FOPEN; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/