summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-27 04:46:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-27 04:46:54 +0000
commit0bedb2e07f50044ef9625c6d71d1e73f4d9fc977 (patch)
tree18c235edfe08eaf4a93c61dc7a167af254f3836d /marshal.c
parentddd5b50d1271cb7a910d67ceeb0be25c6c256673 (diff)
* intern.h, struct.c (rb_struct_s_members, rb_struct_members): public
accessors. [ruby-dev:24342] * marshal.c (w_object, r_object0): use accessors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/marshal.c b/marshal.c
index 473aee9ccd..f602fffca3 100644
--- a/marshal.c
+++ b/marshal.c
@@ -635,10 +635,7 @@ w_object(obj, arg, limit)
long i;
w_long(len, arg);
- mem = rb_struct_iv_get(rb_obj_class(obj), "__member__");
- if (mem == Qnil) {
- rb_raise(rb_eTypeError, "uninitialized struct");
- }
+ mem = rb_struct_members(obj);
for (i=0; i<len; i++) {
w_symbol(SYM2ID(RARRAY(mem)->ptr[i]), arg);
w_object(RSTRUCT(obj)->ptr[i], arg, limit);
@@ -1196,7 +1193,7 @@ r_object0(arg, proc, ivp, extmod)
ID slot;
klass = path2class(r_unique(arg));
- mem = rb_struct_iv_get(klass, "__member__");
+ mem = rb_struct_s_members(klass);
if (mem == Qnil) {
rb_raise(rb_eTypeError, "uninitialized struct");
}