]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
On-demand Method.printf_format and scanf_format
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 7 Jul 2011 15:41:40 +0000 (17:41 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 1 Aug 2011 16:17:06 +0000 (18:17 +0200)
vala/valamethod.vala

index efa5f0ebd4252fe9c26fe109f6255502af48719c..b2ac9aae619e1b42dba51a6ff041d2f9124b6b4c 100644 (file)
@@ -195,12 +195,26 @@ public class Vala.Method : Subroutine {
        /**
         * Specifies whether this method expects printf-style format arguments.
         */
-       public bool printf_format { get; set; }
+       public bool printf_format {
+               get {
+                       return get_attribute ("PrintfFormat") != null;
+               }
+               set {
+                       set_attribute ("PrintfFormat", value);
+               }
+       }
 
        /**
         * Specifies whether this method expects scanf-style format arguments.
         */
-       public bool scanf_format { get; set; }
+       public bool scanf_format {
+               get {
+                       return get_attribute ("ScanfFormat") != null;
+               }
+               set {
+                       set_attribute ("ScanfFormat", value);
+               }
+       }
 
        /**
         * Specifies whether a new function without a GType parameter is
@@ -500,10 +514,6 @@ public class Vala.Method : Subroutine {
                                returns_modified_pointer = true;
                        } else if (a.name == "FloatingReference") {
                                return_type.floating_reference = true;
-                       } else if (a.name == "PrintfFormat") {
-                               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;