From a45cd8a01ce1d51cd124f0f87d9d56b6d3d60da8 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 22 May 2008 16:19:14 +0000 Subject: * eval.c, eval_intern.h, include/ruby/intern.h, include/ruby/ruby.h, vm.c, vm_core.h, vm_insnhelper.c: remove pointless "const". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 103 ++++++++++++++++++++++++++------------------------------ 1 file changed, 47 insertions(+), 56 deletions(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 9fb2631db4..bf9ded1313 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -21,10 +21,10 @@ #endif static inline rb_control_frame_t * -vm_push_frame(rb_thread_t * const th, const rb_iseq_t * const iseq, - const VALUE type, const VALUE self, const VALUE specval, - const VALUE * const pc, VALUE *sp, VALUE *lfp, - int const local_size) +vm_push_frame(rb_thread_t * th, const rb_iseq_t * iseq, + VALUE type, VALUE self, VALUE specval, + const VALUE *pc, VALUE *sp, VALUE *lfp, + int local_size) { rb_control_frame_t * const cfp = th->cfp = th->cfp - 1; int i; @@ -70,7 +70,7 @@ vm_push_frame(rb_thread_t * const th, const rb_iseq_t * const iseq, } static inline void -vm_pop_frame(rb_thread_t * const th) +vm_pop_frame(rb_thread_t *th) { #if COLLECT_PROFILE rb_control_frame_t *cfp = th->cfp; @@ -99,9 +99,8 @@ vm_pop_frame(rb_thread_t * const th) /* method dispatch */ static inline int -vm_callee_setup_arg(rb_thread_t * const th, const rb_iseq_t * const iseq, - const int orig_argc, VALUE * const orig_argv, - rb_block_t ** const block) +vm_callee_setup_arg(rb_thread_t *th, const rb_iseq_t * iseq, + int orig_argc, VALUE * orig_argv, rb_block_t **block) { const int m = iseq->argc; @@ -174,7 +173,7 @@ vm_callee_setup_arg(rb_thread_t * const th, const rb_iseq_t * const iseq, /* block arguments */ if (block && iseq->arg_block != -1) { VALUE blockval = Qnil; - rb_block_t * const blockptr = *block; + const rb_block_t *blockptr = *block; if (argc != 0) { rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", @@ -205,9 +204,8 @@ vm_callee_setup_arg(rb_thread_t * const th, const rb_iseq_t * const iseq, } static inline int -caller_setup_args(const rb_thread_t * const th, - rb_control_frame_t * const cfp, const VALUE flag, int argc, - rb_iseq_t * const blockiseq, rb_block_t ** const block) +caller_setup_args(const rb_thread_t *th, rb_control_frame_t *cfp, VALUE flag, + int argc, rb_iseq_t *blockiseq, rb_block_t **block) { rb_block_t *blockptr = 0; @@ -270,8 +268,8 @@ caller_setup_args(const rb_thread_t * const th, } static inline VALUE -call_cfunc(VALUE (* const func)(), const VALUE recv, - const int len, const int argc, const VALUE * const argv) +call_cfunc(VALUE (*func)(), VALUE recv, + int len, int argc, const VALUE *argv) { /* printf("len: %d, argc: %d\n", len, argc); */ @@ -358,9 +356,9 @@ call_cfunc(VALUE (* const func)(), const VALUE recv, } static inline VALUE -vm_call_cfunc(rb_thread_t * const th, rb_control_frame_t * const reg_cfp, - const int num, const ID id, const VALUE recv, const VALUE klass, - const VALUE flag, const NODE * const mn, const rb_block_t * const blockptr) +vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp, + int num, ID id, VALUE recv, VALUE klass, + VALUE flag, const NODE *mn, const rb_block_t *blockptr) { VALUE val; @@ -388,7 +386,7 @@ vm_call_cfunc(rb_thread_t * const th, rb_control_frame_t * const reg_cfp, } static inline int -vm_cfunc_flags(const rb_control_frame_t * const cfp) +vm_cfunc_flags(const rb_control_frame_t *cfp) { if (RUBYVM_CFUNC_FRAME_P(cfp)) return cfp->flag >> FRAME_MAGIC_MASK_BITS; @@ -396,9 +394,8 @@ vm_cfunc_flags(const rb_control_frame_t * const cfp) } static inline VALUE -vm_call_bmethod(rb_thread_t * const th, const ID id, const VALUE procval, - const VALUE recv, const VALUE klass, const int argc, VALUE *argv, - rb_block_t * const blockptr) +vm_call_bmethod(rb_thread_t *th, ID id, VALUE procval, VALUE recv, + VALUE klass, int argc, VALUE *argv, rb_block_t *blockptr) { rb_control_frame_t *cfp = th->cfp; rb_proc_t *proc; @@ -414,8 +411,8 @@ vm_call_bmethod(rb_thread_t * const th, const ID id, const VALUE procval, } static inline VALUE -vm_method_missing(rb_thread_t * const th, const ID id, const VALUE recv, - const int num, rb_block_t * const blockptr, const int opt) +vm_method_missing(rb_thread_t *th, ID id, VALUE recv, + int num, rb_block_t *blockptr, int opt) { rb_control_frame_t * const reg_cfp = th->cfp; VALUE *argv = STACK_ADDR_FROM_TOP(num + 1); @@ -651,8 +648,8 @@ block_proc_is_lambda(const VALUE procval) } static inline VALUE -vm_yield_with_cfunc(rb_thread_t *const th, rb_block_t * const block, - const VALUE self, const int argc, const VALUE * const argv) +vm_yield_with_cfunc(rb_thread_t *th, rb_block_t *block, + VALUE self, int argc, const VALUE *argv) { NODE *ifunc = (NODE *) block->iseq; VALUE val; @@ -680,9 +677,9 @@ vm_yield_with_cfunc(rb_thread_t *const th, rb_block_t * const block, } static inline int -vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t * const iseq, - const int orig_argc, VALUE * const argv, - rb_block_t *blockptr, const int lambda) +vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t *iseq, + int orig_argc, VALUE *argv, + rb_block_t *blockptr, int lambda) { if (0) { /* for debug */ printf(" argc: %d\n", orig_argc); @@ -799,8 +796,7 @@ vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t * const iseq, } static VALUE -vm_invoke_block(rb_thread_t * const th, rb_control_frame_t *const reg_cfp, - const rb_num_t num, const rb_num_t flag) +vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_num_t num, rb_num_t flag) { rb_block_t * const block = GET_BLOCK_PTR(); rb_iseq_t *iseq; @@ -840,7 +836,7 @@ vm_invoke_block(rb_thread_t * const th, rb_control_frame_t *const reg_cfp, /* svar */ static inline NODE * -lfp_svar_place(rb_thread_t * const th, VALUE * const lfp) +lfp_svar_place(rb_thread_t *th, VALUE *lfp) { NODE *svar; @@ -862,7 +858,7 @@ lfp_svar_place(rb_thread_t * const th, VALUE * const lfp) } static VALUE -lfp_svar_get(rb_thread_t * const th, VALUE * const lfp, const VALUE key) +lfp_svar_get(rb_thread_t *th, VALUE *lfp, VALUE key) { NODE *svar = lfp_svar_place(th, lfp); @@ -885,8 +881,7 @@ lfp_svar_get(rb_thread_t * const th, VALUE * const lfp, const VALUE key) } static void -lfp_svar_set(rb_thread_t * const th, VALUE * const lfp, - const VALUE key, const VALUE val) +lfp_svar_set(rb_thread_t *th, VALUE *lfp, VALUE key, VALUE val) { NODE *svar = lfp_svar_place(th, lfp); @@ -909,8 +904,7 @@ lfp_svar_set(rb_thread_t * const th, VALUE * const lfp, } static inline VALUE -vm_getspecial(rb_thread_t * const th, VALUE * const lfp, - const VALUE key, const rb_num_t type) +vm_getspecial(rb_thread_t *th, VALUE *lfp, VALUE key, rb_num_t type) { VALUE val; @@ -950,8 +944,7 @@ vm_getspecial(rb_thread_t * const th, VALUE * const lfp, } static NODE * -vm_get_cref(const rb_iseq_t * const iseq, - const VALUE * const lfp, const VALUE *dfp) +vm_get_cref(const rb_iseq_t *iseq, const VALUE *lfp, const VALUE *dfp) { NODE *cref = 0; @@ -975,7 +968,7 @@ vm_get_cref(const rb_iseq_t * const iseq, static inline void -vm_check_if_namespace(const VALUE klass) +vm_check_if_namespace(VALUE klass) { switch (TYPE(klass)) { case T_CLASS: @@ -988,14 +981,14 @@ vm_check_if_namespace(const VALUE klass) } static inline VALUE -vm_get_ev_const(rb_thread_t * const th, const rb_iseq_t * const iseq, - const VALUE orig_klass, const ID id, const int is_defined) +vm_get_ev_const(rb_thread_t *th, const rb_iseq_t *iseq, + VALUE orig_klass, ID id, int is_defined) { VALUE val; if (orig_klass == Qnil) { /* in current lexical scope */ - const NODE * const root_cref = vm_get_cref(iseq, th->cfp->lfp, th->cfp->dfp); + const NODE *root_cref = vm_get_cref(iseq, th->cfp->lfp, th->cfp->dfp); const NODE *cref = root_cref; VALUE klass = orig_klass; @@ -1069,9 +1062,8 @@ vm_get_cvar_base(NODE *cref) } static inline void -vm_define_method(rb_thread_t * const th, const VALUE obj, const ID id, - rb_iseq_t * const miseq, const rb_num_t is_singleton, - NODE * const cref) +vm_define_method(rb_thread_t *th, VALUE obj, ID id, rb_iseq_t *miseq, + rb_num_t is_singleton, NODE *cref) { NODE *newbody; VALUE klass = cref->nd_clss; @@ -1110,7 +1102,7 @@ vm_define_method(rb_thread_t * const th, const VALUE obj, const ID id, } static inline NODE * -vm_method_search(const VALUE id, const VALUE klass, const IC ic) +vm_method_search(VALUE id, VALUE klass, IC ic) { NODE *mn; @@ -1134,7 +1126,7 @@ vm_method_search(const VALUE id, const VALUE klass, const IC ic) } static inline VALUE -vm_search_normal_superclass(VALUE klass, const VALUE recv) +vm_search_normal_superclass(VALUE klass, VALUE recv) { if (BUILTIN_TYPE(klass) == T_CLASS) { klass = RCLASS_SUPER(klass); @@ -1153,9 +1145,9 @@ vm_search_normal_superclass(VALUE klass, const VALUE recv) } static void -vm_search_superclass(rb_control_frame_t *const reg_cfp, rb_iseq_t * ip, - const VALUE recv, const VALUE sigval, - ID * const idp, VALUE * const klassp) +vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *ip, + VALUE recv, VALUE sigval, + ID *idp, VALUE *klassp) { ID id; VALUE klass; @@ -1201,8 +1193,8 @@ vm_search_superclass(rb_control_frame_t *const reg_cfp, rb_iseq_t * ip, } static VALUE -vm_throw(rb_thread_t *const th, rb_control_frame_t * const reg_cfp, - const rb_num_t throw_state, const VALUE throwobj) +vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp, + rb_num_t throw_state, VALUE throwobj) { rb_num_t state = throw_state & 0xff; rb_num_t flag = throw_state & 0x8000; @@ -1347,8 +1339,7 @@ vm_throw(rb_thread_t *const th, rb_control_frame_t * const reg_cfp, } static inline void -vm_expandarray(rb_control_frame_t * const cfp, VALUE ary, - const int num, const int flag) +vm_expandarray(rb_control_frame_t *cfp, VALUE ary, int num, int flag) { int is_splat = flag & 0x01; int space_size = num + is_splat; @@ -1409,7 +1400,7 @@ vm_expandarray(rb_control_frame_t * const cfp, VALUE ary, } static inline int -check_cfunc(const NODE * const mn, const void * const func) +check_cfunc(const NODE *mn, const void *func) { if (mn && nd_type(mn->nd_body) == NODE_CFUNC && mn->nd_body->nd_cfnc == func) { @@ -1421,7 +1412,7 @@ check_cfunc(const NODE * const mn, const void * const func) } static inline VALUE -opt_eq_func(const VALUE recv, const VALUE obj, const IC ic) +opt_eq_func(VALUE recv, VALUE obj, IC ic) { VALUE val = Qundef; -- cgit v1.2.3