mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
e9b98f413e
commit
ffbaa25b62
1 changed files with 21 additions and 21 deletions
42
class.c
42
class.c
|
@ -120,7 +120,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
|
|||
data.tbl = RCLASS_M_TBL(clone) = st_init_numtable();
|
||||
data.klass = clone;
|
||||
st_foreach(RCLASS_M_TBL(orig), clone_method,
|
||||
(st_data_t)&data);
|
||||
(st_data_t)&data);
|
||||
}
|
||||
|
||||
return clone;
|
||||
|
@ -166,7 +166,7 @@ rb_singleton_class_clone(VALUE obj)
|
|||
data.tbl = RCLASS_M_TBL(clone);
|
||||
data.klass = (VALUE)clone;
|
||||
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);
|
||||
FL_SET(clone, FL_SINGLETON);
|
||||
return (VALUE)clone;
|
||||
|
@ -430,27 +430,27 @@ rb_include_module(VALUE klass, VALUE module)
|
|||
OBJ_INFECT(klass, module);
|
||||
c = klass;
|
||||
while (module) {
|
||||
int superclass_seen = Qfalse;
|
||||
int superclass_seen = Qfalse;
|
||||
|
||||
if (RCLASS_M_TBL(klass) == RCLASS_M_TBL(module))
|
||||
rb_raise(rb_eArgError, "cyclic include detected");
|
||||
/* ignore if the module included already in superclasses */
|
||||
for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
|
||||
switch (BUILTIN_TYPE(p)) {
|
||||
case T_ICLASS:
|
||||
if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
|
||||
if (!superclass_seen) {
|
||||
c = p; /* move insertion point */
|
||||
}
|
||||
goto skip;
|
||||
}
|
||||
break;
|
||||
case T_CLASS:
|
||||
superclass_seen = Qtrue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
c = RCLASS_SUPER(c) = include_class_new(module, RCLASS_SUPER(c));
|
||||
/* ignore if the module included already in superclasses */
|
||||
for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
|
||||
switch (BUILTIN_TYPE(p)) {
|
||||
case T_ICLASS:
|
||||
if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
|
||||
if (!superclass_seen) {
|
||||
c = p; /* move insertion point */
|
||||
}
|
||||
goto skip;
|
||||
}
|
||||
break;
|
||||
case T_CLASS:
|
||||
superclass_seen = Qtrue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
c = RCLASS_SUPER(c) = include_class_new(module, RCLASS_SUPER(c));
|
||||
changed = 1;
|
||||
skip:
|
||||
module = RCLASS_SUPER(module);
|
||||
|
@ -865,7 +865,7 @@ rb_singleton_class(VALUE obj)
|
|||
|
||||
if (BUILTIN_TYPE(obj) == T_CLASS) {
|
||||
if (rb_iv_get(RBASIC(klass)->klass, "__attached__") != klass)
|
||||
make_metametaclass(klass);
|
||||
make_metametaclass(klass);
|
||||
}
|
||||
if (OBJ_TAINTED(obj)) {
|
||||
OBJ_TAINT(klass);
|
||||
|
|
Loading…
Add table
Reference in a new issue