Re: [Vala] Manual VAPI writing



Hey All,

I had this working before, but due to Hard disk issues I lost the .vapi.
Currently I have a vapi that will create the right types, initialize the
object (and destroy it),
but I cant figure the "read" function out anymore:


        // sf_count_t    sf_read_float    (SNDFILE *sndfile, float *ptr,
sf_count_t items) ;
        [CCode (cname="sf_read_float")]
        public static count_t read_float(float *array,count_t numSamples);

The commented line is from "sndfile.h" the C header file, and the other 2
lines are in sndfile.vapi

I hope to use it as follows:
sndfileobject.read_float( floatArray , 128 );

I'm getting compilation errors, that there aren't enough args going to the
"read_float" in the C file:

default/sample.c:112: warning: passing argument 1 of ‘sf_read_float’ from
incompatible pointer type
/usr/include/sndfile.h:617: note: expected ‘struct SNDFILE *’ but argument
is of type ‘float *’
default/sample.c:112: warning: passing argument 2 of ‘sf_read_float’ makes
pointer from integer without a cast
/usr/include/sndfile.h:617: note: expected ‘float *’ but argument is of type
‘sf_count_t’
default/sample.c:112: error: too few arguments to function ‘sf_read_float’

How could I fix this in the .vapi?
Thanks for reading, -Harry


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