ruby-changes:37616
From: nobu <ko1@a...>
Date: Mon, 23 Feb 2015 16:05:22 +0900 (JST)
Subject: [ruby-changes:37616] nobu:r49697 (trunk): error.c: predefined IDs
nobu 2015-02-23 16:05:06 +0900 (Mon, 23 Feb 2015) New Revision: 49697 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49697 Log: error.c: predefined IDs * error.c (id_bt, id_bt_locations): use IDs predefined in id.h. * vm_args.c (raise_argument_error): ditto. Modified files: trunk/error.c trunk/vm_args.c Index: error.c =================================================================== --- error.c (revision 49696) +++ error.c (revision 49697) @@ -645,8 +645,10 @@ VALUE rb_eSystemCallError; https://github.com/ruby/ruby/blob/trunk/error.c#L645 VALUE rb_mErrno; static VALUE rb_eNOERROR; -static ID id_new, id_bt, id_bt_locations, id_cause, id_message, id_backtrace; +static ID id_new, id_cause, id_message, id_backtrace; static ID id_status, id_name, id_args, id_Errno, id_errno, id_i_path; +#define id_bt idBt +#define id_bt_locations idBt_locations #define id_mesg idMesg #undef rb_exc_new_cstr @@ -1908,8 +1910,6 @@ Init_Exception(void) https://github.com/ruby/ruby/blob/trunk/error.c#L1910 rb_define_global_function("warn", rb_warn_m, -1); id_new = rb_intern_const("new"); - id_bt = rb_intern_const("bt"); - id_bt_locations = rb_intern_const("bt_locations"); id_cause = rb_intern_const("cause"); id_message = rb_intern_const("message"); id_backtrace = rb_intern_const("backtrace"); Index: vm_args.c =================================================================== --- vm_args.c (revision 49696) +++ vm_args.c (revision 49697) @@ -682,7 +682,7 @@ raise_argument_error(rb_thread_t *th, co https://github.com/ruby/ruby/blob/trunk/vm_args.c#L682 at = rb_vm_backtrace_object(); } - rb_iv_set(exc, "bt_locations", at); + rb_ivar_set(exc, idBt_locations, at); rb_funcall(exc, rb_intern("set_backtrace"), 1, at); rb_exc_raise(exc); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/