зеркало из https://github.com/github/ruby.git
* enumerator.c (enumerator_block_call): use PARRAY_CONST_PTR()
instead of RARRAY_PTR(). * io.c (rb_io_s_popen): ditto. * numeric.c (num_step_size): ditto. * vm_eval.c (rb_apply): ditto. * vm_eval.c (rb_eval_cmd): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
664ee1a89f
Коммит
57e557908a
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
Mon Mar 17 13:17:47 2014 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* enumerator.c (enumerator_block_call): use PARRAY_CONST_PTR()
|
||||
instead of RARRAY_PTR().
|
||||
|
||||
* io.c (rb_io_s_popen): ditto.
|
||||
|
||||
* numeric.c (num_step_size): ditto.
|
||||
|
||||
* vm_eval.c (rb_apply): ditto.
|
||||
|
||||
* vm_eval.c (rb_eval_cmd): ditto.
|
||||
|
||||
Mon Mar 17 10:11:59 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* variable.c (rb_const_set): delete existing entry on redefinition
|
||||
|
|
|
@ -422,13 +422,13 @@ static VALUE
|
|||
enumerator_block_call(VALUE obj, rb_block_call_func *func, VALUE arg)
|
||||
{
|
||||
int argc = 0;
|
||||
VALUE *argv = 0;
|
||||
const VALUE *argv = 0;
|
||||
const struct enumerator *e = enumerator_ptr(obj);
|
||||
ID meth = e->meth;
|
||||
|
||||
if (e->args) {
|
||||
argc = RARRAY_LENINT(e->args);
|
||||
argv = RARRAY_PTR(e->args);
|
||||
argv = RARRAY_CONST_PTR(e->args);
|
||||
}
|
||||
return rb_block_call(e->obj, meth, argc, argv, func, arg);
|
||||
}
|
||||
|
|
2
io.c
2
io.c
|
@ -6227,7 +6227,7 @@ rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
|
|||
#endif
|
||||
tmp = rb_ary_dup(tmp);
|
||||
RBASIC_CLEAR_CLASS(tmp);
|
||||
execarg_obj = rb_execarg_new((int)len, RARRAY_PTR(tmp), FALSE);
|
||||
execarg_obj = rb_execarg_new((int)len, RARRAY_CONST_PTR(tmp), FALSE);
|
||||
rb_ary_clear(tmp);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1889,7 +1889,7 @@ num_step_size(VALUE from, VALUE args, VALUE eobj)
|
|||
VALUE to, step, hash;
|
||||
int desc;
|
||||
int argc = args ? RARRAY_LENINT(args) : 0;
|
||||
VALUE *argv = args ? RARRAY_PTR(args) : 0;
|
||||
const VALUE *argv = args ? RARRAY_CONST_PTR(args) : 0;
|
||||
|
||||
NUM_STEP_SCAN_ARGS(argc, argv, to, step, hash, desc);
|
||||
|
||||
|
|
|
@ -751,7 +751,7 @@ rb_apply(VALUE recv, ID mid, VALUE args)
|
|||
args = rb_ary_subseq(args, 0, argc);
|
||||
RBASIC_CLEAR_CLASS(args);
|
||||
OBJ_FREEZE(args);
|
||||
ret = rb_call(recv, mid, argc, RARRAY_PTR(args), CALL_FCALL);
|
||||
ret = rb_call(recv, mid, argc, RARRAY_CONST_PTR(args), CALL_FCALL);
|
||||
RB_GC_GUARD(args);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1482,7 +1482,7 @@ rb_eval_cmd(VALUE cmd, VALUE arg, int level)
|
|||
rb_set_safe_level_force(level);
|
||||
if ((state = EXEC_TAG()) == 0) {
|
||||
val = rb_funcall2(cmd, rb_intern("call"), RARRAY_LENINT(arg),
|
||||
RARRAY_PTR(arg));
|
||||
RARRAY_CONST_PTR(arg));
|
||||
}
|
||||
POP_TAG();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче