* time.c (rb_time_magnify): fix for LP64.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63dd50961e
commit
d8cc6ccb56
@ -1,3 +1,7 @@
|
|||||||
|
Sun Mar 28 10:12:28 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* time.c (rb_time_magnify): fix for LP64.
|
||||||
|
|
||||||
Sun Mar 28 09:28:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
Sun Mar 28 09:28:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/scanf.rb: fix %[egEFG] isn't accept.
|
* lib/scanf.rb: fix %[egEFG] isn't accept.
|
||||||
|
14
time.c
14
time.c
@ -594,12 +594,22 @@ rb_time_magnify(VALUE v)
|
|||||||
#else
|
#else
|
||||||
long a, b, c;
|
long a, b, c;
|
||||||
a = FIX2LONG(v);
|
a = FIX2LONG(v);
|
||||||
if (a == 0)
|
if (a == 0) {
|
||||||
return x;
|
#if WIDEINT_IS_UINT64
|
||||||
|
WIDEVAL_SET(ret, INT64toFIXWV(0));
|
||||||
|
#else
|
||||||
|
WIDEVAL_SET(ret, INT2FIX(0));
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
b = TIME_SCALE;
|
b = TIME_SCALE;
|
||||||
c = a * b;
|
c = a * b;
|
||||||
if (c / a == b) {
|
if (c / a == b) {
|
||||||
|
#if WIDEINT_IS_UINT64
|
||||||
WIDEVAL_SET(ret, INT64toFIXWV(c));
|
WIDEVAL_SET(ret, INT64toFIXWV(c));
|
||||||
|
#else
|
||||||
|
WIDEVAL_SET(ret, LONG2NUM(c));
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user