ruby-changes:43053
From: nobu <ko1@a...>
Date: Mon, 23 May 2016 13:32:01 +0900 (JST)
Subject: [ruby-changes:43053] nobu:r55127 (trunk): remove unnecessary volatiles
nobu 2016-05-23 13:31:55 +0900 (Mon, 23 May 2016) New Revision: 55127 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55127 Log: remove unnecessary volatiles * ext/dbm/dbm.c (fdbm_initialize): used for rb_sys_fail_str. * ext/sdbm/init.c (fsdbm_initialize): ditto. * ext/tk/tcltklib.c (lib_do_one_event_core): no effect. * ext/tk/tkutil/tkutil.c (tk_eval_cmd, tk_get_eval_string): no effect if tail call optimized. * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): set to const. Modified files: trunk/ext/dbm/dbm.c trunk/ext/sdbm/init.c trunk/ext/tk/tcltklib.c trunk/ext/tk/tkutil/tkutil.c Index: ext/dbm/dbm.c =================================================================== --- ext/dbm/dbm.c (revision 55126) +++ ext/dbm/dbm.c (revision 55127) @@ -145,8 +145,7 @@ fdbm_alloc(VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/dbm/dbm.c#L145 static VALUE fdbm_initialize(int argc, VALUE *argv, VALUE obj) { - volatile VALUE file; - VALUE vmode, vflags; + VALUE file, vmode, vflags; DBM *dbm; struct dbmdata *dbmp; int mode, flags = 0; Index: ext/sdbm/init.c =================================================================== --- ext/sdbm/init.c (revision 55126) +++ ext/sdbm/init.c (revision 55127) @@ -179,8 +179,7 @@ fsdbm_alloc(VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/sdbm/init.c#L179 static VALUE fsdbm_initialize(int argc, VALUE *argv, VALUE obj) { - volatile VALUE file; - VALUE vmode; + VALUE file, vmode; DBM *dbm; struct dbmdata *dbmp; int mode; Index: ext/tk/tkutil/tkutil.c =================================================================== --- ext/tk/tkutil/tkutil.c (revision 55126) +++ ext/tk/tkutil/tkutil.c (revision 55127) @@ -187,7 +187,7 @@ tk_eval_cmd(argc, argv, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L187 VALUE argv[]; VALUE self; { - volatile VALUE cmd, rest; + VALUE cmd, rest; rb_scan_args(argc, argv, "1*", &cmd, &rest); return rb_eval_cmd(cmd, rest, 0); @@ -952,7 +952,7 @@ tk_get_eval_string(argc, argv, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L952 VALUE *argv; VALUE self; { - volatile VALUE obj, enc_flag; + VALUE obj, enc_flag; if (rb_scan_args(argc, argv, "11", &obj, &enc_flag) == 1) { enc_flag = Qnil; @@ -1563,7 +1563,7 @@ cbsubst_table_setup(argc, argv, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L1563 VALUE *argv; VALUE self; { - volatile VALUE cbsubst_obj; + VALUE cbsubst_obj; VALUE key_inf; VALUE longkey_inf; VALUE proc_inf; Index: ext/tk/tcltklib.c =================================================================== --- ext/tk/tcltklib.c (revision 55126) +++ ext/tk/tcltklib.c (revision 55127) @@ -3035,7 +3035,7 @@ lib_do_one_event_core(argc, argv, self, https://github.com/ruby/ruby/blob/trunk/ext/tk/tcltklib.c#L3035 VALUE self; int is_ip; { - volatile VALUE vflags; + VALUE vflags; int flags; int found_event; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/