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

ruby-changes:40412

From: nobu <ko1@a...>
Date: Sun, 8 Nov 2015 15:29:18 +0900 (JST)
Subject: [ruby-changes:40412] nobu:r52493 (trunk): bigdecimal.c: suppress warnings

nobu	2015-11-08 15:29:13 +0900 (Sun, 08 Nov 2015)

  New Revision: 52493

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

  Log:
    bigdecimal.c: suppress warnings
    
    * ext/bigdecimal/bigdecimal.c (AddExponent): suppress
      strict-overflow warnings.

  Modified files:
    trunk/ext/bigdecimal/bigdecimal.c
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 52492)
+++ ext/bigdecimal/bigdecimal.c	(revision 52493)
@@ -3858,7 +3858,7 @@ AddExponent(Real *a, SIGNED_VALUE n) https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L3858
                 goto overflow;
 	    mb = m*(SIGNED_VALUE)BASE_FIG;
 	    eb = e*(SIGNED_VALUE)BASE_FIG;
-	    if (mb < eb) goto overflow;
+	    if (eb - mb > 0) goto overflow;
 	}
     }
     else if (n < 0) {
@@ -3867,7 +3867,7 @@ AddExponent(Real *a, SIGNED_VALUE n) https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L3867
             goto underflow;
 	mb = m*(SIGNED_VALUE)BASE_FIG;
 	eb = e*(SIGNED_VALUE)BASE_FIG;
-	if (mb > eb) goto underflow;
+	if (mb - eb > 0) goto underflow;
     }
     a->exponent = m;
     return 1;

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

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