diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-29 05:24:28 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-29 05:24:28 +0000 |
commit | f984d0782bdd4efeea8f18eae6ba00f8a713f093 (patch) | |
tree | 745c6509e31015c9e80c5a7d3356f81a9a196157 /numeric.c | |
parent | 9970b96af2388eeda481469dac0d03c1fddf549a (diff) |
merge revision(s) 39594,39596: [Backport #8010]
* enumerator.c (enumerator_with_index_i): allow Bignum as offset, to
get rid of conversion exception and integer overflow.
[ruby-dev:47131] [Bug #8010]
* enumerator.c (enumerator_with_index): Restore handling of a nil memo
from r39594.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -2173,8 +2173,8 @@ fix_succ(VALUE num) * (-1).next #=> 0 */ -static VALUE -int_succ(VALUE num) +VALUE +rb_int_succ(VALUE num) { if (FIXNUM_P(num)) { long i = FIX2LONG(num) + 1; @@ -2183,6 +2183,8 @@ int_succ(VALUE num) return rb_funcall(num, '+', 1, INT2FIX(1)); } +#define int_succ rb_int_succ + /* * call-seq: * int.pred -> integer @@ -2193,8 +2195,8 @@ int_succ(VALUE num) * (-1).pred #=> -2 */ -static VALUE -int_pred(VALUE num) +VALUE +rb_int_pred(VALUE num) { if (FIXNUM_P(num)) { long i = FIX2LONG(num) - 1; @@ -2203,6 +2205,8 @@ int_pred(VALUE num) return rb_funcall(num, '-', 1, INT2FIX(1)); } +#define int_pred rb_int_pred + VALUE rb_enc_uint_chr(unsigned int code, rb_encoding *enc) { |