[MacRuby] #178: ArgumentError Exception: can't convert C/Objective-C value of type `[4d]' to Ruby object
#178: ArgumentError Exception: can't convert C/Objective-C value of type `[4d]' to Ruby object ---------------------------------+------------------------------------------ Reporter: dognotdog@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ArgumentError array convert ---------------------------------+------------------------------------------ Trying to use a function with the following .bridgesupport entry: {{{ <function name='vCreate'> <arg type='d'/> <arg type='d'/> <arg type='d'/> <arg type='d'/> <retval type='{_vt=[4d]}'/> </function> }}} Function prototype: {{{ typedef double vmfloat_t; typedef struct _vt { vmfloat_t farr[4]; } vector_t; vector_t vCreate(vmfloat_t a, vmfloat_t b, vmfloat_t c, vmfloat_t d); }}} An ArgumentError exception is raised on the return type. It's simply a struct containing a simple array, so automatic boxing/unboxing should work. Possible fix through additions to the bridgesupport entry? trunk/ r766 -- Ticket URL: <http://www.macruby.org/trac/ticket/178> MacRuby <http://macruby.org/>
#178: ArgumentError Exception: can't convert C/Objective-C value of type `[4d]' to Ruby object ---------------------------------+------------------------------------------ Reporter: dognotdog@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ArgumentError array convert ---------------------------------+------------------------------------------ Comment(by dognotdog@…): The submitted patch seems to work for types as described above, though they stay opaque to MacRuby. It would be nice to have non-opaque bridging as well, for example by being able to supply values for methods taking {_vt=[4d]} as a parameter via a plain ruby array of the right size. -- Ticket URL: <http://www.macruby.org/trac/ticket/178#comment:1> MacRuby <http://macruby.org/>
#178: ArgumentError Exception: can't convert C/Objective-C value of type `[4d]' to Ruby object ---------------------------------+------------------------------------------ Reporter: dognotdog@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ArgumentError array convert ---------------------------------+------------------------------------------ Comment(by dognotdog@…): I just want to add that as of trunk r2709, this is still broken, and my previous patch also no longer works with 0.5, as the boxing code is completely different. Unfortunately, this is critical for me to get my project running on Snow Leopard. -- Ticket URL: <http://www.macruby.org/trac/ticket/178#comment:2> MacRuby <http://macruby.org/>
#178: ArgumentError Exception: can't convert C/Objective-C value of type `[4d]' to Ruby object -----------------------------------------+---------------------------------- Reporter: dognotdog@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: ArgumentError array convert | -----------------------------------------+---------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6 Comment: This should be fixed in 0.6 (we added support for these encoding types). If it doesn't work for you still, please comment here. -- Ticket URL: <http://www.macruby.org/trac/ticket/178#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby