[vala/staging] vala: Convert Report.*() to real printf-like functions
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] vala: Convert Report.*() to real printf-like functions
- Date: Tue, 27 Oct 2020 06:17:45 +0000 (UTC)
commit 64ad6bb8aa0b26a330c2a678b5cfbba2ad0a646f
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Oct 26 16:10:37 2020 +0100
vala: Convert Report.*() to real printf-like functions
This simplifies code on the caller side.
vala/valareport.vala | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/vala/valareport.vala b/vala/valareport.vala
index 5df85b32e..0aad89f15 100644
--- a/vala/valareport.vala
+++ b/vala/valareport.vala
@@ -373,20 +373,25 @@ public class Vala.Report {
}
/* Convenience methods calling warn and err on correct instance */
- public static void notice (SourceReference? source, string message) {
- CodeContext.get ().report.note (source, message);
+ [PrintfFormat]
+ public static void notice (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.note (source, msg_format.vprintf (va_list ()));
}
- public static void deprecated (SourceReference? source, string message) {
- CodeContext.get ().report.depr (source, message);
+ [PrintfFormat]
+ public static void deprecated (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.depr (source, msg_format.vprintf (va_list ()));
}
- public static void experimental (SourceReference? source, string message) {
- CodeContext.get ().report.depr (source, message);
+ [PrintfFormat]
+ public static void experimental (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.depr (source, msg_format.vprintf (va_list ()));
}
- public static void warning (SourceReference? source, string message) {
- CodeContext.get ().report.warn (source, message);
+ [PrintfFormat]
+ public static void warning (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.warn (source, msg_format.vprintf (va_list ()));
}
- public static void error (SourceReference? source, string message) {
- CodeContext.get ().report.err (source, message);
+ [PrintfFormat]
+ public static void error (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.err (source, msg_format.vprintf (va_list ()));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]