[macruby-changes] [4955] MacRuby/trunk/bridgesupport.cpp

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 29 18:11:50 PST 2010


Revision: 4955
          http://trac.macosforge.org/projects/ruby/changeset/4955
Author:   lsansonetti at apple.com
Date:     2010-11-29 18:11:47 -0800 (Mon, 29 Nov 2010)
Log Message:
-----------
don't raise a TypeError exception when passing any pointer as an void-...* argument (before this change, only void* arguments where ignored)

Modified Paths:
--------------
    MacRuby/trunk/bridgesupport.cpp

Modified: MacRuby/trunk/bridgesupport.cpp
===================================================================
--- MacRuby/trunk/bridgesupport.cpp	2010-11-27 22:09:38 UTC (rev 4954)
+++ MacRuby/trunk/bridgesupport.cpp	2010-11-30 02:11:47 UTC (rev 4955)
@@ -1570,7 +1570,11 @@
     // Sanity pointer type comparison check, unless the given pointer type
     // is 'C' (which means converted from void*) or the target argument pointer
     // type is void*.
-    if (type[1] != _C_VOID && ptr_type[0] != _C_UCHR
+    const char *p = &type[1];
+    while (*p == _C_PTR) {
+	p++;
+    }
+    if (*p != _C_VOID && ptr_type[0] != _C_UCHR
 	    && !compare_types(ptr_type, &type[1])) {
 	rb_raise(rb_eTypeError,
 		"expected instance of Pointer of type `%s', got `%s'",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101129/c830ad4d/attachment.html>


More information about the macruby-changes mailing list