ruby-changes:50991
From: k0kubun <ko1@a...>
Date: Fri, 20 Apr 2018 01:19:53 +0900 (JST)
Subject: [ruby-changes:50991] k0kubun:r63198 (trunk): internal.h: use the same declaration as definition
k0kubun 2018-04-20 01:19:48 +0900 (Fri, 20 Apr 2018) New Revision: 63198 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63198 Log: internal.h: use the same declaration as definition range.c: cast the function type to meet the declaration This change is for fixing build error on AppVeyor: https://ci.appveyor.com/project/ruby/ruby/build/1.0.8177 string.c ../string.c(4330) : error C4028: formal parameter 2 different from declaration Modified files: trunk/internal.h trunk/range.c Index: range.c =================================================================== --- range.c (revision 63197) +++ range.c (revision 63198) @@ -432,7 +432,7 @@ range_step(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/range.c#L432 iter[1] = step; if (NIL_P(e)) { - rb_str_upto_endless_each(rb_sym2str(b), sym_step_i, (VALUE)iter); + rb_str_upto_endless_each(rb_sym2str(b), (VALUE (*)(VALUE, VALUE))sym_step_i, (VALUE)iter); } else { args[0] = rb_sym2str(e); @@ -467,7 +467,7 @@ range_step(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/range.c#L467 iter[1] = step; if (NIL_P(e)) { - rb_str_upto_endless_each(b, step_i, (VALUE)iter); + rb_str_upto_endless_each(b, (VALUE (*)(VALUE, VALUE))step_i, (VALUE)iter); } else { args[0] = e; @@ -836,7 +836,7 @@ range_each(VALUE range) https://github.com/ruby/ruby/blob/trunk/range.c#L836 rb_block_call(tmp, rb_intern("upto"), 2, args, each_i, 0); } else if (RB_TYPE_P(beg, T_STRING)) { - rb_str_upto_endless_each(beg, each_i, 0); + rb_str_upto_endless_each(beg, (VALUE (*)(VALUE, VALUE))each_i, 0); } else goto inf_loop; } Index: internal.h =================================================================== --- internal.h (revision 63197) +++ internal.h (revision 63198) @@ -2013,7 +2013,7 @@ VALUE rb_gcd_gmp(VALUE x, VALUE y); https://github.com/ruby/ruby/blob/trunk/internal.h#L2013 /* internal use */ VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc); #endif -VALUE rb_str_upto_endless_each(VALUE, VALUE (*each)(), VALUE); +VALUE rb_str_upto_endless_each(VALUE, VALUE (*each)(VALUE, VALUE), VALUE); /* thread.c (export) */ int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/