variable.c: remove casts for rb_class_ivar_set callers
Casting any arguments of rb_class_ivar_set to st_data_t is wrong as the function does not take any st_data_t parameters anymore. There's no functional change, as ID, VALUE, and st_data_t are all the same type, but this reduces confusion and improves maintainability for future type changes. * variable.c (find_class_path): remove cast for rb_class_ivar_set (rb_ivar_set): ditto (rb_cvar_set): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5aef9e1d78
commit
ca86c3abb8
@ -1,3 +1,9 @@
|
|||||||
|
Tue Nov 3 06:48:58 2015 Eric Wong <e@80x24.org>
|
||||||
|
|
||||||
|
* variable.c (find_class_path): remove cast for rb_class_ivar_set
|
||||||
|
(rb_ivar_set): ditto
|
||||||
|
(rb_cvar_set): ditto
|
||||||
|
|
||||||
Tue Nov 3 06:18:21 2015 Eric Wong <e@80x24.org>
|
Tue Nov 3 06:18:21 2015 Eric Wong <e@80x24.org>
|
||||||
|
|
||||||
* variable.c (rb_global_tbl): convert to id_table
|
* variable.c (rb_global_tbl): convert to id_table
|
||||||
|
@ -159,7 +159,7 @@ 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_class_ivar_set(klass, (st_data_t)classpath, arg.path);
|
rb_class_ivar_set(klass, 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;
|
||||||
@ -1412,7 +1412,7 @@ rb_ivar_set(VALUE obj, ID id, VALUE val)
|
|||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
case T_MODULE:
|
case T_MODULE:
|
||||||
if (!RCLASS_IV_TBL(obj)) RCLASS_IV_TBL(obj) = st_init_numtable();
|
if (!RCLASS_IV_TBL(obj)) RCLASS_IV_TBL(obj) = st_init_numtable();
|
||||||
rb_class_ivar_set(obj, (st_data_t)id, val);
|
rb_class_ivar_set(obj, id, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
generic_ivar_set(obj, id, val);
|
generic_ivar_set(obj, id, val);
|
||||||
@ -2802,7 +2802,7 @@ rb_cvar_set(VALUE klass, ID id, VALUE val)
|
|||||||
RCLASS_IV_TBL(target) = st_init_numtable();
|
RCLASS_IV_TBL(target) = st_init_numtable();
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_class_ivar_set(target, (st_data_t)id, (st_data_t)val);
|
rb_class_ivar_set(target, id, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user