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

ruby-changes:37822

From: nobu <ko1@a...>
Date: Mon, 9 Mar 2015 14:48:13 +0900 (JST)
Subject: [ruby-changes:37822] nobu:r49903 (trunk): complex.c: suppress warnings on FreeBSD

nobu	2015-03-09 14:48:09 +0900 (Mon, 09 Mar 2015)

  New Revision: 49903

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

  Log:
    complex.c: suppress warnings on FreeBSD
    
    * complex.c (safe_mul): get rid of assignments in a macro.

  Modified files:
    trunk/complex.c
Index: complex.c
===================================================================
--- complex.c	(revision 49902)
+++ complex.c	(revision 49903)
@@ -747,10 +747,10 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/complex.c#L747
 safe_mul(VALUE a, VALUE b, int az, int bz)
 {
     double v;
-    if (!az && bz && RB_FLOAT_TYPE_P(a) && !isnan(v = RFLOAT_VALUE(a))) {
+    if (!az && bz && RB_FLOAT_TYPE_P(a) && (v = RFLOAT_VALUE(a), !isnan(v))) {
 	a = signbit(v) ? DBL2NUM(-1.0) : DBL2NUM(1.0);
     }
-    if (!bz && az && RB_FLOAT_TYPE_P(b) && !isnan(v = RFLOAT_VALUE(b))) {
+    if (!bz && az && RB_FLOAT_TYPE_P(b) && (v = RFLOAT_VALUE(b), !isnan(v))) {
 	b = signbit(v) ? DBL2NUM(-1.0) : DBL2NUM(1.0);
     }
     return f_mul(a, b);

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

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