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

ruby-changes:57708

From: Nobuyoshi <ko1@a...>
Date: Tue, 10 Sep 2019 17:20:59 +0900 (JST)
Subject: [ruby-changes:57708] ad6cbc1d33 (master): Unused LONG_MAX_as_double

https://git.ruby-lang.org/ruby.git/commit/?id=ad6cbc1d33

From ad6cbc1d33d6013ef9b1d2ff9deb286956d9bcbc Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 10 Sep 2019 17:20:12 +0900
Subject: Unused LONG_MAX_as_double

LONG_MAX_as_double is not needed when long is small enough to be
exactly representable as a double, e.g., IL32LLP64 platforms.

diff --git a/bignum.c b/bignum.c
index 5d14306..f379b10 100644
--- a/bignum.c
+++ b/bignum.c
@@ -5369,6 +5369,7 @@ rb_integer_float_cmp(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/bignum.c#L5369
     return INT2FIX(-1);
 }
 
+#if SIZEOF_LONG * CHAR_BIT >= DBL_MANT_DIG /* assume FLT_RADIX == 2 */
 COMPILER_WARNING_PUSH
 #ifdef __has_warning
 #if __has_warning("-Wimplicit-int-float-conversion")
@@ -5377,6 +5378,7 @@ COMPILER_WARNING_IGNORED(-Wimplicit-int-float-conversion) https://github.com/ruby/ruby/blob/trunk/bignum.c#L5378
 #endif
 static const double LONG_MAX_as_double = LONG_MAX;
 COMPILER_WARNING_POP
+#endif
 
 VALUE
 rb_integer_float_eq(VALUE x, VALUE y)
-- 
cgit v0.10.2


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

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