summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-21 19:52:40 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-21 19:52:40 +0000
commit4223f00713bec8721c031e50bf8a6d23e806f3e9 (patch)
tree0277c8c7767b4200993d96f4281dc63504464d9e /iseq.c
parent671c196384908064703362857b2bf5f7f1b6bf39 (diff)
* include/ruby/ruby.h (OBJ_WRITE): cast to (VALUE *) for second
parameter `slot'. You don't need to write a cast (VALUE *) any more. * class.c, compile.c, hash.c, iseq.c, proc.c, re.c, variable.c, vm.c, vm_method.c: remove cast expressions for OBJ_WRITE(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/iseq.c b/iseq.c
index 1db71c4c47..5d8d7ada1f 100644
--- a/iseq.c
+++ b/iseq.c
@@ -184,20 +184,20 @@ static rb_iseq_location_t *
iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, size_t first_lineno)
{
rb_iseq_location_t *loc = &iseq->location;
- OBJ_WRITE(iseq->self, (VALUE *)&loc->path, path);
+ OBJ_WRITE(iseq->self, &loc->path, path);
if (RTEST(absolute_path) && rb_str_cmp(path, absolute_path) == 0) {
- OBJ_WRITE(iseq->self, (VALUE *)&loc->absolute_path, path);
+ OBJ_WRITE(iseq->self, &loc->absolute_path, path);
}
else {
- OBJ_WRITE(iseq->self, (VALUE *)&loc->absolute_path, absolute_path);
+ OBJ_WRITE(iseq->self, &loc->absolute_path, absolute_path);
}
- OBJ_WRITE(iseq->self, (VALUE *)&loc->label, name);
- OBJ_WRITE(iseq->self, (VALUE *)&loc->base_label, name);
+ OBJ_WRITE(iseq->self, &loc->label, name);
+ OBJ_WRITE(iseq->self, &loc->base_label, name);
loc->first_lineno = first_lineno;
return loc;
}
-#define ISEQ_SET_CREF(iseq, cref) OBJ_WRITE((iseq)->self, (VALUE *)&(iseq)->cref_stack, (cref))
+#define ISEQ_SET_CREF(iseq, cref) OBJ_WRITE((iseq)->self, &(iseq)->cref_stack, (cref))
static void
set_relation(rb_iseq_t *iseq, const VALUE parent)
@@ -209,7 +209,7 @@ set_relation(rb_iseq_t *iseq, const VALUE parent)
/* set class nest stack */
if (type == ISEQ_TYPE_TOP) {
/* toplevel is private */
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->cref_stack, NEW_CREF(rb_cObject));
+ OBJ_WRITE(iseq->self, &iseq->cref_stack, NEW_CREF(rb_cObject));
iseq->cref_stack->nd_refinements = Qnil;
iseq->cref_stack->nd_visi = NOEX_PRIVATE;
if (th->top_wrapper) {
@@ -246,7 +246,7 @@ void
rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj)
{
if (!RTEST(iseq->mark_ary)) {
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->mark_ary, rb_ary_tmp_new(3));
+ OBJ_WRITE(iseq->self, &iseq->mark_ary, rb_ary_tmp_new(3));
RBASIC_CLEAR_CLASS(iseq->mark_ary);
}
rb_ary_push(iseq->mark_ary, obj);
@@ -262,7 +262,7 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq->arg_rest = -1;
iseq->arg_block = -1;
iseq->arg_keyword = -1;
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->klass, 0);
+ OBJ_WRITE(iseq->self, &iseq->klass, 0);
set_relation(iseq, parent);
OBJ_FREEZE(name);
@@ -270,11 +270,11 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq_location_setup(iseq, path, absolute_path, name, first_lineno);
if (iseq != iseq->local_iseq) {
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->location.base_label, iseq->local_iseq->location.label);
+ OBJ_WRITE(iseq->self, &iseq->location.base_label, iseq->local_iseq->location.label);
}
iseq->defined_method_id = 0;
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->mark_ary, 0);
+ OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
/*
* iseq->special_block_builder = GC_GUARDED_PTR_REF(block_opt);
@@ -284,15 +284,15 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq->compile_data = ALLOC(struct iseq_compile_data);
MEMZERO(iseq->compile_data, struct iseq_compile_data, 1);
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->compile_data->err_info, Qnil);
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->compile_data->mark_ary, rb_ary_tmp_new(3));
+ OBJ_WRITE(iseq->self, &iseq->compile_data->err_info, Qnil);
+ OBJ_WRITE(iseq->self, &iseq->compile_data->mark_ary, rb_ary_tmp_new(3));
iseq->compile_data->storage_head = iseq->compile_data->storage_current =
(struct iseq_compile_data_storage *)
ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
sizeof(struct iseq_compile_data_storage));
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->compile_data->catch_table_ary, rb_ary_new());
+ OBJ_WRITE(iseq->self, &iseq->compile_data->catch_table_ary, rb_ary_new());
iseq->compile_data->storage_head->pos = 0;
iseq->compile_data->storage_head->next = 0;
iseq->compile_data->storage_head->size =
@@ -302,12 +302,12 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq->compile_data->option = option;
iseq->compile_data->last_coverable_line = -1;
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->coverage, Qfalse);
+ OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
if (!GET_THREAD()->parse_in_eval) {
VALUE coverages = rb_get_coverages();
if (RTEST(coverages)) {
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->coverage, rb_hash_lookup(coverages, path));
- if (NIL_P(iseq->coverage)) OBJ_WRITE(iseq->self, (VALUE *)&iseq->coverage, Qfalse);
+ OBJ_WRITE(iseq->self, &iseq->coverage, rb_hash_lookup(coverages, path));
+ if (NIL_P(iseq->coverage)) OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
}
}
@@ -1907,7 +1907,7 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
iseq1->self = newiseq;
if (!iseq1->orig) {
- OBJ_WRITE(iseq1->self, (VALUE *)&iseq1->orig, iseqval);
+ OBJ_WRITE(iseq1->self, &iseq1->orig, iseqval);
}
if (iseq0->local_iseq == iseq0) {
iseq1->local_iseq = iseq1;
@@ -1919,7 +1919,7 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
if (iseq0->cref_stack->nd_next) {
iseq1->cref_stack->nd_next = iseq0->cref_stack->nd_next;
}
- OBJ_WRITE(iseq1, (VALUE *)&iseq1->klass, newcbase);
+ OBJ_WRITE(iseq1, &iseq1->klass, newcbase);
}
return newiseq;
@@ -2071,10 +2071,10 @@ rb_iseq_build_for_ruby2cext(
/* copy iseq */
MEMCPY(iseq, iseq_template, rb_iseq_t, 1); /* TODO: write barrier, *iseq = *iseq_template; */
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->location.label, rb_str_new2(name));
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->location.path, rb_str_new2(path));
+ OBJ_WRITE(iseq->self, &iseq->location.label, rb_str_new2(name));
+ OBJ_WRITE(iseq->self, &iseq->location.path, rb_str_new2(path));
iseq->location.first_lineno = first_lineno;
- OBJ_WRITE(iseq->self, (VALUE *)&iseq->mark_ary, 0);
+ OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
iseq->self = iseqval;
iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);