1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* enum.c (find_index_i): modified to shut warning up.

* enum.c (find_index_iter_i): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-04-11 08:06:31 +00:00
parent 033a32b4c1
commit f79e9281ff
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Fri Apr 11 17:06:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (find_index_i): modified to shut warning up.
* enum.c (find_index_iter_i): ditto.
Fri Apr 11 16:44:43 2008 Akinori MUSHA <knu@iDaemons.org>
* enum.c (enum_find_index): Add support for find_index(obj);

7
enum.c
View file

@ -186,8 +186,10 @@ enum_find(int argc, VALUE *argv, VALUE obj)
}
static VALUE
find_index_i(VALUE i, VALUE *memo)
find_index_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
VALUE *memo = (VALUE*)memop;
if (rb_equal(i, memo[2])) {
memo[0] = UINT2NUM(memo[1]);
rb_iter_break();
@ -197,8 +199,9 @@ find_index_i(VALUE i, VALUE *memo)
}
static VALUE
find_index_iter_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
VALUE *memo = (VALUE*)memop;
if (RTEST(enum_yield(argc, argv))) {
memo[0] = UINT2NUM(memo[1]);
rb_iter_break();