summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-20 06:20:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-20 06:20:35 +0000
commit4dd5679cbbac110f741a16ad7ca49e985f9fae82 (patch)
tree3e1e182d71267d83d37a5d3cb2dd924997a956c3 /time.c
parent5a1e96b22aa6759bde56ff9667759b44e9f6fa28 (diff)
1.1b9_12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/time.c b/time.c
index bd13cdceb3..93011ff241 100644
--- a/time.c
+++ b/time.c
@@ -171,10 +171,10 @@ time_arg(argc, argv, args)
rb_scan_args(argc, argv, "15", &v[0],&v[1],&v[2],&v[3],&v[4],&v[5]);
}
- args[0] = NUM2INT(v[0]);
+ args[0] = rb_obj2int(v[0]);
if (args[0] < 70) args[0] += 100;
if (args[0] > 1900) args[0] -= 1900;
- if (v[1] == Qnil) {
+ if (NIL_P(v[1])) {
args[1] = 0;
}
else if (TYPE(v[1]) == T_STRING) {
@@ -189,25 +189,25 @@ time_arg(argc, argv, args)
char c = RSTRING(v[1])->ptr[0];
if ('0' <= c && c <= '9') {
- args[1] = NUM2INT(v[1])-1;
+ args[1] = rb_obj2int(v[1])-1;
}
}
}
else {
- args[1] = NUM2INT(v[1]) - 1;
+ args[1] = rb_obj2int(v[1]) - 1;
}
- if (v[2] == Qnil) {
+ if (NIL_P(v[2])) {
args[2] = 1;
}
else {
- args[2] = NUM2INT(v[2]);
+ args[2] = rb_obj2int(v[2]);
}
for (i=3;i<6;i++) {
- if (v[i] == Qnil) {
+ if (NIL_P(v[i])) {
args[i] = 0;
}
else {
- args[i] = NUM2INT(v[i]);
+ args[i] = rb_obj2int(v[i]);
}
}