mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* time.c (time_timeval): wrong cast to time_t.
* time.c (time_plus): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0a45dee5a5
commit
4282698219
2 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Dec 22 22:52:14 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* time.c (time_timeval): wrong cast to time_t.
|
||||
|
||||
* time.c (time_plus): ditto.
|
||||
|
||||
Fri Dec 21 20:33:34 2001 K.Kosako <kosako@sofnec.co.jp>
|
||||
|
||||
* parse.y (str_extend): make up "#$;" handling.
|
||||
|
|
10
time.c
10
time.c
|
@ -140,7 +140,7 @@ time_timeval(time, interval)
|
|||
if (f != t.tv_sec) {
|
||||
rb_raise(rb_eRangeError, "%f out of Time range", RFLOAT(time)->value);
|
||||
}
|
||||
t.tv_usec = (time_t)d*1e6;
|
||||
t.tv_usec = (time_t)(d*1e6);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -953,7 +953,7 @@ time_plus(time1, time2)
|
|||
v = NUM2DBL(time2);
|
||||
d = modf(v, &f);
|
||||
sec = (time_t)f;
|
||||
if (f != (double)sec || d >= 1.0 || d <= -1.0) {
|
||||
if (f != (double)sec) {
|
||||
rb_raise(rb_eRangeError, "time + %f out of Time range", v);
|
||||
}
|
||||
#ifndef NEGATIVE_TIME_T
|
||||
|
@ -961,7 +961,7 @@ time_plus(time1, time2)
|
|||
rb_raise(rb_eArgError, "time must be positive");
|
||||
}
|
||||
#endif
|
||||
usec = tobj->tv.tv_usec + (time_t)d*1e6;
|
||||
usec = tobj->tv.tv_usec + (time_t)(d*1e6);
|
||||
sec = tobj->tv.tv_sec + (time_t)f;
|
||||
|
||||
#ifdef NEGATIVE_TIME_T
|
||||
|
@ -1000,7 +1000,7 @@ time_minus(time1, time2)
|
|||
v = NUM2DBL(time2);
|
||||
d = modf(v, &f);
|
||||
sec = (time_t)f;
|
||||
if (f != (double)sec || d >= 1.0 || d <= -1.0) {
|
||||
if (f != (double)sec) {
|
||||
rb_raise(rb_eRangeError, "time - %f out of Time range", v);
|
||||
}
|
||||
#ifndef NEGATIVE_TIME_T
|
||||
|
@ -1401,7 +1401,7 @@ time_load(klass, str)
|
|||
tm.tm_isdst = 0;
|
||||
|
||||
sec = make_time_t(&tm, Qtrue);
|
||||
usec = (time_t) s & 0xfffff;
|
||||
usec = (time_t)(s & 0xfffff);
|
||||
|
||||
return time_new_internal(klass, sec, usec);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue