summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-31 05:29:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-31 05:29:54 +0000
commite0009b6a5437c5427a6abf3ddeee3804f73b9870 (patch)
tree0ed5e86f76f9adff8eb848d6be67500adb86edd2 /time.c
parent5b3ed19660ef4d9ea87265416a199e7dc7e940c1 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/time.c b/time.c
index 3fb535e..78863e0 100644
--- a/time.c
+++ b/time.c
@@ -105,9 +105,10 @@ rb_time_new(sec, usec)
return time_new_internal(rb_cTime, sec, usec);
}
-struct timeval
-rb_time_interval(time)
+static struct timeval
+time_timeval(time, interval)
VALUE time;
+ int interval;
{
struct timeval t;
@@ -134,14 +135,22 @@ rb_time_interval(time)
break;
default:
- rb_raise(rb_eTypeError, "can't convert %s into Time interval",
- rb_class2name(CLASS_OF(time)));
+ rb_raise(rb_eTypeError, "can't convert %s into Time%s",
+ rb_class2name(CLASS_OF(time)),
+ interval ? " interval" : "");
break;
}
return t;
}
struct timeval
+rb_time_interval(time)
+ VALUE time;
+{
+ return time_timeval(time, Qtrue);
+}
+
+struct timeval
rb_time_timeval(time)
VALUE time;
{
@@ -153,7 +162,7 @@ rb_time_timeval(time)
t = tobj->tv;
return t;
}
- return rb_time_interval(time);
+ return time_timeval(time, Qfalse);
}
static VALUE