[vala] vapigen: Allow metadata files to set PrintfFormat
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala] vapigen: Allow metadata files to set PrintfFormat
- Date: Sun, 29 Mar 2009 10:40:19 -0400 (EDT)
commit 4fb50e7770915b36570df026e08957d4e68ed835
Author: Evan Nemerson <evan coeus-group com>
Date: Wed Mar 25 13:46:10 2009 -0700
vapigen: Allow metadata files to set PrintfFormat
Fixes bug 576765.
---
vala/valacodewriter.vala | 4 ++++
vapigen/valagidlparser.vala | 5 ++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 9e72baa..d44a77d 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -851,6 +851,10 @@ public class Vala.CodeWriter : CodeVisitor {
write_indent ();
write_string ("[ReturnsModifiedPointer]");
}
+ if (m.printf_format) {
+ write_indent ();
+ write_string ("[PrintfFormat]");
+ }
var ccode_params = new StringBuilder ();
var separator = "";
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index c5a27a6..3380553 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -1393,6 +1393,10 @@ public class Vala.GIdlParser : CodeVisitor {
if (eval (nv[1]) == "1") {
add_ellipsis = true;
}
+ } else if (nv[0] == "printf_format") {
+ if (eval (nv[1]) == "1") {
+ m.printf_format = true;
+ }
} else if (nv[0] == "transfer_ownership") {
if (eval (nv[1]) == "1") {
return_type.value_owned = true;
@@ -1450,7 +1454,6 @@ public class Vala.GIdlParser : CodeVisitor {
} else if (nv[0] == "vfunc_name") {
m.vfunc_name = eval (nv[1]);
}
-
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]