]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not use non-literal printf format strings
authorJürg Billeter <j@bitron.ch>
Tue, 1 Nov 2016 17:14:09 +0000 (18:14 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 3 Nov 2016 19:47:31 +0000 (20:47 +0100)
codegen/valagvariantmodule.vala
vala/valagenieparser.vala
vala/valaparser.vala

index b2d9861db11d4ba522c0a95e8e1fea5502caf513..b50aca02c923bef130b1d1f70f6dae5363f8a925 100644 (file)
@@ -126,7 +126,7 @@ public class Vala.GVariantModule : GAsyncModule {
                                        }
                                }
 
-                               sig = sig.printf (element_sig);
+                               sig = sig.replace ("%s", element_sig);
                        }
 
                        if (sig == null &&
index 25097a521197c830efdd1a646898f19f953bafc6..e7b6902b5023379e689a9c4e32dfa6606cda2a4f 100644 (file)
@@ -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 {
index 11e8badaa0ebbee77326d1dfe26962e84a642eee..ab3fa15c59c446bd7e7f98948d8c4a96b9cf7f30 100644 (file)
@@ -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");
                        }
                }