ruby-changes:50542
From: nobu <ko1@a...>
Date: Wed, 7 Mar 2018 11:27:24 +0900 (JST)
Subject: [ruby-changes:50542] nobu:r62682 (trunk): complex.c, rational.c: simplified macro conditions
nobu 2018-03-07 11:27:18 +0900 (Wed, 07 Mar 2018) New Revision: 62682 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62682 Log: complex.c, rational.c: simplified macro conditions Modified files: trunk/complex.c trunk/rational.c Index: complex.c =================================================================== --- complex.c (revision 62681) +++ complex.c (revision 62682) @@ -329,10 +329,6 @@ f_complex_new_bang2(VALUE klass, VALUE x https://github.com/ruby/ruby/blob/trunk/complex.c#L329 } #ifdef CANONICALIZATION_FOR_MATHN -#define CANON -#endif - -#ifdef CANON static int canonicalization = 0; RUBY_FUNC_EXPORTED void @@ -358,15 +354,9 @@ nucomp_real_check(VALUE num) https://github.com/ruby/ruby/blob/trunk/complex.c#L354 inline static VALUE nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag) { -#ifdef CANON -#define CL_CANON -#ifdef CL_CANON +#ifdef CANONICALIZATION_FOR_MATHN if (k_exact_zero_p(imag) && canonicalization) return real; -#else - if (f_zero_p(imag) && canonicalization) - return real; -#endif #endif if (f_real_p(real) && f_real_p(imag)) return nucomp_s_new_internal(klass, real, imag); Index: rational.c =================================================================== --- rational.c (revision 62681) +++ rational.c (revision 62682) @@ -429,10 +429,6 @@ f_rational_new_bang1(VALUE klass, VALUE https://github.com/ruby/ruby/blob/trunk/rational.c#L429 } #ifdef CANONICALIZATION_FOR_MATHN -#define CANON -#endif - -#ifdef CANON static int canonicalization = 0; RUBY_FUNC_EXPORTED void -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/