[Vala] Rewriting GLib C code in Vala

2015-07-24 Thread Dmitry Golovin
Hello! I'm now transfering Cogl examples to Vala: https://github.com/tpimh/vala-cogl I'm a GLib newbie, so I need help with rewriting cogl-crate example: https://github.com/GNOME/cogl/blob/master/examples/cogl-crate.c Especially this part: ```c while (1) { CoglPollFD

Re: [Vala] Rewriting GLib C code in Vala

2015-07-24 Thread yannick inizan
in vapi header : * Note that on systems with a working poll(2), that function is used * in place of g_poll(). Thus g_poll() must have the same signature as * poll(), meaning GPollFD must have the same layout as struct pollfd. you can use posix poll function instead first, pass an PollFD

Re: [Vala] Rewriting GLib C code in Vala

2015-07-24 Thread Al Thomas
From: Dmitry Golovin d...@golovin.in Sent: Friday, 24 July 2015, 10:04 Subject: [Vala] Rewriting GLib C code in Vala I'm now transfering Cogl examples to Vala: https://github.com/tpimh/vala-cogl Interesting stuff. I also like the reference you've found where someone has written an image

Re: [Vala] Variable-length array in struct and initializing an array of such structs

2015-07-24 Thread Steef Hegeman
On Fri, Jul 24, 2015 at 12:23:53AM +, Al Thomas wrote: Hmmm, I have tried your example and changed it so the arrays are the same length and the same error occurs. So I think the problem is initializing a nested array within a struct within an array rather than because they are different