From: Luca Bruno Date: Thu, 7 Jul 2011 15:41:40 +0000 (+0200) Subject: On-demand Method.printf_format and scanf_format X-Git-Tag: 0.13.2~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e25107e3dbcb76c6537f75e1d79815186b353bc;p=thirdparty%2Fvala.git On-demand Method.printf_format and scanf_format --- diff --git a/vala/valamethod.vala b/vala/valamethod.vala index efa5f0ebd..b2ac9aae6 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -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;