ruby-changes:5879
From: nobu <ko1@a...>
Date: Tue, 17 Jun 2008 23:05:29 +0900 (JST)
Subject: [ruby-changes:5879] Ruby:r17386 (trunk): * ruby.c (opt_W_getter): made a hooked variable.
nobu 2008-06-17 23:02:20 +0900 (Tue, 17 Jun 2008) New Revision: 17386 Modified files: trunk/ChangeLog trunk/ruby.c Log: * ruby.c (opt_W_getter): made a hooked variable. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ruby.c?r1=17386&r2=17385&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17386&r2=17385&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 17385) +++ ChangeLog (revision 17386) @@ -1,3 +1,7 @@ +Tue Jun 17 23:02:18 2008 Nobuyoshi Nakada <nobu@r...> + + * ruby.c (opt_W_getter): made a hooked variable. + Tue Jun 17 22:04:47 2008 Yusuke Endoh <mame@t...> * enc/euc_jp.c (property_name_to_ctype): core dumped when sizeof(int) Index: ruby.c =================================================================== --- ruby.c (revision 17385) +++ ruby.c (revision 17386) @@ -1446,14 +1446,16 @@ } static VALUE -opt_W_getter(VALUE val, ID id) +opt_W_getter(VALUE val, ID id, VALUE *variable) { - if (ruby_verbose == Qnil) + switch (*variable) { + case Qnil: return INT2FIX(0); - if (ruby_verbose == Qfalse) + case Qfalse: return INT2FIX(1); - if (ruby_verbose == Qtrue) + case Qtrue: return INT2FIX(2); + } return Qnil; /* not reached */ } @@ -1463,7 +1465,7 @@ rb_define_hooked_variable("$VERBOSE", &ruby_verbose, 0, verbose_setter); rb_define_hooked_variable("$-v", &ruby_verbose, 0, verbose_setter); rb_define_hooked_variable("$-w", &ruby_verbose, 0, verbose_setter); - rb_define_virtual_variable("$-W", opt_W_getter, 0); + rb_define_hooked_variable("$-W", &ruby_verbose, opt_W_getter, 0); rb_define_variable("$DEBUG", &ruby_debug); rb_define_variable("$-d", &ruby_debug); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/