[Vala] Getting Vala not to give a GValue pointer to a function?
- From: Faheem Pervez <trippin1 gmail com>
- To: vala-list gnome org
- Subject: [Vala] Getting Vala not to give a GValue pointer to a function?
- Date: Fri, 12 Mar 2010 18:17:37 +0000
Hiya,
Vala n00b here, so be nice, please.
The function http://maemo.org/api_refs/5.0/5.0-final/mafw/mafw-MafwMetadata.html#mafw-metadata-first
returns a GValue when given a a GHashTable and a string. That's all
well and good, except Vala also tries to give it a pointer to a GValue
as the third argument. As you can see, it only takes two arguments.
The relevant part of mafw.vapi looks like:
[CCode (cheader_filename = "libmafw/mafw.h")]
public static unowned GLib.Value metadata_first (GLib.HashTable md,
string key);
and I'm invoking it thus:
unowned GLib.Value artist = metadata_first(metadata, "artist");
unowned GLib.Value title = metadata_first(metadata, "title");
unowned GLib.Value album = metadata_first(metadata, "album-art-uri");
Which produces the following C code:
GValue _tmp0_ = {0};
GValue artist;
GValue _tmp1_ = {0};
GValue title;
GValue _tmp2_ = {0};
GValue album;
g_return_if_fail (self != NULL);
g_return_if_fail (metadata != NULL);
artist = (mafw_metadata_first (metadata, "artist", &_tmp0_), _tmp0_);
title = (mafw_metadata_first (metadata, "title", &_tmp1_), _tmp1_);
album = (mafw_metadata_first (metadata, "album-art-uri", &_tmp2_), _tmp2_);
and GCC exits with the following: error: too many arguments to
function 'mafw_metadata_first' [x3]
So, how can I make Vala not try and pass a GValue to the non-existent
third parameter of mafw_metadata_first and instead use the one given
to it by mafw_metadata_first? Thanks!
Best Regards,
Faheem
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]