Re: [Vala] Warning or Bug ?
- From: Andrea Del Signore <sejerpz tin it>
- To: Serge Hulne <serge hulne gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Warning or Bug ?
- Date: Wed, 08 Jun 2011 14:43:11 +0200
On Wed, 2011-06-08 at 09:25 +0200, Serge Hulne wrote:
//----------------
// Struct to hold key, values pairs:
struct pair {
public int freq;
public string word;
}
// Equality function for structs :
bool equals (pair a, pair b) {
return (Posix.strcmp(a.word, b.word) == 0);
}
//List:
var L = new LinkedList<pair?>( (EqualFunc) equals);
//----------------
Hi,
what is the warning? If I compile the snippet with the following command
I have any warning other than unused variables:
valac gee-warn.vala --pkg gee-1.0 --pkg posix
May be you haven't added the --pkg posix switch?
And do you know that you can use the glib wrap for strcmp?
Eg. return (GLib.strcmp(a.word, b.word) == 0);
Regards,
Andrea
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]