On Tue, 2009-10-27 at 17:43 +0100, Jürg Billeter wrote:
> valac will use const for this parameter if the struct is annotated as
> [Immutable] in the bindings. If `const ClutterActorBox *` is used for
> all (or most) input parameters in the C API, we should add the
> [Immutable] attribute to the clutter bindings to get rid of the
> warnings. Can you check/verify whether `const` is used consistently in
> the case of ClutterActorBox input parameters?
> 
> Jürg
> 
Hi, sorry for late reply, busy week =\

Adding [Immutable] seems to work for ClutterActorBox and ClutterColor
(both need const in every function I have seen but have not checked
every last one), Which stops those errors

there is still an issue with the ClutterContainer interface, its foreach
methods require 

  void (* foreach)          (ClutterContainer *container,
                             ClutterCallback   callback,
                             gpointer          user_data);

and the vapi file provides;
        public abstract void @foreach (Clutter.Callback callback);
which creates functions like:
static void 
foo_bar_real_foreach (ClutterContainer* base, ClutterCallback callback);

again causing warning messages in Gcc as it doesn't have the additional
user_data paramater, adding void* to clutter.contain...@foreach and
foreach_with_internals seems to fix this, attached is a diff of my
changes



-- 
Gordon Allott <[email protected]>
Canonical
--- /usr/share/vala/vapi/clutter-1.0.vapi	2009-10-10 15:00:02.000000000 +0100
+++ clutter-1.0.vapi	2009-10-30 12:11:24.000000000 +0000
@@ -922,8 +922,8 @@
 		public abstract void create_child_meta (Clutter.Actor actor);
 		public abstract void destroy_child_meta (Clutter.Actor actor);
 		public unowned Clutter.Actor find_child_by_name (string child_name);
-		public abstract void @foreach (Clutter.Callback callback);
-		public abstract void foreach_with_internals (Clutter.Callback callback);
+		public abstract void @foreach (Clutter.Callback callback, void *userdata);
+		public abstract void foreach_with_internals (Clutter.Callback callback, void *userdata);
 		public abstract Clutter.ChildMeta get_child_meta (Clutter.Actor actor);
 		public unowned GLib.List get_children ();
 		public abstract void lower (Clutter.Actor actor, Clutter.Actor sibling);
@@ -968,6 +968,7 @@
 		public abstract void set_custom_property (Clutter.Script script, string name, GLib.Value value);
 		public abstract void set_id (string name);
 	}
+	[Immutable]
 	[CCode (type_id = "CLUTTER_TYPE_ACTOR_BOX", cheader_filename = "clutter/clutter.h")]
 	public struct ActorBox {
 		public float x1;
@@ -1049,6 +1050,7 @@
 	[CCode (type_id = "CLUTTER_TYPE_CLONE_PRIVATE", cheader_filename = "clutter/clutter.h")]
 	public struct ClonePrivate {
 	}
+  [Immutable]
 	[CCode (type_id = "CLUTTER_TYPE_COLOR", cheader_filename = "clutter/clutter.h")]
 	public struct Color {
 		public uint8 red;

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to