зеркало из https://github.com/github/ruby.git
variable.c: wrap long lines
Make code easier to read and hunt for bugs with my tiny terminal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
d91e11b59d
Коммит
1e6a643fa9
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Aug 4 12:12:14 2015 Eric Wong <e@80x24.org>
|
||||||
|
|
||||||
|
* variable.c: wrap long lines
|
||||||
|
|
||||||
Tue Aug 4 09:32:30 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
Tue Aug 4 09:32:30 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||||
|
|
||||||
* proc.c: Removing duplicate doc [fix GH-987][ci skip]
|
* proc.c: Removing duplicate doc [fix GH-987][ci skip]
|
||||||
|
|
33
variable.c
33
variable.c
|
@ -157,7 +157,8 @@ find_class_path(VALUE klass, ID preferred)
|
||||||
if (!RCLASS_IV_TBL(klass)) {
|
if (!RCLASS_IV_TBL(klass)) {
|
||||||
RCLASS_IV_TBL(klass) = st_init_numtable();
|
RCLASS_IV_TBL(klass) = st_init_numtable();
|
||||||
}
|
}
|
||||||
rb_st_insert_id_and_value(klass, RCLASS_IV_TBL(klass), (st_data_t)classpath, arg.path);
|
rb_st_insert_id_and_value(klass, RCLASS_IV_TBL(klass),
|
||||||
|
(st_data_t)classpath, arg.path);
|
||||||
|
|
||||||
st_delete(RCLASS_IV_TBL(klass), &tmp, 0);
|
st_delete(RCLASS_IV_TBL(klass), &tmp, 0);
|
||||||
return arg.path;
|
return arg.path;
|
||||||
|
@ -1246,7 +1247,8 @@ rb_ivar_lookup(VALUE obj, ID id, VALUE undef)
|
||||||
break;
|
break;
|
||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
case T_MODULE:
|
case T_MODULE:
|
||||||
if (RCLASS_IV_TBL(obj) && st_lookup(RCLASS_IV_TBL(obj), (st_data_t)id, &index))
|
if (RCLASS_IV_TBL(obj) &&
|
||||||
|
st_lookup(RCLASS_IV_TBL(obj), (st_data_t)id, &index))
|
||||||
return (VALUE)index;
|
return (VALUE)index;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1300,7 +1302,8 @@ rb_ivar_delete(VALUE obj, ID id, VALUE undef)
|
||||||
break;
|
break;
|
||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
case T_MODULE:
|
case T_MODULE:
|
||||||
if (RCLASS_IV_TBL(obj) && st_delete(RCLASS_IV_TBL(obj), (st_data_t *)&id, &index))
|
if (RCLASS_IV_TBL(obj) &&
|
||||||
|
st_delete(RCLASS_IV_TBL(obj), (st_data_t *)&id, &index))
|
||||||
return (VALUE)index;
|
return (VALUE)index;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1869,7 +1872,8 @@ autoload_data(VALUE mod, ID id)
|
||||||
st_data_t val;
|
st_data_t val;
|
||||||
|
|
||||||
if (!st_lookup(RCLASS_IV_TBL(mod), autoload, &val) ||
|
if (!st_lookup(RCLASS_IV_TBL(mod), autoload, &val) ||
|
||||||
!(tbl = check_autoload_table((VALUE)val)) || !st_lookup(tbl, (st_data_t)id, &val)) {
|
!(tbl = check_autoload_table((VALUE)val)) ||
|
||||||
|
!st_lookup(tbl, (st_data_t)id, &val)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (VALUE)val;
|
return (VALUE)val;
|
||||||
|
@ -2056,7 +2060,8 @@ autoload_const_set(VALUE arg)
|
||||||
VALUE klass = args->mod;
|
VALUE klass = args->mod;
|
||||||
ID id = args->id;
|
ID id = args->id;
|
||||||
check_before_mod_set(klass, id, args->value, "constant");
|
check_before_mod_set(klass, id, args->value, "constant");
|
||||||
st_update(RCLASS_CONST_TBL(klass), (st_data_t)id, const_update, (st_data_t)args);
|
st_update(RCLASS_CONST_TBL(klass), (st_data_t)id,
|
||||||
|
const_update, (st_data_t)args);
|
||||||
return 0; /* ignored */
|
return 0; /* ignored */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2110,7 +2115,8 @@ rb_autoload_load(VALUE mod, ID id)
|
||||||
args.value = ele->value;
|
args.value = ele->value;
|
||||||
safe_backup = rb_safe_level();
|
safe_backup = rb_safe_level();
|
||||||
rb_set_safe_level_force(ele->safe_level);
|
rb_set_safe_level_force(ele->safe_level);
|
||||||
rb_ensure(autoload_const_set, (VALUE)&args, reset_safe, (VALUE)safe_backup);
|
rb_ensure(autoload_const_set, (VALUE)&args,
|
||||||
|
reset_safe, (VALUE)safe_backup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RB_GC_GUARD(load);
|
RB_GC_GUARD(load);
|
||||||
|
@ -2418,7 +2424,8 @@ rb_const_defined_0(VALUE klass, ID id, int exclude, int recurse, int visibility)
|
||||||
if (visibility && RB_CONST_PRIVATE_P(ce)) {
|
if (visibility && RB_CONST_PRIVATE_P(ce)) {
|
||||||
return (int)Qfalse;
|
return (int)Qfalse;
|
||||||
}
|
}
|
||||||
if (ce->value == Qundef && !check_autoload_required(tmp, id, 0) && !rb_autoloading_value(tmp, id, 0))
|
if (ce->value == Qundef && !check_autoload_required(tmp, id, 0) &&
|
||||||
|
!rb_autoloading_value(tmp, id, 0))
|
||||||
return (int)Qfalse;
|
return (int)Qfalse;
|
||||||
return (int)Qtrue;
|
return (int)Qtrue;
|
||||||
}
|
}
|
||||||
|
@ -2522,7 +2529,8 @@ const_update(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
|
||||||
|
|
||||||
load = autoload_data(klass, id);
|
load = autoload_data(klass, id);
|
||||||
/* for autoloading thread, keep the defined value to autoloading storage */
|
/* for autoloading thread, keep the defined value to autoloading storage */
|
||||||
if (load && (ele = check_autoload_data(load)) && (ele->thread == rb_thread_current())) {
|
if (load && (ele = check_autoload_data(load)) &&
|
||||||
|
(ele->thread == rb_thread_current())) {
|
||||||
rb_clear_constant_cache();
|
rb_clear_constant_cache();
|
||||||
|
|
||||||
ele->value = val; /* autoload_i is non-WB-protected */
|
ele->value = val; /* autoload_i is non-WB-protected */
|
||||||
|
@ -2559,7 +2567,8 @@ const_update(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_const_entry(rb_const_entry_t *ce, VALUE klass, VALUE val, rb_const_flag_t visibility)
|
setup_const_entry(rb_const_entry_t *ce, VALUE klass, VALUE val,
|
||||||
|
rb_const_flag_t visibility)
|
||||||
{
|
{
|
||||||
ce->flag = visibility;
|
ce->flag = visibility;
|
||||||
ce->line = rb_sourceline();
|
ce->line = rb_sourceline();
|
||||||
|
@ -2585,7 +2594,8 @@ rb_define_global_const(const char *name, VALUE val)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_const_visibility(VALUE mod, int argc, const VALUE *argv, rb_const_flag_t flag, rb_const_flag_t mask)
|
set_const_visibility(VALUE mod, int argc, const VALUE *argv,
|
||||||
|
rb_const_flag_t flag, rb_const_flag_t mask)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
rb_const_entry_t *ce;
|
rb_const_entry_t *ce;
|
||||||
|
@ -2727,7 +2737,8 @@ rb_cvar_set(VALUE klass, ID id, VALUE val)
|
||||||
RCLASS_IV_TBL(target) = st_init_numtable();
|
RCLASS_IV_TBL(target) = st_init_numtable();
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_st_insert_id_and_value(target, RCLASS_IV_TBL(target), (st_data_t)id, (st_data_t)val);
|
rb_st_insert_id_and_value(target, RCLASS_IV_TBL(target),
|
||||||
|
(st_data_t)id, (st_data_t)val);
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
|
|
Загрузка…
Ссылка в новой задаче