[前][次][番号順一覧][スレッド一覧]

ruby-changes:30825

From: nobu <ko1@a...>
Date: Tue, 10 Sep 2013 14:05:56 +0900 (JST)
Subject: [ruby-changes:30825] nobu:r42904 (trunk): rational.c: conditionally defined variable

nobu	2013-09-10 14:05:50 +0900 (Tue, 10 Sep 2013)

  New Revision: 42904

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42904

  Log:
    rational.c: conditionally defined variable
    
    * rational.c (numeric_quo): variable 'canonicalization' is defined
      conditionally by CANON (and CANONICALIZATION_FOR_MATHN).

  Modified files:
    trunk/complex.c
    trunk/rational.c
Index: complex.c
===================================================================
--- complex.c	(revision 42903)
+++ complex.c	(revision 42904)
@@ -376,6 +376,8 @@ nucomp_canonicalization(int f) https://github.com/ruby/ruby/blob/trunk/complex.c#L376
 {
     canonicalization = f;
 }
+#else
+# define canonicalization <<<No canonicalization>>>
 #endif
 
 inline static void
Index: rational.c
===================================================================
--- rational.c	(revision 42903)
+++ rational.c	(revision 42904)
@@ -494,6 +494,8 @@ nurat_canonicalization(int f) https://github.com/ruby/ruby/blob/trunk/rational.c#L494
 {
     canonicalization = f;
 }
+#else
+# define canonicalization <<<No canonicalization>>>
 #endif
 
 inline static void
@@ -1867,10 +1869,13 @@ numeric_quo(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/rational.c#L1869
         return f_fdiv(x, y);
     }
 
+#ifdef CANON
     if (canonicalization) {
         x = rb_rational_raw1(x);
     }
-    else {
+    else
+#endif
+    {
         x = rb_convert_type(x, T_RATIONAL, "Rational", "to_r");
     }
     return rb_funcall(x, '/', 1, y);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]