summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 04:31:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 04:31:55 +0000
commitc285a4e3578c30b074f665e5f63283800fe3e157 (patch)
tree7617766541ed2f9206f5e6be85cd2f58db7c2230 /ext
parent19f143221cbcf5fb25b947081f98d93352194b7a (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/dbm/dbm.c3
-rw-r--r--ext/sdbm/init.c3
-rw-r--r--ext/tk/tcltklib.c2
-rw-r--r--ext/tk/tkutil/tkutil.c6
4 files changed, 6 insertions, 8 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 7f9d96e3fde..07044d6f9f4 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -145,8 +145,7 @@ fdbm_alloc(VALUE klass)
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;
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index c984152382f..684f31b98fb 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -179,8 +179,7 @@ fsdbm_alloc(VALUE klass)
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;
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 658ba4bffa1..f3278f2a94a 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -3035,7 +3035,7 @@ lib_do_one_event_core(argc, argv, self, is_ip)
VALUE self;
int is_ip;
{
- volatile VALUE vflags;
+ VALUE vflags;
int flags;
int found_event;
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 1f0a720415b..cd1fa2bc8d4 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -187,7 +187,7 @@ tk_eval_cmd(argc, argv, self)
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)
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)
VALUE *argv;
VALUE self;
{
- volatile VALUE cbsubst_obj;
+ VALUE cbsubst_obj;
VALUE key_inf;
VALUE longkey_inf;
VALUE proc_inf;