From 9c2762960e54e19005bc3729deb667b09cdd49f7 Mon Sep 17 00:00:00 2001
From: Shugo Maeda <shugo@ruby-lang.org>
Date: Mon, 22 Nov 2010 16:21:23 +0900
Subject: [PATCH 51/51] {use,used}_modules -> using_modules

---
 eval.c          |   30 +++++++++++++++---------------
 insns.def       |    2 +-
 vm_eval.c       |    4 ++--
 vm_insnhelper.c |   32 ++++++++++++++++----------------
 4 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/eval.c b/eval.c
index f5d90c2..060e6f8 100644
--- a/eval.c
+++ b/eval.c
@@ -899,7 +899,7 @@ rb_overlay_module(NODE *cref, VALUE klass, VALUE module)
 }
 
 static int
-use_module_i(VALUE klass, VALUE module, VALUE arg)
+using_module_i(VALUE klass, VALUE module, VALUE arg)
 {
     NODE *cref = (NODE *) arg;
     int i;
@@ -909,7 +909,7 @@ use_module_i(VALUE klass, VALUE module, VALUE arg)
 }
 
 void
-rb_use_module(NODE *cref, VALUE module)
+rb_using_module(NODE *cref, VALUE module)
 {
     ID id_overlayed_modules;
     VALUE overlayed_modules;
@@ -918,7 +918,7 @@ rb_use_module(NODE *cref, VALUE module)
     CONST_ID(id_overlayed_modules, "__overlayed_modules__");
     overlayed_modules = rb_attr_get(module, id_overlayed_modules);
     if (NIL_P(overlayed_modules)) return;
-    rb_hash_foreach(overlayed_modules, use_module_i, (VALUE) cref);
+    rb_hash_foreach(overlayed_modules, using_module_i, (VALUE) cref);
 }
 
 /*
@@ -932,18 +932,18 @@ static VALUE
 rb_mod_using(VALUE self, VALUE module)
 {
     NODE *cref = rb_vm_cref();
-    ID id_used_modules;
-    VALUE used_modules;
-
-    CONST_ID(id_used_modules, "__used_modules__");
-    used_modules = rb_attr_get(self, id_used_modules);
-    if (NIL_P(used_modules)) {
-	used_modules = rb_hash_new();
-	rb_funcall(used_modules, rb_intern("compare_by_identity"), 0);
-	rb_ivar_set(self, id_used_modules, used_modules);
-    }
-    rb_hash_aset(used_modules, module, Qtrue);
-    rb_use_module(cref, module);
+    ID id_using_modules;
+    VALUE using_modules;
+
+    CONST_ID(id_using_modules, "__using_modules__");
+    using_modules = rb_attr_get(self, id_using_modules);
+    if (NIL_P(using_modules)) {
+	using_modules = rb_hash_new();
+	rb_funcall(using_modules, rb_intern("compare_by_identity"), 0);
+	rb_ivar_set(self, id_using_modules, using_modules);
+    }
+    rb_hash_aset(using_modules, module, Qtrue);
+    rb_using_module(cref, module);
     rb_funcall(module, rb_intern("used"), 1, self);
     return self;
 }
@@ -1123,7 +1123,7 @@ f_using(VALUE self, VALUE module)
 {
     NODE *cref = rb_vm_cref();
 
-    rb_use_module(cref, module);
+    rb_using_module(cref, module);
     return self;
 }
 
diff --git a/insns.def b/insns.def
index f452924..6e71f6c 100644
--- a/insns.def
+++ b/insns.def
@@ -967,7 +967,7 @@ defineclass
 		  VM_FRAME_MAGIC_CLASS, klass, 0, (VALUE) GET_BLOCK_PTR(),
 		  class_iseq->iseq_encoded, GET_SP(), 0,
 		  class_iseq->local_size);
-    rb_vm_use_modules(class_iseq->cref_stack, klass);
+    rb_vm_using_modules(class_iseq->cref_stack, klass);
     RESTORE_REGS();
 
     INC_VM_STATE_VERSION();
diff --git a/vm_eval.c b/vm_eval.c
index 119bae4..73dbd48 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1213,7 +1213,7 @@ yield_under(VALUE under, VALUE self, VALUE values)
     }
     cref = vm_cref_push(th, under, NOEX_PUBLIC, blockptr);
     cref->flags |= NODE_FL_CREF_PUSHED_BY_EVAL;
-    rb_vm_use_modules(cref, under);
+    rb_vm_using_modules(cref, under);
 
     if (values == Qundef) {
 	return vm_yield_with_cref(th, 1, &self, cref);
@@ -1235,7 +1235,7 @@ eval_under(VALUE under, VALUE self, VALUE src, const char *file, int line)
     else {
 	SafeStringValue(src);
     }
-    rb_vm_use_modules(cref, under);
+    rb_vm_using_modules(cref, under);
 
     return eval_string_with_cref(self, src, Qnil, cref, file, line);
 }
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index b72d7aa..6bb6f5b 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1746,42 +1746,42 @@ opt_eq_func(VALUE recv, VALUE obj, IC ic)
     return Qundef;
 }
 
-void rb_use_module(NODE *cref, VALUE module);
+void rb_using_module(NODE *cref, VALUE module);
 
 static int
-vm_use_module_i(VALUE module, VALUE value, VALUE arg)
+vm_using_module_i(VALUE module, VALUE value, VALUE arg)
 {
     NODE *cref = (NODE *) arg;
 
-    rb_use_module(cref, module);
+    rb_using_module(cref, module);
     return ST_CONTINUE;
 }
 
 static void
-rb_vm_use_modules(NODE *cref, VALUE klass)
+rb_vm_using_modules(NODE *cref, VALUE klass)
 {
-    ID id_used_modules;
-    VALUE used_modules;
+    ID id_using_modules;
+    VALUE using_modules;
 
-    CONST_ID(id_used_modules, "__used_modules__");
-    used_modules = rb_attr_get(klass, id_used_modules);
+    CONST_ID(id_using_modules, "__using_modules__");
+    using_modules = rb_attr_get(klass, id_using_modules);
     switch (TYPE(klass)) {
     case T_CLASS:
-	if (NIL_P(used_modules)) {
+	if (NIL_P(using_modules)) {
 	    VALUE super = rb_class_real(RCLASS_SUPER(klass));
-	    used_modules = rb_attr_get(super, id_used_modules);
-	    if (!NIL_P(used_modules)) {
-		used_modules = rb_hash_dup(used_modules);
-		rb_ivar_set(klass, id_used_modules, used_modules);
+	    using_modules = rb_attr_get(super, id_using_modules);
+	    if (!NIL_P(using_modules)) {
+		using_modules = rb_hash_dup(using_modules);
+		rb_ivar_set(klass, id_using_modules, using_modules);
 	    }
 	}
 	break;
     case T_MODULE:
-	rb_use_module(cref, klass);
+	rb_using_module(cref, klass);
 	break;
     }
-    if (!NIL_P(used_modules)) {
-	rb_hash_foreach(used_modules, vm_use_module_i,
+    if (!NIL_P(using_modules)) {
+	rb_hash_foreach(using_modules, vm_using_module_i,
 		       	(VALUE) cref);
     }
 }
-- 
1.7.0.4

