ruby-changes:36794
From: nobu <ko1@a...>
Date: Wed, 17 Dec 2014 12:08:29 +0900 (JST)
Subject: [ruby-changes:36794] nobu:r48875 (trunk): vm.c: constify
nobu 2014-12-17 12:08:20 +0900 (Wed, 17 Dec 2014) New Revision: 48875 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48875 Log: vm.c: constify * vm.c (rb_vm_get_binding_creatable_next_cfp): constify arguments. (rb_vm_get_ruby_level_next_cfp): ditto. (vm_get_ruby_level_caller_cfp): ditto. Modified files: trunk/vm.c trunk/vm_core.h trunk/vm_insnhelper.c Index: vm_core.h =================================================================== --- vm_core.h (revision 48874) +++ vm_core.h (revision 48875) @@ -988,8 +988,8 @@ rb_vm_living_threads_remove(rb_vm_t *vm, https://github.com/ruby/ruby/blob/trunk/vm_core.h#L988 int ruby_thread_has_gvl_p(void); typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE); -rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp); -rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp); +rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp); +rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp); int rb_vm_get_sourceline(const rb_control_frame_t *); VALUE rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method); void rb_vm_stack_to_heap(rb_thread_t *th); Index: vm.c =================================================================== --- vm.c (revision 48874) +++ vm.c (revision 48875) @@ -231,7 +231,7 @@ vm_set_main_stack(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/vm.c#L231 } rb_control_frame_t * -rb_vm_get_binding_creatable_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp) +rb_vm_get_binding_creatable_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp) { while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) { if (cfp->iseq) { @@ -243,7 +243,7 @@ rb_vm_get_binding_creatable_next_cfp(rb_ https://github.com/ruby/ruby/blob/trunk/vm.c#L243 } rb_control_frame_t * -rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp) +rb_vm_get_ruby_level_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp) { while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) { if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) { @@ -255,17 +255,17 @@ rb_vm_get_ruby_level_next_cfp(rb_thread_ https://github.com/ruby/ruby/blob/trunk/vm.c#L255 } static rb_control_frame_t * -vm_get_ruby_level_caller_cfp(rb_thread_t *th, rb_control_frame_t *cfp) +vm_get_ruby_level_caller_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp) { if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) { - return cfp; + return (rb_control_frame_t *)cfp; } cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp); while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) { if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) { - return cfp; + return (rb_control_frame_t *)cfp; } if ((cfp->flag & VM_FRAME_FLAG_PASSED) == 0) { Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 48874) +++ vm_insnhelper.c (revision 48875) @@ -22,7 +22,8 @@ https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L22 #define INLINE inline #endif -static rb_control_frame_t *vm_get_ruby_level_caller_cfp(rb_thread_t *th, rb_control_frame_t *cfp); +static rb_control_frame_t * +vm_get_ruby_level_caller_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp); VALUE ruby_vm_sysstack_error_copy(void) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/