aboutsummaryrefslogtreecommitdiffstats
path: root/complex.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-09 05:48:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-09 05:48:09 +0000
commitf8a82e1583dc4b86b2c9c5795871e4fa7644218a (patch)
tree002f31acae41fa338560649a25e70603ae747312 /complex.c
parent34beb98464c7f256594fbc77e5e7ab55b9276c16 (diff)
downloadruby-f8a82e1583dc4b86b2c9c5795871e4fa7644218a.tar.gz
complex.c: suppress warnings on FreeBSD
* complex.c (safe_mul): get rid of assignments in a macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/complex.c b/complex.c
index 6d540c9394..cf7b29345c 100644
--- a/complex.c
+++ b/complex.c
@@ -747,10 +747,10 @@ static VALUE
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);