mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
merges r23073 from trunk into ruby_1_9_1.
-- * bignum.c (rb_cmpint): FIX2INT may fail on LP64 platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
66ffd658fd
commit
33f7764bbf
2 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Fri Mar 27 01:19:50 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (rb_cmpint): FIX2INT may fail on LP64 platforms.
|
||||
|
||||
Fri Mar 13 21:11:51 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ext/sdbm/_sdbm.c: should include "ruby/defines.h" as well for
|
||||
|
|
7
bignum.c
7
bignum.c
|
@ -56,7 +56,12 @@ rb_cmpint(VALUE val, VALUE a, VALUE b)
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue