From: Jürg Billeter Date: Tue, 1 Nov 2016 17:14:09 +0000 (+0100) Subject: Do not use non-literal printf format strings X-Git-Tag: 0.35.1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=300f81c2517d875b5e1331d893d42f3901e4563e;p=thirdparty%2Fvala.git Do not use non-literal printf format strings --- 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"); } }