diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 15:31:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 15:31:05 +0000 |
commit | e66470a106108a591b52e708e95d36ab13e83b25 (patch) | |
tree | c32b111f28816ba359a858e720a2205507b57ec7 /range.c | |
parent | 48eafcbc49cc216cd624530b4b7a721a2d768bdc (diff) | |
download | ruby-e66470a106108a591b52e708e95d36ab13e83b25.tar.gz |
* range.c (discrete_object_p): needs the argument type to get rid
of truncation on platforms where VALUE is larger than int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -309,11 +309,10 @@ step_i(VALUE i, void *arg) extern int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl); static int -discrete_object_p(obj) +discrete_object_p(VALUE obj) { - if (rb_obj_is_kind_of(obj, rb_cTime)) return Qfalse; /* until Time#succ removed */ - if (rb_respond_to(obj, id_succ)) return Qtrue; - return Qfalse; + if (rb_obj_is_kind_of(obj, rb_cTime)) return FALSE; /* until Time#succ removed */ + return rb_respond_to(obj, id_succ); } |