ruby-changes:49877
From: normal <ko1@a...>
Date: Sun, 21 Jan 2018 07:07:43 +0900 (JST)
Subject: [ruby-changes:49877] normal:r61995 (trunk): load.c: use rb_warning directly
normal 2018-01-21 07:07:36 +0900 (Sun, 21 Jan 2018) New Revision: 61995 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61995 Log: load.c: use rb_warning directly This removes the last dependency on rb_mWarning outside of error.c and allows future commits to mark it static. Yes, I expect this to slow down the emitting of a warning message in a cold code path slightly :P Modified files: trunk/load.c Index: load.c =================================================================== --- load.c (revision 61994) +++ load.c (revision 61995) @@ -715,8 +715,6 @@ rb_f_load(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/load.c#L715 return Qtrue; } -extern VALUE rb_mWarning; - static char * load_lock(const char *ftptr) { @@ -741,7 +739,7 @@ load_lock(const char *ftptr) https://github.com/ruby/ruby/blob/trunk/load.c#L739 if (RTEST(ruby_verbose)) { VALUE warning = rb_warning_string("loading in progress, circular require considered harmful - %s", ftptr); rb_backtrace_each(rb_str_append, warning); - rb_warning_warn(rb_mWarning, warning); + rb_warning("%"PRIsVALUE, warning); } switch (rb_thread_shield_wait((VALUE)data)) { case Qfalse: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/