On 15 December 2011 23:21, Eliot Miranda <eliot.miranda@gmail.com> wrote:
On Thu, Dec 15, 2011 at 2:14 PM, Igor Stasenko <siguctua@gmail.com> wrote:
On 15 December 2011 10:28, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 14.12.2011 02:10, Igor Stasenko wrote:
On 14 December 2011 01:17, Fernando Olivero<fernando.olivero@usi.ch> Â wrote:
Igor, is this a bug?
When parsing methods that send native functions withouth arguments , void, theres a DNU. For example in the following method:
^ self pangoCairoNbCall:#(PangoCairoFontMap pango_cairo_font_map_get_default ( void ) )
I fixed it like this:
usesMethodArguments "first check wether my single argument is void" ^(fnSpec arguments size = 1 ==> Â [fnSpec arguments first class ~= NBVoid]) and:[ fnSpec arguments anySatisfy: [:type | type loader usesSTStack ] ]
Well, the function signature syntax are not strictly following C. Just use empty parens for functions with no arguments. This is quite archaic C syntax, which is really not important to support.
Or i can add this patch if you insist. :)
So you would say f.ex. http://david.tribble.com/text/cdiffs.htm#C99-empty-parm is incorrect?
in what context we're talking about? if this declaration in C code, then of course it could mean that it does not defines the arguments yet. But if we speaking about signature of function for callout, then i think it is clear what it stands for.
Are you? Â Since in C () means an unspecified argument list this could be the way of declaring a varargs function, e.g.
printf: arguments   <cdecl: printf ()>
could insist on arguments being an array and automatically marshall all the elements in it.
oh please. that's even less obvious usage :) there's a lot of different stuff in C syntax which you can play with. But it doesn't means that you need to routinely support everything in FFI callout specs. as i said, the function signature syntax are close to C syntax, but not strictly C. -- Best regards, Igor Stasenko.