[macruby-changes] [588] MacRuby/trunk/marshal.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Sep 8 20:26:37 PDT 2008


Revision: 588
          http://trac.macosforge.org/projects/ruby/changeset/588
Author:   lsansonetti at apple.com
Date:     2008-09-08 20:26:36 -0700 (Mon, 08 Sep 2008)
Log Message:
-----------
marshalize T_OBJECT's ivars

Modified Paths:
--------------
    MacRuby/trunk/marshal.c

Modified: MacRuby/trunk/marshal.c
===================================================================
--- MacRuby/trunk/marshal.c	2008-09-09 01:55:33 UTC (rev 587)
+++ MacRuby/trunk/marshal.c	2008-09-09 03:26:36 UTC (rev 588)
@@ -536,7 +536,18 @@
 static void
 w_objivar(VALUE obj, struct dump_call_arg *arg)
 {
-#if !WITH_OBJC /* TODO */
+#if WITH_OBJC
+    VALUE ary = rb_obj_instance_variables(obj);
+    int i, len = RARRAY_LEN(ary);
+
+    w_encoding(obj, len, arg);
+
+    for (i = 0; i < len; i++) {
+	ID var_id = SYM2ID(RARRAY_AT(ary, i));
+	VALUE var_val = rb_ivar_get(obj, var_id);
+	w_obj_each(var_id, var_val, arg);
+    }
+#else
     VALUE *ptr;
     long i, len, num;
 
@@ -1243,8 +1254,6 @@
     int type = r_byte(arg);
     long id;
 
-printf("type %c %d\n",(char)type,type);
-
     switch (type) {
       case TYPE_LINK:
 	id = r_long(arg);
@@ -1616,7 +1625,6 @@
 	rb_raise(rb_eArgError, "dump format error(0x%x)", type);
 	break;
     }
-printf("r_object0 -> %p (%s)\n", (void*)v, RSTRING_PTR(rb_inspect(v)));
     return v;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080908/e1c6fe87/attachment.html 


More information about the macruby-changes mailing list