* time.c (rb_time_timeval, rb_time_timespec): typed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
913fdf25bc
commit
fe963a4510
4
time.c
4
time.c
@ -1647,7 +1647,7 @@ rb_time_timeval(VALUE time)
|
||||
struct timeval t;
|
||||
struct timespec ts;
|
||||
|
||||
if (TYPE(time) == T_DATA && RDATA(time)->dfree == time_free) {
|
||||
if (IsTimeval(time)) {
|
||||
GetTimeval(time, tobj);
|
||||
ts = timexv2timespec(tobj->timexv);
|
||||
t.tv_sec = (TYPEOF_TIMEVAL_TV_SEC)ts.tv_sec;
|
||||
@ -1663,7 +1663,7 @@ rb_time_timespec(VALUE time)
|
||||
struct time_object *tobj;
|
||||
struct timespec t;
|
||||
|
||||
if (TYPE(time) == T_DATA && RDATA(time)->dfree == time_free) {
|
||||
if (IsTimeval(time)) {
|
||||
GetTimeval(time, tobj);
|
||||
t = timexv2timespec(tobj->timexv);
|
||||
return t;
|
||||
|
Loading…
x
Reference in New Issue
Block a user