[vala] Warn when using deprecated static modifier on delegates
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Warn when using deprecated static modifier on delegates
- Date: Tue, 26 Jan 2010 22:25:48 +0000 (UTC)
commit 3d9638c1e6c07e917a36e6c2281097939cb14993
Author: Jürg Billeter <j bitron ch>
Date: Tue Jan 26 23:24:26 2010 +0100
Warn when using deprecated static modifier on delegates
vala/valaparser.vala | 2 +-
vapi/glib-2.0.vapi | 6 +++---
vapi/gobject-2.0.vapi | 18 ++++++++++++------
3 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 4b3c7fd..999976e 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -3028,7 +3028,7 @@ public class Vala.Parser : CodeVisitor {
if (ModifierFlags.STATIC in flags) {
if (!context.deprecated) {
// TODO enable warning in future releases
- // Report.warning (get_last_src (), "deprecated syntax, use [CCode (has_target = false)]");
+ Report.warning (get_last_src (), "deprecated syntax, use [CCode (has_target = false)]");
}
} else {
d.has_target = true;
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index f37df46..d170aff 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -3360,13 +3360,13 @@ namespace GLib {
}
[CCode (has_target = false)]
- public static delegate uint HashFunc (void* key);
+ public delegate uint HashFunc (void* key);
[CCode (has_target = false)]
- public static delegate bool EqualFunc (void* a, void* b);
+ public delegate bool EqualFunc (void* a, void* b);
public delegate void HFunc (void* key, void* value);
[CCode (has_target = false)]
- public static delegate void DestroyNotify (void* data);
+ public delegate void DestroyNotify (void* data);
[CCode (cname = "g_direct_hash")]
public static GLib.HashFunc direct_hash;
diff --git a/vapi/gobject-2.0.vapi b/vapi/gobject-2.0.vapi
index c13adb8..1c5411d 100644
--- a/vapi/gobject-2.0.vapi
+++ b/vapi/gobject-2.0.vapi
@@ -281,9 +281,12 @@ namespace GLib {
public struct ObjectConstructParam {
}
- public static delegate void ObjectGetPropertyFunc (Object object, uint property_id, Value value, ParamSpec pspec);
- public static delegate void ObjectSetPropertyFunc (Object object, uint property_id, Value value, ParamSpec pspec);
- public static delegate void WeakNotify (void *data, Object object);
+ [CCode (has_target = false)]
+ public delegate void ObjectGetPropertyFunc (Object object, uint property_id, Value value, ParamSpec pspec);
+ [CCode (has_target = false)]
+ public delegate void ObjectSetPropertyFunc (Object object, uint property_id, Value value, ParamSpec pspec);
+ [CCode (has_target = false)]
+ public delegate void WeakNotify (void *data, Object object);
[CCode (ref_function = "g_object_ref", unref_function = "g_object_unref", marshaller_type_name = "OBJECT", get_value_function = "g_value_get_object", set_value_function = "g_value_set_object", param_spec_function = "g_param_spec_object", cheader_filename = "glib-object.h")]
public class Object {
@@ -390,7 +393,8 @@ namespace GLib {
public weak string value_nick;
}
- public static delegate void ValueTransform (Value src_value, out Value dest_value);
+ [CCode (has_target = false)]
+ public delegate void ValueTransform (Value src_value, out Value dest_value);
[CCode (copy_function = "g_value_copy", destroy_function = "g_value_unset", type_id = "G_TYPE_VALUE", marshaller_type_name = "BOXED", get_value_function = "g_value_get_boxed", set_value_function = "g_value_set_boxed", type_signature = "v")]
public struct Value {
@@ -487,14 +491,16 @@ namespace GLib {
SWAPPED
}
- public static delegate void Callback ();
+ [CCode (has_target = false)]
+ public delegate void Callback ();
[Compact]
[CCode (type_id = "G_TYPE_CLOSURE")]
public class Closure {
}
- public static delegate void ClosureNotify (void* data, Closure closure);
+ [CCode (has_target = false)]
+ public delegate void ClosureNotify (void* data, Closure closure);
[Compact]
[CCode (type_id = "G_TYPE_VALUE_ARRAY", copy_function = "g_value_array_copy")]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]