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:
parent
033a32b4c1
commit
f79e9281ff
2 changed files with 11 additions and 2 deletions
|
@ -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>
|
Fri Apr 11 16:44:43 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* enum.c (enum_find_index): Add support for find_index(obj);
|
* enum.c (enum_find_index): Add support for find_index(obj);
|
||||||
|
|
7
enum.c
7
enum.c
|
@ -186,8 +186,10 @@ enum_find(int argc, VALUE *argv, VALUE obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
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])) {
|
if (rb_equal(i, memo[2])) {
|
||||||
memo[0] = UINT2NUM(memo[1]);
|
memo[0] = UINT2NUM(memo[1]);
|
||||||
rb_iter_break();
|
rb_iter_break();
|
||||||
|
@ -197,8 +199,9 @@ find_index_i(VALUE i, VALUE *memo)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
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))) {
|
if (RTEST(enum_yield(argc, argv))) {
|
||||||
memo[0] = UINT2NUM(memo[1]);
|
memo[0] = UINT2NUM(memo[1]);
|
||||||
rb_iter_break();
|
rb_iter_break();
|
||||||
|
|
Loading…
Add table
Reference in a new issue