[Vala] error: too many arguments to function

2010-07-22 Thread Dru Moore
Hi all,

Not sure if this is a bug or user error, but I am getting an error
from the c compile stage of my program:
error: too many arguments to function
'hildon_wizard_dialog_set_forward_page_func'

I've output the intermediate c files and it looks to me that valac is
inserting an additional incorrect parameter into the c call.

Is there any quick way to edit the output c and compile to test this?
valac doesn't seem to output a makefile or similar.

Salient code for my problem:

From hildon-1.vapi file

public void set_forward_page_func (Hildon.WizardDialogPageFunc
page_func, void* data, GLib.DestroyNotify destroy);


From hildon-wizard-dialog.h

void
hildon_wizard_dialog_set_forward_page_func  (
HildonWizardDialog *wizard_dialog,
HildonWizardDialogPageFunc page_func,
gpointer data,
GDestroyNotify destroy
);


Form my vala source

this.set_forward_page_func(forward_page_function, app_settings,
(GLib.DestroyNotify)destroy_notify);


From vala's generated c file

hildon_wizard_dialog_set_forward_page_func (
(HildonWizardDialog*) self,
_id_works_first_run_wizard_forward_page_function_hildon_wizard_dialog_page_func,
self,
self-priv-app_settings,
(GDestroyNotify) id_works_first_run_wizard_destroy_notify
);

regards

dru
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] error: too many arguments to function

2010-07-22 Thread Jan Hudec

On Wed, July 21, 2010 15:41, Dru Moore wrote:
 Hi all,

 Not sure if this is a bug or user error, but I am getting an error
 from the c compile stage of my program:
 error: too many arguments to function
 'hildon_wizard_dialog_set_forward_page_func'

From hildon-1.vapi file

 public void set_forward_page_func (Hildon.WizardDialogPageFunc
 page_func, void* data, GLib.DestroyNotify destroy);

This is a bug. It should be:

public void set_forward_page_func (owned Hildon.WizardDialogPageFunc
page_func);

The data and destroy arguments are implicit in that.

 Form my vala source

 this.set_forward_page_func(forward_page_function, app_settings,
 (GLib.DestroyNotify)destroy_notify);

Obviously when the 2 extra arguments go away here, they'll go away
in your code too. It will be:

set_forward_page_func(this.forward_page_function);

Note, that there should be no data argument in the
Hildon.WizardDialogPageFunc declaration either. The
C function has it, but it's used to pass the invocant
if passing method or the closure if you pass closure.

-- 
- Jan Hudec b...@ucw.cz

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


Re: [Vala] error: too many arguments to function ‘gdk_color_copy’

2010-04-08 Thread Abderrahim Kitouni
Hi,

2010/4/8, Artem Alexanenkov alexanenko...@gmail.com:
 Hello,

  I am trying to compile with vala 0.8.0:

 int main (string[] argv){
 Gdk.Color color = Gdk.Color();
 Gdk.Color color_copy = color.copy();
 return 0;
 }
This should fix it :
int main (string[] argv){
Gdk.Color color = Gdk.Color();
Gdk.Color color_copy = color;
return 0;
}

btw, I think the copy method should be hidden, it's not really a
method. And since Gdk.Color is a struct, you don't need anything to
copy it ;-)

HTH,
Abderrahim
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list