From a1d7603af4bc76e94324d4184d598d4f93f1796f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 22 Jan 2010 02:12:41 +0100 Subject: [PATCH] Remove traces of NoArrayLength, and warn on its usage Fixes bug 607567. --- codegen/valaccodecompiler.vala | 1 - compiler/valacompiler.vala | 6 ------ vala/valamethod.vala | 3 +++ vapi/glib-2.0.vapi | 5 ----- vapi/packages/gnome-keyring-1/gnome-keyring-1-custom.vala | 2 +- vapigen/valavapigen.vala | 3 --- 6 files changed, 4 insertions(+), 16 deletions(-) diff --git a/codegen/valaccodecompiler.vala b/codegen/valaccodecompiler.vala index 2f61a3164..6bec31348 100644 --- a/codegen/valaccodecompiler.vala +++ b/codegen/valaccodecompiler.vala @@ -48,7 +48,6 @@ public class Vala.CCodeCompiler { * * @param context a code context */ - [NoArrayLength] public void compile (CodeContext context, string? cc_command, string[] cc_options) { bool use_pkgconfig = false; diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index af599a202..71e70589b 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -28,19 +28,15 @@ class Vala.Compiler { static string directory; static bool version; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] sources; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] vapi_directories; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] gir_directories; static string vapi_filename; static string library; static string gir; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] packages; static string target_glib; @@ -65,12 +61,10 @@ class Vala.Compiler { static bool disable_warnings; static string cc_command; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] cc_options; static string dump_tree; static bool save_temps; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] defines; static bool quiet_mode; static bool verbose_mode; diff --git a/vala/valamethod.vala b/vala/valamethod.vala index 7b0bbe559..ffd2a53fc 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -475,6 +475,9 @@ public class Vala.Method : Member { printf_format = true; } else if (a.name == "ScanfFormat") { scanf_format = true; + } else if (a.name == "NoArrayLength") { + Report.warning (source_reference, "NoArrayLength attribute is deprecated, use [CCode (array_length = false)] instead."); + no_array_length = true; } } } diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 7083cbc52..4cf97255d 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -826,12 +826,10 @@ public class string { [CCode (cname = "g_strcompress")] public string compress (); [CCode (cname = "g_strsplit", array_length = false, array_null_terminated = true)] - [NoArrayLength] public string[] split (string delimiter, int max_tokens = 0); [CCode (cname = "g_strsplit_set", array_length = false, array_null_terminated = true)] public string[] split_set (string delimiters, int max_tokens = 0); [CCode (cname = "g_strjoinv")] - [NoArrayLength] public static string joinv (string separator, [CCode (array_length = false, array_null_terminated = true)] string[] str_array); [CCode (cname = "g_strjoin")] public static string join (string separator, ...); @@ -2105,10 +2103,8 @@ namespace GLib { [CCode (cname = "g_get_user_special_dir")] public static weak string get_user_special_dir (UserDirectory directory); [CCode (cname = "g_get_system_data_dirs", array_length = false, array_null_terminated = true)] - [NoArrayLength] public static weak string[] get_system_data_dirs (); [CCode (cname = "g_get_system_config_dirs", array_length = false, array_null_terminated = true)] - [NoArrayLength] public static weak string[] get_system_config_dirs (); [CCode (cname = "g_get_host_name")] public static weak string get_host_name (); @@ -2681,7 +2677,6 @@ namespace GLib { public void set_ignore_unknown_options (bool ignore_unknown); public bool get_ignore_unknown_options (); public string get_help (bool main_help, OptionGroup? group); - [NoArrayLength] public void add_main_entries ([CCode (array_length = false)] OptionEntry[] entries, string? translation_domain); public void add_group (owned OptionGroup group); public void set_main_group (owned OptionGroup group); diff --git a/vapi/packages/gnome-keyring-1/gnome-keyring-1-custom.vala b/vapi/packages/gnome-keyring-1/gnome-keyring-1-custom.vala index 25fcdd4ad..d8bed73f8 100644 --- a/vapi/packages/gnome-keyring-1/gnome-keyring-1-custom.vala +++ b/vapi/packages/gnome-keyring-1/gnome-keyring-1-custom.vala @@ -14,7 +14,7 @@ namespace GnomeKeyring public extern AttributeList (); public extern Attribute index (int i); - [NoArrayLength] + [CCode (array_length = false)] public Attribute[] data; public uint len; } diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala index d56a59261..f3118cb44 100644 --- a/vapigen/valavapigen.vala +++ b/vapigen/valavapigen.vala @@ -27,14 +27,11 @@ class Vala.VAPIGen : Object { static bool version; static bool quiet_mode; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] sources; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] vapi_directories; static string library; [CCode (array_length = false, array_null_terminated = true)] - [NoArrayLength] static string[] packages; static string metadata_filename; CodeContext context; -- 2.47.3