Re: [Vala] extern function prototype gets rearranged



Hi

On Sat, Apr 16, 2011 at 7:57 PM, Abderrahim Kitouni <a kitouni gmail com> wrote:
Hello,

                 في ج، 15-04-2011 عند 22:34 +0100 ، كتب Sam Thursfield:
Hi!
I've encountered a weird bug/feature which is breaking everything.
[...]
compile this, and you'll see test_value_get_date() is declared in the
C code like this:

void test_value_get_date (TestValue *self, GDate* result);

However, it's extern for a reason, and the C function prototype is to
return a GDate *, not ... whatever this function is doing.

Then, you should declare it as returning GLib.Date?

You may also question the fact that it is declared as a struct in the
vapi and not as a compact class, but I think it would be easier to just
declare your function to return GLib.Date?

Thanks for this. I hadn't quite clicked that Vala was returning the
parameter like that because it was non-nullable. Slightly
non-intuitive :)

I did eventually track down the actual bug that I've been hunting:
https://bugzilla.gnome.org/show_bug.cgi?id=648082

HTH,
Abderrahim

Thanks again
Sam



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]