[macruby-changes] [456] MacRuby/branches/lrz_unstable/objc.m

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 20 02:56:56 PDT 2008


Revision: 456
          http://trac.macosforge.org/projects/ruby/changeset/456
Author:   lsansonetti at apple.com
Date:     2008-08-20 02:56:55 -0700 (Wed, 20 Aug 2008)
Log Message:
-----------
honor bridgesupport signature when callbacking a ruby method from objc

Modified Paths:
--------------
    MacRuby/branches/lrz_unstable/objc.m

Modified: MacRuby/branches/lrz_unstable/objc.m
===================================================================
--- MacRuby/branches/lrz_unstable/objc.m	2008-08-19 23:44:38 UTC (rev 455)
+++ MacRuby/branches/lrz_unstable/objc.m	2008-08-20 09:56:55 UTC (rev 456)
@@ -946,6 +946,8 @@
 bs_element_method_t *
 rb_bs_find_method(Class klass, SEL sel)
 {
+    if (bs_classes == NULL)
+	return NULL;
     do {
 	bs_element_indexed_class_t *bs_class;
 	bs_element_method_t *bs_method;
@@ -1241,10 +1243,12 @@
     ID mid;
     VALUE rrcv, ret;
     Method method;
-    char type[128];
+    const char *type;
+    char buf[128];
     long i, argc;
     VALUE *argv, klass;
     NODE *body, *node;
+    bs_element_method_t *bs_method;
 
     rcv = (*(id **)args)[0];
     sel = (*(SEL **)args)[1];
@@ -1253,13 +1257,16 @@
 
     method = class_getInstanceMethod(*(Class *)rcv, sel);
     assert(method != NULL);
+    bs_method = rb_bs_find_method(*(Class *)rcv, sel);
 
     argc = cif->nargs - 2;
     argv = (VALUE *)alloca(sizeof(VALUE) * argc);
     for (i = 0; i < argc; i++) {
 	VALUE val;
-        
-	method_getArgumentType(method, i + 2, type, sizeof type);
+       
+        type = rb_objc_method_get_type(method, cif->nargs, bs_method,
+            i, buf, sizeof buf);
+ 
 	rb_objc_ocval_to_rbval(args[i + 2], type, &val);
         argv[i] = val;
     }
@@ -1278,7 +1285,8 @@
     ret = rb_vm_call(GET_THREAD(), klass, rrcv, mid, Qnil,
 		     argc, argv, node, 0);
 
-    method_getReturnType(method, type, sizeof type);
+    type = rb_objc_method_get_type(method, cif->nargs, bs_method,
+	    -1, buf, sizeof buf);
     rb_objc_rval_to_ocval(ret, type, resp);
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080820/e920c173/attachment-0001.html 


More information about the macruby-changes mailing list