After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 526874 - Automatically cast callback in the C code
Automatically cast callback in the C code
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.2.x
Other All
: Low minor
: ---
Assigned To: Jürg Billeter
Vala maintainers
: 539483 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-04-08 06:01 UTC by Jaap A. Haitsma
Modified: 2008-06-23 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jaap A. Haitsma 2008-04-08 06:01:31 UTC
valac already does the type checking. gcc is giving warnings on the generated because the cast is not there.

Code below has this for example

/* GTK+ Vala Sample Code */
using GLib;
using Gtk;

public class Sample : Window {


        construct {
                destroy += Gtk.main_quit;
        }

	const ActionEntry[] action_entries = {
  		{"Action", null, null, null, null, on_action}
	};
	void on_action (Action action) {

	}

	void setup () {

		var ui_manager = new UIManager ();

		var actions = new ActionGroup ("Actions");
		actions.add_actions (action_entries, actions);
		ui_manager.insert_action_group (actions, 0);
	}

        static int main (string[] args) {
                Gtk.init (ref args);
	
                var sample = new Sample ();
		sample.setup ();
                sample.show_all ();

                Gtk.main ();
                return 0;
        }
}
Comment 1 Jürg Billeter 2008-04-13 11:20:05 UTC
Confirming.
Comment 2 Jürg Billeter 2008-06-22 13:22:42 UTC
*** Bug 539483 has been marked as a duplicate of this bug. ***
Comment 3 Jürg Billeter 2008-06-23 13:47:06 UTC
2008-06-23  Jürg Billeter  <j@bitron.ch>

	* vala/valaattribute.vala:
	* vala/valafield.vala:
	* vala/valainterfacewriter.vala:
	* vala/valanamedargument.vala:
	* vala/valastringliteral.vala:
	* gobject/valaccodegenerator.vala:
	* vapigen/valagidlparser.vala:

	Support [CCode (type = "Foo")] to insert appropriate casts in
	generated C Code

	* vapi/packages/gtk+-2.0/:

	Fix GtkActionEntry binding, fixes bug 526874

	* vapi/gtk+-2.0.vapi: regenerated

Fixed in r1638.