diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-04-20 06:20:35 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-04-20 06:20:35 +0000 |
commit | 4dd5679cbbac110f741a16ad7ca49e985f9fae82 (patch) | |
tree | 3e1e182d71267d83d37a5d3cb2dd924997a956c3 /time.c | |
parent | 5a1e96b22aa6759bde56ff9667759b44e9f6fa28 (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.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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]); } } |