diff options
author | Jürg Billeter <j@bitron.ch> | 2016-11-01 18:14:09 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-03 20:47:31 +0100 |
commit | 300f81c2517d875b5e1331d893d42f3901e4563e (patch) | |
tree | ea328e0bd5697e66c8d4aa25b4c32baf747f6ed2 | |
parent | e274ebbe1a9dbb03e330c8a03472c8e9ca12e545 (diff) | |
download | vala-300f81c2517d875b5e1331d893d42f3901e4563e.tar.gz |
Do not use non-literal printf format strings
-rw-r--r-- | codegen/valagvariantmodule.vala | 2 | ||||
-rw-r--r-- | vala/valagenieparser.vala | 6 | ||||
-rw-r--r-- | vala/valaparser.vala | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/codegen/valagvariantmodule.vala b/codegen/valagvariantmodule.vala index b2d9861db..b50aca02c 100644 --- a/codegen/valagvariantmodule.vala +++ b/codegen/valagvariantmodule.vala @@ -126,7 +126,7 @@ public class Vala.GVariantModule : GAsyncModule { } } - sig = sig.printf (element_sig); + sig = sig.replace ("%s", element_sig); } if (sig == null && diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala index 25097a521..e7b6902b5 100644 --- a/vala/valagenieparser.vala +++ b/vala/valagenieparser.vala @@ -163,7 +163,7 @@ public class Vala.Genie.Parser : CodeVisitor { TokenType cur = current (); TokenType pre = tokens[index - 1].type; - throw new ParseError.SYNTAX (get_error ("expected %s but got %s with previous %s".printf (type.to_string (), cur.to_string (), pre.to_string()))); + throw new ParseError.SYNTAX (get_error ("expected %s but got %s with previous %s"), type.to_string (), cur.to_string (), pre.to_string()); } inline bool expect_terminator () throws ParseError { @@ -173,7 +173,7 @@ public class Vala.Genie.Parser : CodeVisitor { TokenType cur = current (); - throw new ParseError.SYNTAX (get_error ("expected line end or semicolon but got %s".printf (cur.to_string()))); + throw new ParseError.SYNTAX (get_error ("expected line end or semicolon but got %s"), cur.to_string()); } inline SourceLocation get_location () { @@ -2436,7 +2436,7 @@ public class Vala.Genie.Parser : CodeVisitor { TokenType cur = current (); TokenType pre = tokens[index-1].type; - throw new ParseError.SYNTAX (get_error ("expected declaration but got %s with previous %s".printf (cur.to_string (), pre.to_string()))); + throw new ParseError.SYNTAX (get_error ("expected declaration but got %s with previous %s"), cur.to_string (), pre.to_string()); } void parse_declarations (Symbol parent, bool root = false) throws ParseError { diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 11e8badaa..ab3fa15c5 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -126,7 +126,7 @@ public class Vala.Parser : CodeVisitor { return true; } - throw new ParseError.SYNTAX (get_error ("expected %s".printf (type.to_string ()))); + throw new ParseError.SYNTAX (get_error ("expected %s"), type.to_string ()); } inline SourceLocation get_location () { @@ -2698,7 +2698,7 @@ public class Vala.Parser : CodeVisitor { if (ModifierFlags.ABSTRACT in flags || ModifierFlags.VIRTUAL in flags || ModifierFlags.OVERRIDE in flags) { - throw new ParseError.SYNTAX (get_error ("the modifiers `abstract', `virtual', and `override' are not valid for %s methods".printf ((ModifierFlags.CLASS in flags) ? "class" : "static"))); + throw new ParseError.SYNTAX (get_error ("the modifiers `abstract', `virtual', and `override' are not valid for %s methods"), (ModifierFlags.CLASS in flags) ? "class" : "static"); } } |