From 2d1c94a18de4f278e49d918d4ba03bc1dce44706 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 6 Mar 2013 06:30:03 +0000 Subject: [PATCH] prefix global symbols * iseq.c (rb_insn_operand_intern): prefix global symbols. * numeric.c (ruby_num_interval_step_size): ditto. * vm_backtrace.c (rb_vm_backtrace_str_ary), (rb_vm_backtrace_location_ary, rb_vm_thread_backtrace), (rb_vm_thread_backtrace_locations): ditto. * vm_trace.c (rb_vm_trace_mark_event_hooks): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- internal.h | 6 +++--- iseq.c | 12 ++++++------ numeric.c | 8 ++++---- range.c | 4 ++-- thread.c | 4 ++-- vm.c | 16 ++++++++-------- vm_backtrace.c | 12 ++++++------ vm_eval.c | 4 ++-- vm_trace.c | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/internal.h b/internal.h index 36bb1c90e7..bcc0b3667f 100644 --- a/internal.h +++ b/internal.h @@ -165,7 +165,7 @@ void Init_newline(void); /* numeric.c */ int rb_num_to_uint(VALUE val, unsigned int *ret); -VALUE num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl); +VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl); int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl); double ruby_float_mod(double x, double y); int rb_num_negative_p(VALUE); @@ -331,8 +331,8 @@ void Init_prelude(void); /* vm_backtrace.c */ void Init_vm_backtrace(void); -VALUE vm_thread_backtrace(int argc, VALUE *argv, VALUE thval); -VALUE vm_thread_backtrace_locations(int argc, VALUE *argv, VALUE thval); +VALUE rb_vm_thread_backtrace(int argc, VALUE *argv, VALUE thval); +VALUE rb_vm_thread_backtrace_locations(int argc, VALUE *argv, VALUE thval); VALUE rb_make_backtrace(void); void rb_backtrace_print_as_bugreport(void); diff --git a/iseq.c b/iseq.c index 15c1fe13ae..3a6e6a50ff 100644 --- a/iseq.c +++ b/iseq.c @@ -1119,9 +1119,9 @@ id_to_name(ID id, VALUE default_value) } VALUE -insn_operand_intern(rb_iseq_t *iseq, - VALUE insn, int op_no, VALUE op, - int len, size_t pos, VALUE *pnop, VALUE child) +rb_insn_operand_intern(rb_iseq_t *iseq, + VALUE insn, int op_no, VALUE op, + int len, size_t pos, VALUE *pnop, VALUE child) { const char *types = insn_op_types(insn); char type = types[op_no]; @@ -1268,9 +1268,9 @@ rb_iseq_disasm_insn(VALUE ret, VALUE *iseq, size_t pos, for (j = 0; types[j]; j++) { const char *types = insn_op_types(insn); - VALUE opstr = insn_operand_intern(iseqdat, insn, j, iseq[pos + j + 1], - len, pos, &iseq[pos + j + 2], - child); + VALUE opstr = rb_insn_operand_intern(iseqdat, insn, j, iseq[pos + j + 1], + len, pos, &iseq[pos + j + 2], + child); rb_str_concat(str, opstr); if (types[j + 1]) { diff --git a/numeric.c b/numeric.c index 6b6b527a13..c735e5437d 100644 --- a/numeric.c +++ b/numeric.c @@ -1811,7 +1811,7 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl) } VALUE -num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl) +ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl) { if (FIXNUM_P(from) && FIXNUM_P(to) && FIXNUM_P(step)) { long delta, diff, result; @@ -1847,7 +1847,7 @@ num_step_size(VALUE from, VALUE args) { VALUE to = RARRAY_PTR(args)[0]; VALUE step = (RARRAY_LEN(args) > 1) ? RARRAY_PTR(args)[1] : INT2FIX(1); - return num_interval_step_size(from, to, step, FALSE); + return ruby_num_interval_step_size(from, to, step, FALSE); } /* * call-seq: @@ -3466,7 +3466,7 @@ fix_size(VALUE fix) static VALUE int_upto_size(VALUE from, VALUE args) { - return num_interval_step_size(from, RARRAY_PTR(args)[0], INT2FIX(1), FALSE); + return ruby_num_interval_step_size(from, RARRAY_PTR(args)[0], INT2FIX(1), FALSE); } /* @@ -3513,7 +3513,7 @@ int_upto(VALUE from, VALUE to) static VALUE int_downto_size(VALUE from, VALUE args) { - return num_interval_step_size(from, RARRAY_PTR(args)[0], INT2FIX(-1), FALSE); + return ruby_num_interval_step_size(from, RARRAY_PTR(args)[0], INT2FIX(-1), FALSE); } /* diff --git a/range.c b/range.c index dd94e8d747..1e4347ed2f 100644 --- a/range.c +++ b/range.c @@ -340,7 +340,7 @@ range_step_size(VALUE range, VALUE args) } if (rb_obj_is_kind_of(b, rb_cNumeric) && rb_obj_is_kind_of(e, rb_cNumeric)) { - return num_interval_step_size(b, e, step, EXCL(range)); + return ruby_num_interval_step_size(b, e, step, EXCL(range)); } return Qnil; } @@ -706,7 +706,7 @@ range_size(VALUE range) { VALUE b = RANGE_BEG(range), e = RANGE_END(range); if (rb_obj_is_kind_of(b, rb_cNumeric) && rb_obj_is_kind_of(e, rb_cNumeric)) { - return num_interval_step_size(b, e, INT2FIX(1), EXCL(range)); + return ruby_num_interval_step_size(b, e, INT2FIX(1), EXCL(range)); } return Qnil; } diff --git a/thread.c b/thread.c index ed6e61b040..ab3540b51b 100644 --- a/thread.c +++ b/thread.c @@ -4904,7 +4904,7 @@ rb_exec_recursive_outer(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg) static VALUE rb_thread_backtrace_m(int argc, VALUE *argv, VALUE thval) { - return vm_thread_backtrace(argc, argv, thval); + return rb_vm_thread_backtrace(argc, argv, thval); } /* call-seq: @@ -4921,7 +4921,7 @@ rb_thread_backtrace_m(int argc, VALUE *argv, VALUE thval) static VALUE rb_thread_backtrace_locations_m(int argc, VALUE *argv, VALUE thval) { - return vm_thread_backtrace_locations(argc, argv, thval); + return rb_vm_thread_backtrace_locations(argc, argv, thval); } /* diff --git a/vm.c b/vm.c index 61126cb739..91265022a7 100644 --- a/vm.c +++ b/vm.c @@ -1543,7 +1543,7 @@ vm_mark_each_thread_func(st_data_t key, st_data_t value, st_data_t dummy) return ST_CONTINUE; } -void vm_trace_mark_event_hooks(rb_hook_list_t *hooks); +void rb_vm_trace_mark_event_hooks(rb_hook_list_t *hooks); void rb_vm_mark(void *ptr) @@ -1574,7 +1574,7 @@ rb_vm_mark(void *ptr) rb_mark_tbl(vm->loading_table); } - vm_trace_mark_event_hooks(&vm->event_hooks); + rb_vm_trace_mark_event_hooks(&vm->event_hooks); for (i = 0; i < RUBY_NSIG; i++) { if (vm->trap_list[i].cmd) @@ -1845,7 +1845,7 @@ rb_thread_mark(void *ptr) sizeof(th->machine_regs) / sizeof(VALUE)); } - vm_trace_mark_event_hooks(&th->event_hooks); + rb_vm_trace_mark_event_hooks(&th->event_hooks); } RUBY_MARK_LEAVE("thread"); @@ -2609,9 +2609,9 @@ rb_ruby_debug_ptr(void) } /* iseq.c */ -VALUE insn_operand_intern(rb_iseq_t *iseq, - VALUE insn, int op_no, VALUE op, - int len, size_t pos, VALUE *pnop, VALUE child); +VALUE rb_insn_operand_intern(rb_iseq_t *iseq, + VALUE insn, int op_no, VALUE op, + int len, size_t pos, VALUE *pnop, VALUE child); #if VM_COLLECT_USAGE_DETAILS @@ -2693,7 +2693,7 @@ vm_analysis_operand(int insn, int n, VALUE op) HASH_ASET(ihash, INT2FIX(n), ophash); } /* intern */ - valstr = insn_operand_intern(GET_THREAD()->cfp->iseq, insn, n, op, 0, 0, 0, 0); + valstr = rb_insn_operand_intern(GET_THREAD()->cfp->iseq, insn, n, op, 0, 0, 0, 0); /* set count */ if ((cv = rb_hash_aref(ophash, valstr)) == Qnil) { @@ -2806,7 +2806,7 @@ vm_collect_usage_operand(int insn, int n, VALUE op) if (RUBY_DTRACE_INSN_OPERAND_ENABLED()) { VALUE valstr; - valstr = insn_operand_intern(GET_THREAD()->cfp->iseq, insn, n, op, 0, 0, 0, 0); + valstr = rb_insn_operand_intern(GET_THREAD()->cfp->iseq, insn, n, op, 0, 0, 0, 0); RUBY_DTRACE_INSN_OPERAND(RSTRING_PTR(valstr), rb_insns_name(insn)); RB_GC_GUARD(valstr); diff --git a/vm_backtrace.c b/vm_backtrace.c index 15bf1633d9..5f1cdabb70 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -629,13 +629,13 @@ backtrace_load_data(VALUE self, VALUE str) } VALUE -vm_backtrace_str_ary(rb_thread_t *th, long lev, long n) +rb_vm_backtrace_str_ary(rb_thread_t *th, long lev, long n) { return backtrace_to_str_ary(backtrace_object(th), lev, n); } VALUE -vm_backtrace_location_ary(rb_thread_t *th, long lev, long n) +rb_vm_backtrace_location_ary(rb_thread_t *th, long lev, long n) { return backtrace_to_location_ary(backtrace_object(th), lev, n); } @@ -754,7 +754,7 @@ rb_backtrace(void) VALUE rb_make_backtrace(void) { - return vm_backtrace_str_ary(GET_THREAD(), 0, 0); + return rb_vm_backtrace_str_ary(GET_THREAD(), 0, 0); } static VALUE @@ -839,13 +839,13 @@ thread_backtrace_to_ary(int argc, VALUE *argv, VALUE thval, int to_str) } VALUE -vm_thread_backtrace(int argc, VALUE *argv, VALUE thval) +rb_vm_thread_backtrace(int argc, VALUE *argv, VALUE thval) { return thread_backtrace_to_ary(argc, argv, thval, 1); } VALUE -vm_thread_backtrace_locations(int argc, VALUE *argv, VALUE thval) +rb_vm_thread_backtrace_locations(int argc, VALUE *argv, VALUE thval) { return thread_backtrace_to_ary(argc, argv, thval, 0); } @@ -1123,7 +1123,7 @@ rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data) dbg_context.th = th; dbg_context.cfp = dbg_context.th->cfp; - dbg_context.backtrace = vm_backtrace_location_ary(th, 0, 0); + dbg_context.backtrace = rb_vm_backtrace_location_ary(th, 0, 0); dbg_context.backtrace_size = RARRAY_LEN(dbg_context.backtrace); dbg_context.contexts = collect_caller_bindings(th); diff --git a/vm_eval.c b/vm_eval.c index 53025a489c..7c18f70e88 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -20,7 +20,7 @@ static void vm_set_eval_stack(rb_thread_t * th, VALUE iseqval, const NODE *cref, static int vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE ary); /* vm_backtrace.c */ -VALUE vm_backtrace_str_ary(rb_thread_t *th, int lev, int n); +VALUE rb_vm_backtrace_str_ary(rb_thread_t *th, int lev, int n); typedef enum call_type { CALL_PUBLIC, @@ -1250,7 +1250,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char errat = rb_get_backtrace(errinfo); mesg = rb_attr_get(errinfo, id_mesg); if (!NIL_P(errat) && RB_TYPE_P(errat, T_ARRAY) && - (bt2 = vm_backtrace_str_ary(th, 0, 0), RARRAY_LEN(bt2) > 0)) { + (bt2 = rb_vm_backtrace_str_ary(th, 0, 0), RARRAY_LEN(bt2) > 0)) { if (!NIL_P(mesg) && RB_TYPE_P(mesg, T_STRING) && !RSTRING_LEN(mesg)) { if (OBJ_FROZEN(mesg)) { VALUE m = rb_str_cat(rb_str_dup(RARRAY_PTR(errat)[0]), ": ", 2); diff --git a/vm_trace.c b/vm_trace.c index b212d41b21..6fafa37a32 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -48,7 +48,7 @@ static int ruby_event_flag_count[MAX_EVENT_NUM] = {0}; /* called from vm.c */ void -vm_trace_mark_event_hooks(rb_hook_list_t *hooks) +rb_vm_trace_mark_event_hooks(rb_hook_list_t *hooks) { rb_event_hook_t *hook = hooks->hooks;