summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--time.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 73f82e93d..9b682b0d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 23 22:01:00 2009 Tanaka Akira <akr@fsij.org>
+
+ * time.c (time_timespec): use NUM2TIMET.
+ (time_s_at): ditto.
+
Mon Mar 23 21:52:26 2009 Akinori MUSHA <knu@iDaemons.org>
* process.c (Init_process): Better patch for eliminating an
diff --git a/time.c b/time.c
index 59da26b0b..588d4fafb 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 {