* class.c: fixed indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-03-13 05:55:13 +00:00
parent e9b98f413e
commit ffbaa25b62

42
class.c
View File

@ -120,7 +120,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
data.tbl = RCLASS_M_TBL(clone) = st_init_numtable(); data.tbl = RCLASS_M_TBL(clone) = st_init_numtable();
data.klass = clone; data.klass = clone;
st_foreach(RCLASS_M_TBL(orig), clone_method, st_foreach(RCLASS_M_TBL(orig), clone_method,
(st_data_t)&data); (st_data_t)&data);
} }
return clone; return clone;
@ -166,7 +166,7 @@ rb_singleton_class_clone(VALUE obj)
data.tbl = RCLASS_M_TBL(clone); data.tbl = RCLASS_M_TBL(clone);
data.klass = (VALUE)clone; data.klass = (VALUE)clone;
st_foreach(RCLASS_M_TBL(klass), clone_method, st_foreach(RCLASS_M_TBL(klass), clone_method,
(st_data_t)&data); (st_data_t)&data);
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone); rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
FL_SET(clone, FL_SINGLETON); FL_SET(clone, FL_SINGLETON);
return (VALUE)clone; return (VALUE)clone;
@ -430,27 +430,27 @@ rb_include_module(VALUE klass, VALUE module)
OBJ_INFECT(klass, module); OBJ_INFECT(klass, module);
c = klass; c = klass;
while (module) { while (module) {
int superclass_seen = Qfalse; int superclass_seen = Qfalse;
if (RCLASS_M_TBL(klass) == RCLASS_M_TBL(module)) if (RCLASS_M_TBL(klass) == RCLASS_M_TBL(module))
rb_raise(rb_eArgError, "cyclic include detected"); rb_raise(rb_eArgError, "cyclic include detected");
/* ignore if the module included already in superclasses */ /* ignore if the module included already in superclasses */
for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) { for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
switch (BUILTIN_TYPE(p)) { switch (BUILTIN_TYPE(p)) {
case T_ICLASS: case T_ICLASS:
if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) { if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
if (!superclass_seen) { if (!superclass_seen) {
c = p; /* move insertion point */ c = p; /* move insertion point */
} }
goto skip; goto skip;
} }
break; break;
case T_CLASS: case T_CLASS:
superclass_seen = Qtrue; superclass_seen = Qtrue;
break; break;
} }
} }
c = RCLASS_SUPER(c) = include_class_new(module, RCLASS_SUPER(c)); c = RCLASS_SUPER(c) = include_class_new(module, RCLASS_SUPER(c));
changed = 1; changed = 1;
skip: skip:
module = RCLASS_SUPER(module); module = RCLASS_SUPER(module);
@ -865,7 +865,7 @@ rb_singleton_class(VALUE obj)
if (BUILTIN_TYPE(obj) == T_CLASS) { if (BUILTIN_TYPE(obj) == T_CLASS) {
if (rb_iv_get(RBASIC(klass)->klass, "__attached__") != klass) if (rb_iv_get(RBASIC(klass)->klass, "__attached__") != klass)
make_metametaclass(klass); make_metametaclass(klass);
} }
if (OBJ_TAINTED(obj)) { if (OBJ_TAINTED(obj)) {
OBJ_TAINT(klass); OBJ_TAINT(klass);