ruby-changes:11590
From: yugui <ko1@a...>
Date: Sun, 19 Apr 2009 22:35:25 +0900 (JST)
Subject: [ruby-changes:11590] Ruby:r23226 (ruby_1_9_1): merges r23073 from trunk into ruby_1_9_1.
yugui 2009-04-19 22:34:40 +0900 (Sun, 19 Apr 2009) New Revision: 23226 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23226 Log: merges r23073 from trunk into ruby_1_9_1. -- * bignum.c (rb_cmpint): FIX2INT may fail on LP64 platforms. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/bignum.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 23225) +++ ruby_1_9_1/ChangeLog (revision 23226) @@ -1,3 +1,7 @@ +Fri Mar 27 01:19:50 2009 Tanaka Akira <akr@f...> + + * bignum.c (rb_cmpint): FIX2INT may fail on LP64 platforms. + Fri Mar 13 21:11:51 2009 Yukihiro Matsumoto <matz@r...> * ext/sdbm/_sdbm.c: should include "ruby/defines.h" as well for Index: ruby_1_9_1/bignum.c =================================================================== --- ruby_1_9_1/bignum.c (revision 23225) +++ ruby_1_9_1/bignum.c (revision 23226) @@ -56,7 +56,12 @@ if (NIL_P(val)) { rb_cmperr(a, b); } - if (FIXNUM_P(val)) return FIX2INT(val); + if (FIXNUM_P(val)) { + long l = FIX2LONG(val); + if (l > 0) return 1; + if (l < 0) return -1; + return 0; + } if (TYPE(val) == T_BIGNUM) { if (BIGZEROP(val)) return 0; if (RBIGNUM_SIGN(val)) return 1; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/