diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-30 08:32:43 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-30 08:32:43 +0000 |
| commit | 8aee5c01add6bdc95a29601be119009932ab1d89 (patch) | |
| tree | fc87e04eb81b1a9b735d3c2ce7ec153cee902dfd /time.c | |
| parent | fc664d40132ce5f621f83c3178e90b7b73a612e6 (diff) | |
| download | ruby-8aee5c01add6bdc95a29601be119009932ab1d89.tar.gz ruby-8aee5c01add6bdc95a29601be119009932ab1d89.tar.xz ruby-8aee5c01add6bdc95a29601be119009932ab1d89.zip | |
* time.c (rb_time_succ): make Time#succ obsolete since time is not
a discrete value.
* range.c (discrete_object_p): treat time objects specially to
determine discrete values, since time objects have #succ yet are
discrete (for now at least).
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
| -rw-r--r-- | time.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -2948,17 +2948,19 @@ time_minus(VALUE time1, VALUE time2) * time.succ => new_time * * Return a new time object, one second later than <code>time</code>. + * Time#succ is obsolete since 1.9.2 for time is not a discrete value. * * t = Time.now #=> 2007-11-19 08:23:57 -0600 * t.succ #=> 2007-11-19 08:23:58 -0600 */ -static VALUE -time_succ(VALUE time) +VALUE +rb_time_succ(VALUE time) { struct time_object *tobj; struct time_object *tobj2; + rb_warn("Time#succ is obsolete; use time + 1"); GetTimeval(time, tobj); time = time_new_timexv(rb_cTime, add(tobj->timexv, INT2FIX(TIME_SCALE))); GetTimeval(time, tobj2); @@ -2966,11 +2968,8 @@ time_succ(VALUE time) return time; } -VALUE -rb_time_succ(VALUE time) -{ - return time_succ(time); -} +#define time_succ rb_time_succ + /* * call-seq: |
