summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-23 13:02:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-23 13:02:12 +0000
commit4a0bb2dc4879f4b2f945af4b9e2ff847e0075ee6 (patch)
treeb3875b8208feb101a7bc3f624abdad7e38b9cdce /time.c
parent8d31e446208992e07bac91435fc72e6d5c88794f (diff)
* time.c (time_timespec): use NUM2TIMET.
(time_s_at): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/time.c b/time.c
index 59da26b0b1..588d4fafba 100644
--- a/time.c
+++ b/time.c
@@ -192,7 +192,7 @@ time_timespec(VALUE num, int interval)
switch (TYPE(num)) {
case T_FIXNUM:
- t.tv_sec = FIX2LONG(num);
+ t.tv_sec = NUM2TIMET(num);
if (interval && t.tv_sec < 0)
rb_raise(rb_eArgError, "%s must be positive", tstr);
t.tv_nsec = 0;
@@ -218,7 +218,7 @@ time_timespec(VALUE num, int interval)
break;
case T_BIGNUM:
- t.tv_sec = NUM2LONG(num);
+ t.tv_sec = NUM2TIMET(num);
if (interval && t.tv_sec < 0)
rb_raise(rb_eArgError, "%s must be positive", tstr);
t.tv_nsec = 0;
@@ -232,7 +232,7 @@ time_timespec(VALUE num, int interval)
}
i = rb_ary_entry(ary, 0);
f = rb_ary_entry(ary, 1);
- t.tv_sec = NUM2LONG(i);
+ t.tv_sec = NUM2TIMET(i);
if (interval && t.tv_sec < 0)
rb_raise(rb_eArgError, "%s must be positive", tstr);
f = rb_funcall(f, id_mul, 1, INT2FIX(1000000000));
@@ -324,7 +324,7 @@ time_s_at(int argc, VALUE *argv, VALUE klass)
VALUE time, t;
if (rb_scan_args(argc, argv, "11", &time, &t) == 2) {
- ts.tv_sec = NUM2LONG(time);
+ ts.tv_sec = NUM2TIMET(time);
ts.tv_nsec = NUM2LONG(rb_funcall(t, id_mul, 1, INT2FIX(1000)));
}
else {