[vala/wip/attributes: 24/32] On-demand Method.printf_format and scanf_format
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/attributes: 24/32] On-demand Method.printf_format and scanf_format
- Date: Tue, 12 Jul 2011 09:37:42 +0000 (UTC)
commit faf11a0ac00893f5e66f1890c714e36b79a6b17e
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Jul 7 17:41:40 2011 +0200
On-demand Method.printf_format and scanf_format
vala/valamethod.vala | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 33c97bb..cc00b80 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]