Re: [Vala] Functions with no_array_length



Sorry for the trouble. I finally got the answer: use array_length=false
instead of no_array_length, although not described on the wiki [1].
Thanks to Jens Georg.

[1] http://live.gnome.org/Vala/Bindings/MetadataFormat

Le dimanche 20 février 2011 à 00:49 +0100, Neil Dokkalfar a écrit :
Dear Vala users,

I am trying to wrap an external library in which a function returns an
arrays whose size can be obtained by another function. Yet, I have been
unsuccessful in finding how to do so. Here is a simple testcase:

% cat package.vala
namespace Package {
    [CCode (no_array_length=true)]
    public int[] func();
}

% cat main.vala
using Package;

int main (string[] argv) {
    var res = Package.func ();
    return res[0];
}

Yet, the generated C code contains:

        res = (_tmp1_ = package_func (&_tmp0_), res_length1 = _tmp0_,
_res_size_ = res_length1, _tmp1_);

Shouldn't no_array_length removes this tmp0 parameter addition?

Thanks a lot for your answers.

Best regards,

--
Neil Dökkalfar

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list






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