summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-25 08:24:34 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-25 08:24:34 +0000
commitdc626dbab3caaf221c9c7b88a5500ae878615712 (patch)
tree99208866566aa5511f0fa3d9863f5c0a32e75d7d /struct.c
parentd700d340437a4cfba215e51b9045460900c62c3a (diff)
downloadruby-dc626dbab3caaf221c9c7b88a5500ae878615712.tar.gz
* include/ruby/ruby.h: rename RARRAY_RAWPTR() to RARRAY_CONST_PTR().
RARRAY_RAWPTR(ary) returns (const VALUE *) type pointer and usecase of this macro is not acquire raw pointer, but acquire read-only pointer. So we rename to better name. RSTRUCT_RAWPTR() is also renamed to RSTRUCT_CONST_PTR() (I expect that nobody use it). * array.c, compile.c, cont.c, enumerator.c, gc.c, proc.c, random.c, string.c, struct.c, thread.c, vm_eval.c, vm_insnhelper.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/struct.c b/struct.c
index f7c61c73ec..ea70abcfbb 100644
--- a/struct.c
+++ b/struct.c
@@ -207,7 +207,7 @@ setup_struct(VALUE nstr, VALUE members)
rb_define_singleton_method(nstr, "new", rb_class_new_instance, -1);
rb_define_singleton_method(nstr, "[]", rb_class_new_instance, -1);
rb_define_singleton_method(nstr, "members", rb_struct_s_members_m, 0);
- ptr_members = RARRAY_RAWPTR(members);
+ ptr_members = RARRAY_CONST_PTR(members);
len = RARRAY_LEN(members);
for (i=0; i< len; i++) {
ID id = SYM2ID(ptr_members[i]);
@@ -448,7 +448,7 @@ rb_struct_initialize_m(int argc, VALUE *argv, VALUE self)
RSTRUCT_SET(self, i, argv[i]);
}
if (n > argc) {
- rb_mem_clear((VALUE *)RSTRUCT_RAWPTR(self)+argc, n-argc);
+ rb_mem_clear((VALUE *)RSTRUCT_CONST_PTR(self)+argc, n-argc);
}
return Qnil;
}
@@ -666,7 +666,7 @@ rb_struct_inspect(VALUE s)
static VALUE
rb_struct_to_a(VALUE s)
{
- return rb_ary_new4(RSTRUCT_LEN(s), RSTRUCT_RAWPTR(s));
+ return rb_ary_new4(RSTRUCT_LEN(s), RSTRUCT_CONST_PTR(s));
}
/*
@@ -911,8 +911,8 @@ recursive_equal(VALUE s, VALUE s2, int recur)
long i, len;
if (recur) return Qtrue; /* Subtle! */
- ptr = RSTRUCT_RAWPTR(s);
- ptr2 = RSTRUCT_RAWPTR(s2);
+ ptr = RSTRUCT_CONST_PTR(s);
+ ptr2 = RSTRUCT_CONST_PTR(s2);
len = RSTRUCT_LEN(s);
for (i=0; i<len; i++) {
if (!rb_equal(ptr[i], ptr2[i])) return Qfalse;
@@ -958,7 +958,7 @@ recursive_hash(VALUE s, VALUE dummy, int recur)
h = rb_hash_start(rb_hash(rb_obj_class(s)));
if (!recur) {
- ptr = RSTRUCT_RAWPTR(s);
+ ptr = RSTRUCT_CONST_PTR(s);
len = RSTRUCT_LEN(s);
for (i = 0; i < len; i++) {
n = rb_hash(ptr[i]);
@@ -989,8 +989,8 @@ recursive_eql(VALUE s, VALUE s2, int recur)
long i, len;
if (recur) return Qtrue; /* Subtle! */
- ptr = RSTRUCT_RAWPTR(s);
- ptr2 = RSTRUCT_RAWPTR(s2);
+ ptr = RSTRUCT_CONST_PTR(s);
+ ptr2 = RSTRUCT_CONST_PTR(s2);
len = RSTRUCT_LEN(s);
for (i=0; i<len; i++) {
if (!rb_eql(ptr[i], ptr2[i])) return Qfalse;