]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Make use of new printf-like API of Report.*()
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 26 Oct 2020 15:10:37 +0000 (16:10 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 26 Oct 2020 15:10:37 +0000 (16:10 +0100)
60 files changed:
ccode/valaccodefile.vala
compiler/valacompiler.vala
vala/valaarraycreationexpression.vala
vala/valaassignment.vala
vala/valabinaryexpression.vala
vala/valablock.vala
vala/valacastexpression.vala
vala/valacatchclause.vala
vala/valaclass.vala
vala/valacodecontext.vala
vala/valacodewriter.vala
vala/valaconstant.vala
vala/valaconstructor.vala
vala/valacreationmethod.vala
vala/valadelegate.vala
vala/valadeletestatement.vala
vala/valaelementaccess.vala
vala/valaenum.vala
vala/valaerrordomain.vala
vala/valafield.vala
vala/valaflowanalyzer.vala
vala/valaforeachstatement.vala
vala/valagenieparser.vala
vala/valageniescanner.vala
vala/valagirparser.vala
vala/valainitializerlist.vala
vala/valainterface.vala
vala/valalambdaexpression.vala
vala/valalocalvariable.vala
vala/valamarkupreader.vala
vala/valamemberaccess.vala
vala/valamethod.vala
vala/valamethodcall.vala
vala/valaobjectcreationexpression.vala
vala/valaparameter.vala
vala/valaparser.vala
vala/valapostfixexpression.vala
vala/valaproperty.vala
vala/valapropertyaccessor.vala
vala/valaregexliteral.vala
vala/valareturnstatement.vala
vala/valascanner.vala
vala/valascope.vala
vala/valasemanticanalyzer.vala
vala/valasignal.vala
vala/valasliceexpression.vala
vala/valasourcefile.vala
vala/valastruct.vala
vala/valaswitchlabel.vala
vala/valasymbol.vala
vala/valasymbolresolver.vala
vala/valathrowstatement.vala
vala/valatypecheck.vala
vala/valaunaryexpression.vala
vala/valausedattr.vala
vala/valaversionattribute.vala
valadoc/treebuilder.vala
vapigen/valagidlparser.vala
vapigen/valavapicheck.vala
vapigen/valavapigen.vala

index b04b73d1015e91c872d7a2adead457fde1b221fd..629d2d19802f83ef2269f3725fe8a837937e4b28 100644 (file)
@@ -100,7 +100,7 @@ public class Vala.CCodeFile {
 
        public void add_function (CCodeFunction func) {
                if (!definitions.add (func.name)) {
-                       Report.error (null, "internal: Redefinition of `%s'".printf (func.name));
+                       Report.error (null, "internal: Redefinition of `%s'", func.name);
                        return;
                }
 
index 4cf66f3c5cb190978ddefe8bf51daac4cce1bb96..e5a6a21d11c5d5aaa87a8d1438d6044b1b84ac27 100644 (file)
@@ -437,13 +437,13 @@ class Vala.Compiler {
                                        int last_hyphen = gir_base.last_index_of_char ('-');
 
                                        if (last_hyphen == -1 || !gir_base.has_suffix (".gir")) {
-                                               Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
+                                               Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", gir);
                                        } else {
                                                string gir_namespace = gir_base.substring (0, last_hyphen);
                                                string gir_version = gir_base.substring (last_hyphen + 1, gir_len - last_hyphen - 5);
                                                gir_version.canon ("0123456789.", '?');
                                                if (gir_namespace == "" || gir_version == "" || !gir_version[0].isdigit () || gir_version.contains ("?")) {
-                                                       Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
+                                                       Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", gir);
                                                } else {
                                                        var gir_writer = new GIRWriter ();
 
index 8af8fa8fe6cf044b4013d5b49ec323114147847d..fdc2eef8d4595a3a0d7d65f584e435be289e56e1 100644 (file)
@@ -216,7 +216,7 @@ public class Vala.ArrayCreationExpression : Expression {
                                }
                                if (subsize >= 0 && subsize != size) {
                                        il.error = true;
-                                       Report.error (il.source_reference, "Expected initializer list of size %d, got size %d".printf (subsize, size));
+                                       Report.error (il.source_reference, "Expected initializer list of size %d, got size %d", subsize, size);
                                        return -1;
                                } else {
                                        subsize = size;
@@ -280,7 +280,7 @@ public class Vala.ArrayCreationExpression : Expression {
                                error = true;
                                var actual_type = new ArrayType (element_type, calc_sizes.size, source_reference);
                                ((ArrayType) actual_type).length_type = length_type;
-                               Report.error (initlist.source_reference, "Expected initializer for `%s' but got `%s'".printf (target_type.to_string (), actual_type.to_string ()));
+                               Report.error (initlist.source_reference, "Expected initializer for `%s' but got `%s'", target_type.to_string (), actual_type.to_string ());
                        }
                }
 
index f40bfd4e7cef90fa9d5819bab0dd18107c097366..79090ad9b76827dc6a51a94508127c48d049192f 100644 (file)
@@ -168,7 +168,7 @@ public class Vala.Assignment : Expression {
                        }
                        if (ma.prototype_access) {
                                error = true;
-                               Report.error (source_reference, "Access to instance member `%s' denied".printf (ma.symbol_reference.get_full_name ()));
+                               Report.error (source_reference, "Access to instance member `%s' denied", ma.symbol_reference.get_full_name ());
                                return false;
                        }
 
@@ -274,7 +274,7 @@ public class Vala.Assignment : Expression {
                                if (prop.set_accessor == null
                                    || (!prop.set_accessor.writable && !(context.analyzer.find_current_method () is CreationMethod || context.analyzer.is_in_constructor ()))) {
                                        ma.error = true;
-                                       Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+                                       Report.error (ma.source_reference, "Property `%s' is read-only", prop.get_full_name ());
                                        return false;
                                } else if (!context.deprecated
                                           && !prop.set_accessor.writable
@@ -282,7 +282,7 @@ public class Vala.Assignment : Expression {
                                        if (ma.inner.symbol_reference != context.analyzer.find_current_method ().this_parameter) {
                                                // trying to set construct-only property in creation method for foreign instance
                                                error = true;
-                                               Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+                                               Report.error (ma.source_reference, "Property `%s' is read-only", prop.get_full_name ());
                                                return false;
                                        } else {
                                                error = true;
@@ -303,7 +303,7 @@ public class Vala.Assignment : Expression {
                                                unowned Method m = (Method) right.symbol_reference;
                                                unowned Delegate cb = ((DelegateType) variable.variable_type).delegate_symbol;
                                                error = true;
-                                               Report.error (source_reference, "Declaration of method `%s' is not compatible with delegate `%s'".printf (m.get_full_name (), cb.get_full_name ()));
+                                               Report.error (source_reference, "Declaration of method `%s' is not compatible with delegate `%s'", m.get_full_name (), cb.get_full_name ());
                                                return false;
                                        }
                                } else {
@@ -328,7 +328,7 @@ public class Vala.Assignment : Expression {
 
                                if (!right.value_type.compatible (left.value_type)) {
                                        error = true;
-                                       Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'".printf (right.value_type.to_string (), left.value_type.to_string ()));
+                                       Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'", right.value_type.to_string (), left.value_type.to_string ());
                                        return false;
                                }
 
@@ -372,7 +372,7 @@ public class Vala.Assignment : Expression {
 
                        if (!right.value_type.compatible (left.value_type)) {
                                error = true;
-                               Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'".printf (right.value_type.to_string (), left.value_type.to_string ()));
+                               Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'", right.value_type.to_string (), left.value_type.to_string ());
                                return false;
                        }
 
index e1732156c211394c3a0365df1f5b418ff6d885a4..7b9b7821472c301045172db6c2ce9021c536b9c9 100644 (file)
@@ -336,12 +336,12 @@ public class Vala.BinaryExpression : Expression {
 
                if (left.value_type is FieldPrototype || left.value_type is PropertyPrototype) {
                        error = true;
-                       Report.error (left.source_reference, "Access to instance member `%s' denied".printf (left.symbol_reference.get_full_name ()));
+                       Report.error (left.source_reference, "Access to instance member `%s' denied", left.symbol_reference.get_full_name ());
                        return false;
                }
                if (right.value_type is FieldPrototype || right.value_type is PropertyPrototype) {
                        error = true;
-                       Report.error (right.source_reference, "Access to instance member `%s' denied".printf (right.symbol_reference.get_full_name ()));
+                       Report.error (right.source_reference, "Access to instance member `%s' denied", right.symbol_reference.get_full_name ());
                        return false;
                }
 
@@ -429,7 +429,7 @@ public class Vala.BinaryExpression : Expression {
 
                        if (value_type == null) {
                                error = true;
-                               Report.error (source_reference, "Arithmetic operation not supported for types `%s' and `%s'".printf (left.value_type.to_string (), right.value_type.to_string ()));
+                               Report.error (source_reference, "Arithmetic operation not supported for types `%s' and `%s'", left.value_type.to_string (), right.value_type.to_string ());
                                return false;
                        }
                        break;
@@ -443,7 +443,7 @@ public class Vala.BinaryExpression : Expression {
 
                        if (value_type == null) {
                                error = true;
-                               Report.error (source_reference, "Arithmetic operation not supported for types `%s' and `%s'".printf (left.value_type.to_string (), right.value_type.to_string ()));
+                               Report.error (source_reference, "Arithmetic operation not supported for types `%s' and `%s'", left.value_type.to_string (), right.value_type.to_string ());
                                return false;
                        }
                        break;
@@ -468,7 +468,7 @@ public class Vala.BinaryExpression : Expression {
 
                                if (resulting_type == null) {
                                        error = true;
-                                       Report.error (source_reference, "Relational operation not supported for types `%s' and `%s'".printf (left.value_type.to_string (), right.value_type.to_string ()));
+                                       Report.error (source_reference, "Relational operation not supported for types `%s' and `%s'", left.value_type.to_string (), right.value_type.to_string ());
                                        return false;
                                }
 
@@ -510,7 +510,7 @@ public class Vala.BinaryExpression : Expression {
 
                        if (!right.value_type.compatible (left.value_type)
                            && !left.value_type.compatible (right.value_type)) {
-                               Report.error (source_reference, "Equality operation: `%s' and `%s' are incompatible".printf (right.value_type.to_string (), left.value_type.to_string ()));
+                               Report.error (source_reference, "Equality operation: `%s' and `%s' are incompatible", right.value_type.to_string (), left.value_type.to_string ());
                                error = true;
                                return false;
                        }
@@ -571,23 +571,23 @@ public class Vala.BinaryExpression : Expression {
                        } else if (right.value_type is ArrayType) {
                                if (!left.value_type.compatible (((ArrayType) right.value_type).element_type)) {
                                        error = true;
-                                       Report.error (source_reference, "Cannot look for `%s' in `%s'".printf (left.value_type.to_string (), right.value_type.to_string ()));
+                                       Report.error (source_reference, "Cannot look for `%s' in `%s'", left.value_type.to_string (), right.value_type.to_string ());
                                }
                        } else {
                                // otherwise require a bool contains () method
                                var contains_method = right.value_type.get_member ("contains") as Method;
                                if (contains_method == null) {
-                                       Report.error (source_reference, "`%s' does not have a `contains' method".printf (right.value_type.to_string ()));
+                                       Report.error (source_reference, "`%s' does not have a `contains' method", right.value_type.to_string ());
                                        error = true;
                                        return false;
                                }
                                if (contains_method.get_parameters ().size != 1) {
-                                       Report.error (source_reference, "`%s' must have one parameter".printf (contains_method.get_full_name ()));
+                                       Report.error (source_reference, "`%s' must have one parameter", contains_method.get_full_name ());
                                        error = true;
                                        return false;
                                }
                                if (!contains_method.return_type.compatible (context.analyzer.bool_type)) {
-                                       Report.error (source_reference, "`%s' must return a boolean value".printf (contains_method.get_full_name ()));
+                                       Report.error (source_reference, "`%s' must return a boolean value", contains_method.get_full_name ());
                                        error = true;
                                        return false;
                                }
index 5ae943c3264d76929859ec1cc7cda43b49276b1f..e13f2b2be213820a54e5556f5cd4721311684533 100644 (file)
@@ -91,7 +91,7 @@ public class Vala.Block : Symbol, Statement {
                unowned Symbol? parent_block = parent_symbol;
                while (parent_block is Block || parent_block is Method || parent_block is PropertyAccessor) {
                        if (parent_block.scope.lookup (local.name) != null) {
-                               Report.error (local.source_reference, "Local variable `%s' conflicts with a local variable or constant declared in a parent scope".printf (local.name));
+                               Report.error (local.source_reference, "Local variable `%s' conflicts with a local variable or constant declared in a parent scope", local.name);
                                break;
                        }
                        parent_block = parent_block.parent_symbol;
@@ -116,7 +116,7 @@ public class Vala.Block : Symbol, Statement {
                unowned Symbol? parent_block = parent_symbol;
                while (parent_block is Block || parent_block is Method || parent_block is PropertyAccessor) {
                        if (parent_block.scope.lookup (constant.name) != null) {
-                               Report.error (constant.source_reference, "Local constant `%s' conflicts with a local variable or constant declared in a parent scope".printf (constant.name));
+                               Report.error (constant.source_reference, "Local constant `%s' conflicts with a local variable or constant declared in a parent scope", constant.name);
                                break;
                        }
                        parent_block = parent_block.parent_symbol;
index d938b53911a0f3c93af00217eff4b23c7a0ccf5f..86b9f9a1289f0ffbaadfb56b0610e7c2483ae947 100644 (file)
@@ -207,7 +207,7 @@ public class Vala.CastExpression : Expression {
                        value_type.value_owned = true;
                        if (value_type.get_type_signature () == null) {
                                error = true;
-                               Report.error (source_reference, "Casting of `GLib.Variant' to `%s' is not supported".printf (value_type.to_qualified_string ()));
+                               Report.error (source_reference, "Casting of `GLib.Variant' to `%s' is not supported", value_type.to_qualified_string ());
                        }
                }
 
index 4ecb79db8cf4ea1eed6e86fd16ccb6e3be0f661d..085d2c49bf56b03228597759e6be22029a9121d6 100644 (file)
@@ -119,7 +119,7 @@ public class Vala.CatchClause : CodeNode {
 
                if (error_type != null) {
                        if (!(error_type is ErrorType)) {
-                               Report.error (source_reference, "clause must catch a valid error type, found `%s' instead".printf (error_type.to_string ()));
+                               Report.error (source_reference, "clause must catch a valid error type, found `%s' instead", error_type.to_string ());
                                error = true;
                        }
 
index 3d7fee98c84b91fe54b6ac2a8434d7fc3e25e479..9ebb17271d93428a073ec9861bbf5ea4cbd0f2ed 100644 (file)
@@ -293,7 +293,7 @@ public class Vala.Class : ObjectTypeSymbol {
                        unowned CreationMethod cm = (CreationMethod) m;
                        if (cm.class_name != null && cm.class_name != name) {
                                // class_name is null for constructors generated by GIdlParser
-                               Report.error (m.source_reference, "missing return type in method `%s.%s´".printf (get_full_name (), cm.class_name));
+                               Report.error (m.source_reference, "missing return type in method `%s.%s´", get_full_name (), cm.class_name);
                                m.error = true;
                                return;
                        }
@@ -540,14 +540,14 @@ public class Vala.Class : ObjectTypeSymbol {
 
                        if (!(base_type_reference is ObjectType)) {
                                error = true;
-                               Report.error (source_reference, "base type `%s' of class `%s' is not an object type".printf (base_type_reference.to_string (), get_full_name ()));
+                               Report.error (source_reference, "base type `%s' of class `%s' is not an object type", base_type_reference.to_string (), get_full_name ());
                                return false;
                        }
 
                        // check whether base type is at least as accessible as the class
                        if (!context.analyzer.is_type_accessible (this, base_type_reference)) {
                                error = true;
-                               Report.error (source_reference, "base type `%s' is less accessible than class `%s'".printf (base_type_reference.to_string (), get_full_name ()));
+                               Report.error (source_reference, "base type `%s' is less accessible than class `%s'", base_type_reference.to_string (), get_full_name ());
                                return false;
                        }
 
@@ -574,12 +574,12 @@ public class Vala.Class : ObjectTypeSymbol {
 
                if (base_class != null && base_class.is_singleton) {
                        error = true;
-                       Report.error (source_reference, "`%s' cannot inherit from SingleInstance class `%s'".printf (get_full_name (), base_class.get_full_name ()));
+                       Report.error (source_reference, "`%s' cannot inherit from SingleInstance class `%s'", get_full_name (), base_class.get_full_name ());
                }
 
                if (is_singleton && !is_subtype_of (context.analyzer.object_type)) {
                        error = true;
-                       Report.error (source_reference, "SingleInstance class `%s' requires inheritance from `GLib.Object'".printf (get_full_name ()));
+                       Report.error (source_reference, "SingleInstance class `%s' requires inheritance from `GLib.Object'", get_full_name ());
                }
 
                /* singleton classes require an instance constructor */
@@ -591,18 +591,18 @@ public class Vala.Class : ObjectTypeSymbol {
 
                if (base_class != null && base_class.is_sealed) {
                        error = true;
-                       Report.error (source_reference, "`%s' cannot inherit from sealed class `%s'".printf (get_full_name (), base_class.get_full_name ()));
+                       Report.error (source_reference, "`%s' cannot inherit from sealed class `%s'", get_full_name (), base_class.get_full_name ());
                }
 
                if (is_sealed) {
                        if (is_compact) {
                                error = true;
-                               Report.error (source_reference, "Sealed class `%s' cannot be compact".printf (get_full_name ()));
+                               Report.error (source_reference, "Sealed class `%s' cannot be compact", get_full_name ());
                                return false;
                        }
                        if (is_abstract) {
                                error = true;
-                               Report.error (source_reference, "Sealed class `%s' cannot be abstract".printf (get_full_name ()));
+                               Report.error (source_reference, "Sealed class `%s' cannot be abstract", get_full_name ());
                                return false;
                        }
                        if (!external_package) {
@@ -699,7 +699,7 @@ public class Vala.Class : ObjectTypeSymbol {
                        foreach (DataType base_type in get_base_types ()) {
                                if (base_type.type_symbol is Interface) {
                                        error = true;
-                                       Report.error (source_reference, "compact classes `%s' may not implement interfaces".printf (get_full_name ()));
+                                       Report.error (source_reference, "compact classes `%s' may not implement interfaces", get_full_name ());
                                }
                        }
 
@@ -787,7 +787,7 @@ public class Vala.Class : ObjectTypeSymbol {
                                                        }
                                                        if (!implemented) {
                                                                error = true;
-                                                               Report.error (source_reference, "`%s' does not implement interface method `%s'".printf (get_full_name (), m.get_full_name ()));
+                                                               Report.error (source_reference, "`%s' does not implement interface method `%s'", get_full_name (), m.get_full_name ());
                                                        }
                                                }
                                        }
@@ -807,14 +807,14 @@ public class Vala.Class : ObjectTypeSymbol {
                                                                // No check at all for "new" classified properties, really?
                                                                if (!base_prop.hides && !base_prop.compatible (prop, out invalid_match)) {
                                                                        error = true;
-                                                                       Report.error (source_reference, "Type and/or accessors of inherited properties `%s' and `%s' do not match: %s.".printf (prop.get_full_name (), base_prop.get_full_name (), invalid_match));
+                                                                       Report.error (source_reference, "Type and/or accessors of inherited properties `%s' and `%s' do not match: %s.", prop.get_full_name (), base_prop.get_full_name (), invalid_match);
                                                                }
                                                                // property is used as interface implementation, so it is not unused
                                                                sym.version.check (context, source_reference);
                                                                sym.used = true;
                                                        } else {
                                                                error = true;
-                                                               Report.error (source_reference, "`%s' does not implement interface property `%s'".printf (get_full_name (), prop.get_full_name ()));
+                                                               Report.error (source_reference, "`%s' does not implement interface property `%s'", get_full_name (), prop.get_full_name ());
                                                        }
                                                }
                                        }
@@ -830,7 +830,7 @@ public class Vala.Class : ObjectTypeSymbol {
                                                        var override_method = SemanticAnalyzer.symbol_lookup_inherited (this, base_method.name) as Method;
                                                        if (override_method == null || !override_method.overrides) {
                                                                error = true;
-                                                               Report.error (source_reference, "`%s' does not implement abstract method `%s'".printf (get_full_name (), base_method.get_full_name ()));
+                                                               Report.error (source_reference, "`%s' does not implement abstract method `%s'", get_full_name (), base_method.get_full_name ());
                                                        }
                                                }
                                        }
@@ -839,7 +839,7 @@ public class Vala.Class : ObjectTypeSymbol {
                                                        var override_property = SemanticAnalyzer.symbol_lookup_inherited (this, base_property.name) as Property;
                                                        if (override_property == null || !override_property.overrides) {
                                                                error = true;
-                                                               Report.error (source_reference, "`%s' does not implement abstract property `%s'".printf (get_full_name (), base_property.get_full_name ()));
+                                                               Report.error (source_reference, "`%s' does not implement abstract property `%s'", get_full_name (), base_property.get_full_name ());
                                                        }
                                                }
                                        }
index 6b666527428e9b31b4d7e10d430cbf0d9be9ee38..510225e1598402e4490c438d709a0ded847984d0 100644 (file)
@@ -313,7 +313,7 @@ public class Vala.CodeContext {
         */
        public void add_source_file (SourceFile file) {
                if (source_files_map.contains (file.filename)) {
-                       Report.warning (null, "Ignoring source file `%s', which was already added to this context".printf (file.filename));
+                       Report.warning (null, "Ignoring source file `%s', which was already added to this context", file.filename);
                        return;
                }
 
@@ -389,7 +389,7 @@ public class Vala.CodeContext {
                        path = get_gir_path (pkg);
                }
                if (path == null) {
-                       Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (pkg));
+                       Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories", pkg);
                        return false;
                }
 
@@ -431,7 +431,7 @@ public class Vala.CodeContext {
                                }
                        }
                } catch (FileError e) {
-                       Report.error (null, "Unable to read dependency file: %s".printf (e.message));
+                       Report.error (null, "Unable to read dependency file: %s", e.message);
                        return false;
                }
 
@@ -449,7 +449,7 @@ public class Vala.CodeContext {
         */
        public bool add_source_filename (string filename, bool is_source = false, bool cmdline = false) {
                if (!FileUtils.test (filename, FileTest.EXISTS)) {
-                       Report.error (null, "%s not found".printf (filename));
+                       Report.error (null, "%s not found", filename);
                        return false;
                }
 
@@ -487,7 +487,7 @@ public class Vala.CodeContext {
                } else if (filename.has_suffix (".h")) {
                        /* Ignore */
                } else {
-                       Report.error (null, "%s is not a supported source file type. Only .vala, .vapi, .gs, and .c files are supported.".printf (filename));
+                       Report.error (null, "%s is not a supported source file type. Only .vala, .vapi, .gs, and .c files are supported.", filename);
                        return false;
                }
 
@@ -541,7 +541,7 @@ public class Vala.CodeContext {
 
        public void add_define (string define) {
                if (is_defined (define)) {
-                       Report.warning (null, "`%s' is already defined".printf (define));
+                       Report.warning (null, "`%s' is already defined", define);
                        if (/VALA_0_\d+/.match_all (define)) {
                                Report.warning (null, "`VALA_0_XX' defines are automatically added up to current compiler version in use");
                        } else if (/GLIB_2_\d+/.match_all (define)) {
@@ -742,7 +742,7 @@ public class Vala.CodeContext {
                var stream = FileStream.open (filename, "w");
 
                if (stream == null) {
-                       Report.error (null, "unable to open `%s' for writing".printf (filename));
+                       Report.error (null, "unable to open `%s' for writing", filename);
                        return;
                }
 
@@ -759,7 +759,7 @@ public class Vala.CodeContext {
                var stream = FileStream.open (filename, "w");
 
                if (stream == null) {
-                       Report.error (null, "unable to open `%s' for writing".printf (filename));
+                       Report.error (null, "unable to open `%s' for writing", filename);
                        return;
                }
 
@@ -907,7 +907,7 @@ public class Vala.CodeContext {
                try {
                        Process.spawn_command_line_sync (pc, out output, null, out exit_status);
                        if (exit_status != 0) {
-                               Report.error (null, "%s exited with status %d".printf (pkg_config_command, exit_status));
+                               Report.error (null, "%s exited with status %d", pkg_config_command, exit_status);
                                return null;
                        }
                } catch (SpawnError e) {
index 20415cbddf0d89bd12faeed92af533952072f306..f555b7a020630eb9310af08611647073bc8e04ce 100644 (file)
@@ -79,7 +79,7 @@ public class Vala.CodeWriter : CodeVisitor {
                }
 
                if (stream == null) {
-                       Report.error (null, "unable to open `%s' for writing".printf (filename));
+                       Report.error (null, "unable to open `%s' for writing", filename);
                        return;
                }
 
index 871cff62e2b48e35f23a452bb632c08bf57eb04a..fcbb4c321dc777842e0ff6b08d8cc780d4af55d5 100644 (file)
@@ -117,7 +117,7 @@ public class Vala.Constant : Symbol {
 
                if (!check_const_type (type_reference, context)) {
                        error = true;
-                       Report.error (source_reference, "`%s' not supported as type for constants".printf (type_reference.to_string ()));
+                       Report.error (source_reference, "`%s' not supported as type for constants", type_reference.to_string ());
                        return false;
                }
 
@@ -138,7 +138,7 @@ public class Vala.Constant : Symbol {
 
                                if (!value.value_type.compatible (type_reference)) {
                                        error = true;
-                                       Report.error (source_reference, "Cannot convert from `%s' to `%s'".printf (value.value_type.to_string (), type_reference.to_string ()));
+                                       Report.error (source_reference, "Cannot convert from `%s' to `%s'", value.value_type.to_string (), type_reference.to_string ());
                                        return false;
                                }
 
@@ -171,7 +171,7 @@ public class Vala.Constant : Symbol {
                }
 
                if (!external_package && !hides && get_hidden_member () != null) {
-                       Report.warning (source_reference, "%s hides inherited constant `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+                       Report.warning (source_reference, "%s hides inherited constant `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
                }
 
                context.analyzer.current_source_file = old_source_file;
index 733a1566d2b6d7e877039b01fa07b17b39ffbac7..97f4bf4f4de5ae042eed2410d08a3ba4a2d5bdb3 100644 (file)
@@ -82,7 +82,7 @@ public class Vala.Constructor : Subroutine {
                        body.get_error_types (body_errors);
                        foreach (DataType body_error_type in body_errors) {
                                if (!((ErrorType) body_error_type).dynamic_error) {
-                                       Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+                                       Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string());
                                }
                        }
                }
index ed15bf46d95ebe1a2888caca3237c897f7774ae4..c5a98dc08bd36aee8a043834d373ccc48db0cdeb 100644 (file)
@@ -88,7 +88,7 @@ public class Vala.CreationMethod : Method {
 
                if (class_name != null && class_name != parent_symbol.name) {
                        // class_name is null for constructors generated by GIdlParser
-                       Report.error (source_reference, "missing return type in method `%s.%s´".printf (context.analyzer.current_symbol.get_full_name (), class_name));
+                       Report.error (source_reference, "missing return type in method `%s.%s´", context.analyzer.current_symbol.get_full_name (), class_name);
                        error = true;
                        return false;
                }
@@ -124,7 +124,7 @@ public class Vala.CreationMethod : Method {
                                // check whether error type is at least as accessible as the creation method
                                if (!context.analyzer.is_type_accessible (this, error_type)) {
                                        error = true;
-                                       Report.error (source_reference, "error type `%s' is less accessible than creation method `%s'".printf (error_type.to_string (), get_full_name ()));
+                                       Report.error (source_reference, "error type `%s' is less accessible than creation method `%s'", error_type.to_string (), get_full_name ());
                                        return false;
                                }
                        }
@@ -184,7 +184,7 @@ public class Vala.CreationMethod : Method {
 
                if (is_abstract || is_virtual || overrides) {
                        error = true;
-                       Report.error (source_reference, "The creation method `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ()));
+                       Report.error (source_reference, "The creation method `%s' cannot be marked as override, virtual, or abstract", get_full_name ());
                        return false;
                }
 
@@ -202,7 +202,7 @@ public class Vala.CreationMethod : Method {
                                        }
                                }
                                if (!can_propagate_error && !((ErrorType) body_error_type).dynamic_error) {
-                                       Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+                                       Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string());
                                }
                        }
                }
index b498133c65ccc2bd8665e1c8a34dd6909b388a9c..770d39ac63b8b504c3493a394e2199d786b284d7 100644 (file)
@@ -313,7 +313,7 @@ public class Vala.Delegate : TypeSymbol, Callable {
 
                if (return_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
                        error = true;
-                       Report.error (source_reference, "`%s' not supported as return type".printf (return_type.type_symbol.get_full_name ()));
+                       Report.error (source_reference, "`%s' not supported as return type", return_type.type_symbol.get_full_name ());
                        return false;
                }
 
@@ -330,7 +330,7 @@ public class Vala.Delegate : TypeSymbol, Callable {
                                // check whether error type is at least as accessible as the delegate
                                if (!context.analyzer.is_type_accessible (this, error_type)) {
                                        error = true;
-                                       Report.error (source_reference, "error type `%s' is less accessible than delegate `%s'".printf (error_type.to_string (), get_full_name ()));
+                                       Report.error (source_reference, "error type `%s' is less accessible than delegate `%s'", error_type.to_string (), get_full_name ());
                                        return false;
                                }
                        }
index 2613a83fb7fe7729eac87d57aea13d2fd1d91a5b..f0a39f7c79611bde76ff1898ee1a2db714a18a26 100644 (file)
@@ -73,7 +73,7 @@ public class Vala.DeleteStatement : CodeNode, Statement {
 
                if (!(expression.value_type is PointerType) && !(expression.value_type is ArrayType)) {
                        error = true;
-                       Report.error (source_reference, "delete operator not supported for `%s'".printf (expression.value_type.to_string ()));
+                       Report.error (source_reference, "delete operator not supported for `%s'", expression.value_type.to_string ());
                }
 
                return !error;
index 45b02ecdb70a330863e5be0817ddd2dd6809494f..d866d2f0b894c32df0ae1dd170f5d203ca6064b4 100644 (file)
@@ -198,10 +198,10 @@ public class Vala.ElementAccess : Expression {
 
                        if (array_type.rank < get_indices ().size) {
                                error = true;
-                               Report.error (source_reference, "%d extra indices for element access".printf (get_indices ().size - array_type.rank));
+                               Report.error (source_reference, "%d extra indices for element access", get_indices ().size - array_type.rank);
                        } else if (array_type.rank > get_indices ().size) {
                                error = true;
-                               Report.error (source_reference, "%d missing indices for element access".printf (array_type.rank - get_indices ().size));
+                               Report.error (source_reference, "%d missing indices for element access", array_type.rank - get_indices ().size);
                        }
                } else if (pointer_type != null && !pointer_type.base_type.is_reference_type_or_type_parameter ()) {
                        value_type = pointer_type.base_type.copy ();
@@ -232,7 +232,7 @@ public class Vala.ElementAccess : Expression {
                        }
 
                        error = true;
-                       Report.error (source_reference, "The expression `%s' does not denote an array".printf (container.value_type.to_string ()));
+                       Report.error (source_reference, "The expression `%s' does not denote an array", container.value_type.to_string ());
                        return false;
                }
 
index 592e6e7a8d9b79a6bdc4ac090d0adbbcb32a252a..7a9aa5bb036c603fa7e19bd7b66e881fc90bc6fb 100644 (file)
@@ -167,7 +167,7 @@ public class Vala.Enum : TypeSymbol {
                context.analyzer.current_symbol = this;
 
                if (values.size <= 0) {
-                       Report.error (source_reference, "Enum `%s' requires at least one value".printf (get_full_name ()));
+                       Report.error (source_reference, "Enum `%s' requires at least one value", get_full_name ());
                        error = true;
                        return false;
                }
index 311f2997545129ab22e56eaafbc376e51234acaf..b6239f1a4a762d4801be7478f69c8794844d3fa2 100644 (file)
@@ -115,7 +115,7 @@ public class Vala.ErrorDomain : TypeSymbol {
                checked = true;
 
                if (codes.size <= 0) {
-                       Report.error (source_reference, "Error domain `%s' requires at least one code".printf (get_full_name ()));
+                       Report.error (source_reference, "Error domain `%s' requires at least one code", get_full_name ());
                        error = true;
                        return false;
                }
index ed59f582ae63d640c68af6999596b3993e471842..bee686222e06e343411da19dd8137604d598f9fc 100644 (file)
@@ -100,7 +100,7 @@ public class Vala.Field : Variable, Lockable {
 
                if (variable_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
                        error = true;
-                       Report.error (source_reference, "`%s' not supported as field type".printf (variable_type.type_symbol.get_full_name ()));
+                       Report.error (source_reference, "`%s' not supported as field type", variable_type.type_symbol.get_full_name ());
                        return false;
                }
 
@@ -117,7 +117,7 @@ public class Vala.Field : Variable, Lockable {
                // check whether field type is at least as accessible as the field
                if (!context.analyzer.is_type_accessible (this, variable_type)) {
                        error = true;
-                       Report.error (source_reference, "field type `%s' is less accessible than field `%s'".printf (variable_type.to_string (), get_full_name ()));
+                       Report.error (source_reference, "field type `%s' is less accessible than field `%s'", variable_type.to_string (), get_full_name ());
                        return false;
                }
 
@@ -158,7 +158,7 @@ public class Vala.Field : Variable, Lockable {
 
                        if (!initializer.value_type.compatible (variable_type)) {
                                error = true;
-                               Report.error (source_reference, "Cannot convert from `%s' to `%s'".printf (initializer.value_type.to_string (), variable_type.to_string ()));
+                               Report.error (source_reference, "Cannot convert from `%s' to `%s'", initializer.value_type.to_string (), variable_type.to_string ());
                                return false;
                        }
 
@@ -226,7 +226,7 @@ public class Vala.Field : Variable, Lockable {
                }
 
                if (!external_package && !hides && get_hidden_member () != null) {
-                       Report.warning (source_reference, "%s hides inherited field `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+                       Report.warning (source_reference, "%s hides inherited field `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
                }
 
                context.analyzer.current_source_file = old_source_file;
index 907c219eadcedecddb8e7cc55e2fe32d1cc6f4cb..a859d7b8b24c6b869289447adf553bd09a92cfcb 100644 (file)
@@ -146,7 +146,7 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                        if (!f.is_private_symbol () && (context.internal_header_filename != null || context.use_fast_vapi)) {
                                // do not warn if internal member may be used outside this compilation unit
                        } else {
-                               Report.warning (f.source_reference, "field `%s' never used".printf (f.get_full_name ()));
+                               Report.warning (f.source_reference, "Field `%s' never used", f.get_full_name ());
                        }
                }
        }
@@ -175,7 +175,7 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                            && m.get_attribute_bool ("DBus", "visible", true)) {
                                // do not warn if internal member is a visible DBus method
                        } else {
-                               Report.warning (m.source_reference, "method `%s' never used".printf (m.get_full_name ()));
+                               Report.warning (m.source_reference, "Method `%s' never used", m.get_full_name ());
                        }
                }
 
@@ -422,10 +422,10 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                                foreach (Variable variable in phi.operands) {
                                        if (variable == null) {
                                                if (used_var is LocalVariable) {
-                                                       Report.error (used_var.source_reference, "use of possibly unassigned local variable `%s'".printf (used_var.name));
+                                                       Report.error (used_var.source_reference, "Use of possibly unassigned local variable `%s'", used_var.name);
                                                } else {
                                                        // parameter
-                                                       Report.warning (used_var.source_reference, "use of possibly unassigned parameter `%s'".printf (used_var.name));
+                                                       Report.warning (used_var.source_reference, "Use of possibly unassigned parameter `%s'", used_var.name);
                                                }
                                                continue;
                                        }
@@ -458,10 +458,10 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                                var variable_stack = var_map.get (var_symbol);
                                if (variable_stack == null || variable_stack.size == 0) {
                                        if (var_symbol is LocalVariable) {
-                                               Report.error (node.source_reference, "use of possibly unassigned local variable `%s'".printf (var_symbol.name));
+                                               Report.error (node.source_reference, "Use of possibly unassigned local variable `%s'", var_symbol.name);
                                        } else {
                                                // parameter
-                                               Report.warning (node.source_reference, "use of possibly unassigned parameter `%s'".printf (var_symbol.name));
+                                               Report.warning (node.source_reference, "Use of possibly unassigned parameter `%s'", var_symbol.name);
                                        }
                                        continue;
                                }
@@ -561,7 +561,7 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                }
 
                if (!stmt.declaration.used) {
-                       Report.warning (stmt.declaration.source_reference, "local variable `%s' declared but never used".printf (stmt.declaration.name));
+                       Report.warning (stmt.declaration.source_reference, "Local variable `%s' declared but never used", stmt.declaration.name);
                }
 
                current_block.add_node (stmt);
@@ -733,7 +733,7 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                                foreach (var val in remaining_values) {
                                        missing_vals += val.name;
                                }
-                               Report.warning (stmt.source_reference, "switch does not handle `%s' of enum `%s'".printf (string.joinv ("', `", missing_vals), en.get_full_name ()));
+                               Report.warning (stmt.source_reference, "Switch does not handle `%s' of enum `%s'", string.joinv ("', `", missing_vals), en.get_full_name ());
                        }
                }
 
index 2c74773e8e920949caed6fd46c5693fba29e163f..da80b24aa142803f608074cddd142d2f020d256a 100644 (file)
@@ -230,18 +230,18 @@ public class Vala.ForeachStatement : Block {
 
                var iterator_method = collection_type.get_member ("iterator") as Method;
                if (iterator_method == null) {
-                       Report.error (collection.source_reference, "`%s' does not have an `iterator' method".printf (collection_type.to_string ()));
+                       Report.error (collection.source_reference, "`%s' does not have an `iterator' method", collection_type.to_string ());
                        error = true;
                        return false;
                }
                if (iterator_method.get_parameters ().size != 0) {
-                       Report.error (collection.source_reference, "`%s' must not have any parameters".printf (iterator_method.get_full_name ()));
+                       Report.error (collection.source_reference, "`%s' must not have any parameters", iterator_method.get_full_name ());
                        error = true;
                        return false;
                }
                var iterator_type = iterator_method.return_type.get_actual_type (collection_type, null, this);
                if (iterator_type is VoidType) {
-                       Report.error (collection.source_reference, "`%s' must return an iterator".printf (iterator_method.get_full_name ()));
+                       Report.error (collection.source_reference, "`%s' must return an iterator", iterator_method.get_full_name ());
                        error = true;
                        return false;
                }
@@ -253,13 +253,13 @@ public class Vala.ForeachStatement : Block {
                var next_method = iterator_type.get_member ("next") as Method;
                if (next_value_method != null) {
                        if (next_value_method.get_parameters ().size != 0) {
-                               Report.error (collection.source_reference, "`%s' must not have any parameters".printf (next_value_method.get_full_name ()));
+                               Report.error (collection.source_reference, "`%s' must not have any parameters", next_value_method.get_full_name ());
                                error = true;
                                return false;
                        }
                        var element_type = next_value_method.return_type.get_actual_type (iterator_type, null, this);
                        if (!element_type.nullable) {
-                               Report.error (collection.source_reference, "return type of `%s' must be nullable".printf (next_value_method.get_full_name ()));
+                               Report.error (collection.source_reference, "return type of `%s' must be nullable", next_value_method.get_full_name ());
                                error = true;
                                return false;
                        }
@@ -277,29 +277,29 @@ public class Vala.ForeachStatement : Block {
                        add_statement (loop);
                } else if (next_method != null) {
                        if (next_method.get_parameters ().size != 0) {
-                               Report.error (collection.source_reference, "`%s' must not have any parameters".printf (next_method.get_full_name ()));
+                               Report.error (collection.source_reference, "`%s' must not have any parameters", next_method.get_full_name ());
                                error = true;
                                return false;
                        }
                        if (!next_method.return_type.compatible (context.analyzer.bool_type)) {
-                               Report.error (collection.source_reference, "`%s' must return a boolean value".printf (next_method.get_full_name ()));
+                               Report.error (collection.source_reference, "`%s' must return a boolean value", next_method.get_full_name ());
                                error = true;
                                return false;
                        }
                        var get_method = iterator_type.get_member ("get") as Method;
                        if (get_method == null) {
-                               Report.error (collection.source_reference, "`%s' does not have a `get' method".printf (iterator_type.to_string ()));
+                               Report.error (collection.source_reference, "`%s' does not have a `get' method", iterator_type.to_string ());
                                error = true;
                                return false;
                        }
                        if (get_method.get_parameters ().size != 0) {
-                               Report.error (collection.source_reference, "`%s' must not have any parameters".printf (get_method.get_full_name ()));
+                               Report.error (collection.source_reference, "`%s' must not have any parameters", get_method.get_full_name ());
                                error = true;
                                return false;
                        }
                        var element_type = get_method.return_type.get_actual_type (iterator_type, null, this);
                        if (element_type is VoidType) {
-                               Report.error (collection.source_reference, "`%s' must return an element".printf (get_method.get_full_name ()));
+                               Report.error (collection.source_reference, "`%s' must return an element", get_method.get_full_name ());
                                error = true;
                                return false;
                        }
@@ -315,7 +315,7 @@ public class Vala.ForeachStatement : Block {
                        var get_call = new MethodCall (new MemberAccess (new MemberAccess.simple ("_%s_it".printf (variable_name), source_reference), "get", source_reference), source_reference);
                        body.insert_statement (0, new DeclarationStatement (new LocalVariable (type_reference, variable_name, get_call, source_reference), source_reference));
                } else {
-                       Report.error (collection.source_reference, "`%s' does not have a `next_value' or `next' method".printf (iterator_type.to_string ()));
+                       Report.error (collection.source_reference, "`%s' does not have a `next_value' or `next' method", iterator_type.to_string ());
                        error = true;
                        return false;
                }
@@ -331,7 +331,7 @@ public class Vala.ForeachStatement : Block {
                        type_reference = element_type.copy ();
                } else if (!element_type.compatible (type_reference)) {
                        error = true;
-                       Report.error (source_reference, "Foreach: Cannot convert from `%s' to `%s'".printf (element_type.to_string (), type_reference.to_string ()));
+                       Report.error (source_reference, "Foreach: Cannot convert from `%s' to `%s'", element_type.to_string (), type_reference.to_string ());
                        return false;
                } else if (element_type.is_disposable () && element_type.value_owned && !type_reference.value_owned) {
                        error = true;
@@ -349,7 +349,7 @@ public class Vala.ForeachStatement : Block {
                        type_reference = element_type.copy ();
                } else if (!element_type.compatible (type_reference)) {
                        error = true;
-                       Report.error (source_reference, "Foreach: Cannot convert from `%s' to `%s'".printf (element_type.to_string (), type_reference.to_string ()));
+                       Report.error (source_reference, "Foreach: Cannot convert from `%s' to `%s'", element_type.to_string (), type_reference.to_string ());
                        return false;
                }
 
index ef87646f48349407f37a441240a2f336c6015fa5..239a7254271b11887d1da9f7cd2f4185fc747257 100644 (file)
@@ -162,7 +162,7 @@ public class Vala.Genie.Parser : CodeVisitor {
        void report_parse_error (ParseError e) {
                var begin = get_location ();
                next ();
-               Report.error (get_src (begin), "syntax error, " + e.message);
+               Report.error (get_src (begin), "syntax error, %s", e.message);
        }
 
        inline bool expect (TokenType type) throws ParseError {
@@ -2402,7 +2402,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                if (attributes != null) {
                        foreach (Attribute attr in (List<Attribute>) attributes) {
                                if (node.get_attribute (attr.name) != null) {
-                                       Report.error (attr.source_reference, "duplicate attribute `%s'".printf (attr.name));
+                                       Report.error (attr.source_reference, "duplicate attribute `%s'", attr.name);
                                }
                                node.attributes.append (attr);
                        }
index f5672a64d80376e57540c1cdfb4d88ff685e8d3c..a10efdad8eae0fadd681384c29abbdf660bed906 100644 (file)
@@ -1400,7 +1400,7 @@ public class Vala.Genie.Scanner {
                                if (current < end) {
                                        current++;
                                } else {
-                                       Report.error (get_source_reference (token_length_in_chars), "syntax error, expected %c".printf (begin[0]));
+                                       Report.error (get_source_reference (token_length_in_chars), "syntax error, expected %c", begin[0]);
                                }
                                break;
                        default:
index 5bd8406c745518701c2e894ce411685529a38942..65de9ea85878ed642888545e2ffbe87fe867e6dc 100644 (file)
@@ -359,7 +359,7 @@ public class Vala.GirParser : CodeVisitor {
                        } else {
                                // relative pattern
                                if (current != TokenType.DOT) {
-                                       Report.error (get_current_src (), "expected pattern or `.', got %s".printf (current.to_string ()));
+                                       Report.error (get_current_src (), "expected pattern or `.', got `%s'", current.to_string ());
                                        return null;
                                }
                                next ();
@@ -381,7 +381,7 @@ public class Vala.GirParser : CodeVisitor {
 
                        while (current != TokenType.EOF && !has_space ()) {
                                if (current != TokenType.DOT) {
-                                       Report.error (get_current_src (), "expected `.' got %s".printf (current.to_string ()));
+                                       Report.error (get_current_src (), "expected `.' got `%s'", current.to_string ());
                                        break;
                                }
                                next ();
@@ -420,7 +420,7 @@ public class Vala.GirParser : CodeVisitor {
                                next ();
                                var inner = parse_expression ();
                                if (inner == null) {
-                                       Report.error (src, "expected expression after `-', got %s".printf (current.to_string ()));
+                                       Report.error (src, "expected expression after `-', got `%s'", current.to_string ());
                                } else {
                                        expr = new UnaryExpression (UnaryOperator.MINUS, inner, get_src (begin));
                                }
@@ -438,7 +438,7 @@ public class Vala.GirParser : CodeVisitor {
                                expr = new MemberAccess (null, get_string (), src);
                                while (next () == TokenType.DOT) {
                                        if (next () != TokenType.IDENTIFIER) {
-                                               Report.error (get_current_src (), "expected identifier got %s".printf (current.to_string ()));
+                                               Report.error (get_current_src (), "expected identifier got `%s'", current.to_string ());
                                                break;
                                        }
                                        expr = new MemberAccess (expr, get_string (), get_current_src ());
@@ -447,13 +447,13 @@ public class Vala.GirParser : CodeVisitor {
                        case TokenType.OPEN_PARENS:
                                // empty tuple => no expression
                                if (next () != TokenType.CLOSE_PARENS) {
-                                       Report.error (get_current_src (), "expected `)', got %s".printf (current.to_string ()));
+                                       Report.error (get_current_src (), "expected `)', got `%s'", current.to_string ());
                                        break;
                                }
                                expr = new Tuple (src);
                                break;
                        default:
-                               Report.error (src, "expected literal or symbol got %s".printf (current.to_string ()));
+                               Report.error (src, "expected literal or symbol got %s", current.to_string ());
                                break;
                        }
                        next ();
@@ -469,7 +469,7 @@ public class Vala.GirParser : CodeVisitor {
                                }
                                var arg_type = ArgumentType.from_string (id);
                                if (arg_type == null) {
-                                       Report.warning (get_src (begin, old_end), "unknown argument `%s'".printf (id));
+                                       Report.warning (get_src (begin, old_end), "unknown argument `%s'", id);
                                        continue;
                                }
 
@@ -927,7 +927,7 @@ public class Vala.GirParser : CodeVisitor {
                                                        }
                                                        parser.assume_parameter_names (sig, m, false);
                                                        if (m.get_parameters().size != sig.get_parameters().size) {
-                                                               Report.warning (symbol.source_reference, "Signal `%s' conflicts with method of the same name".printf (get_full_name ()));
+                                                               Report.warning (symbol.source_reference, "Signal `%s' conflicts with method of the same name", get_full_name ());
                                                        }
                                                        merged = true;
                                                } else if (sym is Method && !(sym is CreationMethod) && node != this) {
@@ -949,12 +949,12 @@ public class Vala.GirParser : CodeVisitor {
                                                                }
                                                                if (!different_invoker) {
                                                                        if (attr != null) {
-                                                                               Report.warning (symbol.source_reference, "Virtual method `%s' conflicts with method of the same name".printf (get_full_name ()));
+                                                                               Report.warning (symbol.source_reference, "Virtual method `%s' conflicts with method of the same name", get_full_name ());
                                                                        }
                                                                        node.merged = true;
                                                                }
                                                        } else if (m.is_class_member ()) {
-                                                               Report.warning (symbol.source_reference, "Class method `%s' conflicts with method of the same name".printf (get_full_name ()));
+                                                               Report.warning (symbol.source_reference, "Class method `%s' conflicts with method of the same name", get_full_name ());
                                                                node.merged = true;
                                                        }
                                                }
@@ -985,7 +985,7 @@ public class Vala.GirParser : CodeVisitor {
                                                        // properties take precedence
                                                        node.processed = true;
                                                        node.merged = true;
-                                                       Report.warning (symbol.source_reference, "Signal `%s' conflicts with property of the same name".printf (get_full_name ()));
+                                                       Report.warning (symbol.source_reference, "Signal `%s' conflicts with property of the same name", get_full_name ());
                                                } else if (node.symbol is Method) {
                                                        // getter in C, but not in Vala
                                                        node.merged = true;
@@ -1460,13 +1460,13 @@ public class Vala.GirParser : CodeVisitor {
        void start_element (string name) {
                if (current_token != MarkupTokenType.START_ELEMENT || reader.name != name) {
                        // error
-                       Report.error (get_current_src (), "expected start element of `%s'".printf (name));
+                       Report.error (get_current_src (), "expected start element of `%s'", name);
                }
        }
 
        void end_element (string name) {
                while (current_token != MarkupTokenType.END_ELEMENT || reader.name != name) {
-                       Report.warning (get_current_src (), "expected end element of `%s'".printf (name));
+                       Report.warning (get_current_src (), "expected end element of `%s'", name);
                        skip_element ();
                }
                next ();
@@ -1590,7 +1590,7 @@ public class Vala.GirParser : CodeVisitor {
                                ed.add_method ((Method) sym);
                        }
                } else {
-                       Report.error (sym.source_reference, "impossible to add `%s' to container `%s'".printf (sym.name, container.name));
+                       Report.error (sym.source_reference, "impossible to add `%s' to container `%s'", sym.name, container.name);
                }
        }
 
@@ -1961,7 +1961,7 @@ public class Vala.GirParser : CodeVisitor {
        void parse_repository () {
                start_element ("repository");
                if (reader.get_attribute ("version") != GIR_VERSION) {
-                       Report.error (get_current_src (), "unsupported GIR version %s (supported: %s)".printf (reader.get_attribute ("version"), GIR_VERSION));
+                       Report.error (get_current_src (), "unsupported GIR version %s (supported: %s)", reader.get_attribute ("version"), GIR_VERSION);
                        return;
                }
                next ();
@@ -1986,7 +1986,7 @@ public class Vala.GirParser : CodeVisitor {
                                parse_c_include ();
                        } else {
                                // error
-                               Report.error (get_current_src (), "unknown child element `%s' in `repository'".printf (reader.name));
+                               Report.error (get_current_src (), "unknown child element `%s' in `repository'", reader.name);
                                skip_element ();
                        }
                }
@@ -2256,7 +2256,7 @@ public class Vala.GirParser : CodeVisitor {
                                skip_element ();
                        } else {
                                // error
-                               Report.error (get_current_src (), "unknown child element `%s' in `namespace'".printf (reader.name));
+                               Report.error (get_current_src (), "unknown child element `%s' in `namespace'", reader.name);
                                skip_element ();
                        }
 
@@ -2431,7 +2431,7 @@ public class Vala.GirParser : CodeVisitor {
                                skip_element ();
                        } else {
                                // error
-                               Report.error (get_current_src (), "unknown child element `%s' in `%s'".printf (reader.name, element_name));
+                               Report.error (get_current_src (), "unknown child element `%s' in `%s'", reader.name, element_name);
                                skip_element ();
                        }
 
@@ -2439,7 +2439,7 @@ public class Vala.GirParser : CodeVisitor {
                }
 
                if (!has_member) {
-                       Report.error (get_current_src (), "%s `%s' has no members".printf (element_name, current.name));
+                       Report.error (get_current_src (), "%s `%s' has no members", element_name, current.name);
                }
 
                if (common_prefix != null) {
@@ -2881,7 +2881,7 @@ public class Vala.GirParser : CodeVisitor {
                                parse_union ();
                        } else {
                                // error
-                               Report.error (get_current_src (), "unknown child element `%s' in `record'".printf (reader.name));
+                               Report.error (get_current_src (), "unknown child element `%s' in `record'", reader.name);
                                skip_element ();
                        }
 
@@ -2972,7 +2972,7 @@ public class Vala.GirParser : CodeVisitor {
                                parse_signal ();
                        } else {
                                // error
-                               Report.error (get_current_src (), "unknown child element `%s' in `class'".printf (reader.name));
+                               Report.error (get_current_src (), "unknown child element `%s' in `class'", reader.name);
                                skip_element ();
                        }
 
@@ -3030,7 +3030,7 @@ public class Vala.GirParser : CodeVisitor {
                                parse_signal ();
                        } else {
                                // error
-                               Report.error (get_current_src (), "unknown child element `%s' in `interface'".printf (reader.name));
+                               Report.error (get_current_src (), "unknown child element `%s' in `interface'", reader.name);
                                skip_element ();
                        }
 
@@ -3506,7 +3506,7 @@ public class Vala.GirParser : CodeVisitor {
                                parse_union ();
                        } else {
                                // error
-                               Report.error (get_current_src (), "unknown child element `%s' in `class'".printf (reader.name));
+                               Report.error (get_current_src (), "unknown child element `%s' in `class'", reader.name);
                                skip_element ();
                        }
 
@@ -3549,7 +3549,7 @@ public class Vala.GirParser : CodeVisitor {
                                        parse_field ();
                                } else {
                                        // error
-                                       Report.error (get_current_src (), "unknown child element `%s' in `transparent union'".printf (reader.name));
+                                       Report.error (get_current_src (), "unknown child element `%s' in `transparent union'", reader.name);
                                        skip_element ();
                                }
 
@@ -3595,7 +3595,7 @@ public class Vala.GirParser : CodeVisitor {
                                parse_record ();
                        } else {
                                // error
-                               Report.error (get_current_src (), "unknown child element `%s' in `union'".printf (reader.name));
+                               Report.error (get_current_src (), "unknown child element `%s' in `union'", reader.name);
                                skip_element ();
                        }
 
@@ -3823,7 +3823,7 @@ public class Vala.GirParser : CodeVisitor {
 
                        alias.symbol = deleg;
                } else if (type_sym != null) {
-                       Report.warning (alias.source_reference, "alias `%s' for `%s' is not supported".printf (alias.get_full_name (), type_sym.get_full_name ()));
+                       Report.warning (alias.source_reference, "alias `%s' for `%s' is not supported", alias.get_full_name (), type_sym.get_full_name ());
                        alias.symbol = type_sym;
                        alias.merged = true;
                }
@@ -4179,7 +4179,7 @@ public class Vala.GirParser : CodeVisitor {
        void process_virtual_method_field (Node node, Delegate d, UnresolvedSymbol gtype_struct_for) {
                var gtype_node = resolve_node (node.parent, gtype_struct_for);
                if (gtype_node == null || !(gtype_node.symbol is ObjectTypeSymbol)) {
-                       Report.error (gtype_struct_for.source_reference, "Unknown symbol `%s' for virtual method field `%s'".printf (gtype_struct_for.to_string (), node.to_string ()));
+                       Report.error (gtype_struct_for.source_reference, "Unknown symbol `%s' for virtual method field `%s'", gtype_struct_for.to_string (), node.to_string ());
                }
                var nodes = gtype_node.lookup_all (d.name);
                if (nodes == null) {
index 5451739ef502fb83781687a3e2c686aaa764913e..9cb0b91ebbb775aeb33ae873b57ad6fab353619a 100644 (file)
@@ -222,7 +222,7 @@ public class Vala.InitializerList : Expression {
                                while (field == null) {
                                        if (!field_it.next ()) {
                                                error = true;
-                                               Report.error (e.source_reference, "too many expressions in initializer list for `%s'".printf (target_type.to_string ()));
+                                               Report.error (e.source_reference, "too many expressions in initializer list for `%s'", target_type.to_string ());
                                                return false;
                                        }
                                        field = field_it.get ();
@@ -250,7 +250,7 @@ public class Vala.InitializerList : Expression {
                        }
                } else {
                        error = true;
-                       Report.error (source_reference, "initializer list used for `%s', which is neither array nor struct".printf (target_type.to_string ()));
+                       Report.error (source_reference, "initializer list used for `%s', which is neither array nor struct", target_type.to_string ());
                        return false;
                }
 
@@ -277,7 +277,7 @@ public class Vala.InitializerList : Expression {
                        } else if (!e.value_type.compatible (e.target_type)) {
                                error = true;
                                e.error = true;
-                               Report.error (e.source_reference, "Expected initializer of type `%s' but got `%s'".printf (e.target_type.to_string (), e.value_type.to_string ()));
+                               Report.error (e.source_reference, "Expected initializer of type `%s' but got `%s'", e.target_type.to_string (), e.value_type.to_string ());
                        }
                }
 
index e46b379d19f2d69c591d2e8c67e14bb052724bea..5cd8bd44632b72cca2e52891eef6e0669a0311c9 100644 (file)
@@ -170,7 +170,7 @@ public class Vala.Interface : ObjectTypeSymbol {
                        // check whether prerequisite is at least as accessible as the interface
                        if (!context.analyzer.is_type_accessible (this, prerequisite_reference)) {
                                error = true;
-                               Report.error (source_reference, "prerequisite `%s' is less accessible than interface `%s'".printf (prerequisite_reference.to_string (), get_full_name ()));
+                               Report.error (source_reference, "prerequisite `%s' is less accessible than interface `%s'", prerequisite_reference.to_string (), get_full_name ());
                                return false;
                        }
                }
@@ -180,7 +180,7 @@ public class Vala.Interface : ObjectTypeSymbol {
                foreach (DataType prereq in get_prerequisites ()) {
                        if (!(prereq is ObjectType)) {
                                error = true;
-                               Report.error (source_reference, "Prerequisite `%s' of interface `%s' is not a class or interface".printf (prereq.to_string (), get_full_name ()));
+                               Report.error (source_reference, "Prerequisite `%s' of interface `%s' is not a class or interface", prereq.to_string (), get_full_name ());
                                return false;
                        }
 
@@ -188,7 +188,7 @@ public class Vala.Interface : ObjectTypeSymbol {
                        if (prereq.type_symbol is Class) {
                                if (prereq_class != null) {
                                        error = true;
-                                       Report.error (source_reference, "%s: Interfaces cannot have multiple instantiable prerequisites (`%s' and `%s')".printf (get_full_name (), prereq.type_symbol.get_full_name (), prereq_class.get_full_name ()));
+                                       Report.error (source_reference, "%s: Interfaces cannot have multiple instantiable prerequisites (`%s' and `%s')", get_full_name (), prereq.type_symbol.get_full_name (), prereq_class.get_full_name ());
                                        return false;
                                }
 
@@ -283,7 +283,7 @@ public class Vala.Interface : ObjectTypeSymbol {
                foreach (Symbol sym in virtuals) {
                        int ordering = sym.get_attribute_integer ("CCode", "ordering", -1);
                        if (ordering < -1) {
-                               Report.error (sym.source_reference, "%s: Invalid ordering".printf (sym.get_full_name ()));
+                               Report.error (sym.source_reference, "%s: Invalid ordering", sym.get_full_name ());
                                // Mark state as invalid
                                error = true;
                                ordered_seen = true;
@@ -292,12 +292,12 @@ public class Vala.Interface : ObjectTypeSymbol {
                        }
                        bool ordered = ordering != -1;
                        if (ordered && unordered_seen && !ordered_seen) {
-                               Report.error (sym.source_reference, "%s: Cannot mix ordered and unordered virtuals".printf (sym.get_full_name ()));
+                               Report.error (sym.source_reference, "%s: Cannot mix ordered and unordered virtuals", sym.get_full_name ());
                                error = true;
                        }
                        ordered_seen = ordered_seen || ordered;
                        if (!ordered && !unordered_seen && ordered_seen) {
-                               Report.error (sym.source_reference, "%s: Cannot mix ordered and unordered virtuals".printf (sym.get_full_name ()));
+                               Report.error (sym.source_reference, "%s: Cannot mix ordered and unordered virtuals", sym.get_full_name ());
                                error = true;
                        }
                        unordered_seen = unordered_seen || !ordered;
@@ -305,7 +305,7 @@ public class Vala.Interface : ObjectTypeSymbol {
                                if (ordered) {
                                        Symbol? prev = positions[ordering];
                                        if (prev != null) {
-                                               Report.error (sym.source_reference, "%s: Duplicate ordering (previous virtual with the same position is %s)".printf (sym.get_full_name (), prev.name));
+                                               Report.error (sym.source_reference, "%s: Duplicate ordering (previous virtual with the same position is %s)", sym.get_full_name (), prev.name);
                                                error = true;
                                        }
                                        positions[ordering] = sym;
@@ -316,7 +316,7 @@ public class Vala.Interface : ObjectTypeSymbol {
                        for (int i = 0; i < virtuals.size; i++) {
                                Symbol? sym = positions[i];
                                if (sym == null) {
-                                       Report.error (source_reference, "%s: Gap in ordering in position %d".printf (get_full_name (), i));
+                                       Report.error (source_reference, "%s: Gap in ordering in position %d", get_full_name (), i);
                                        error = true;
                                }
                                if (!error) {
index f48f73b9dc39135786dd6d17e397a9f1dbbef7b8..054badac573ad2fe26bfd2e32ec14c08b9f71cab 100644 (file)
@@ -142,7 +142,7 @@ public class Vala.LambdaExpression : Expression {
                if (!(target_type is DelegateType)) {
                        error = true;
                        if (target_type != null) {
-                               Report.error (source_reference, "Cannot convert lambda expression to `%s'".printf (target_type.to_string ()));
+                               Report.error (source_reference, "Cannot convert lambda expression to `%s'", target_type.to_string ());
                        } else {
                                Report.error (source_reference, "lambda expression not allowed in this context");
                        }
@@ -210,7 +210,7 @@ public class Vala.LambdaExpression : Expression {
 
                        if (lambda_param.direction != cb_param.direction) {
                                error = true;
-                               Report.error (lambda_param.source_reference, "direction of parameter `%s' is incompatible with the target delegate".printf (lambda_param.name));
+                               Report.error (lambda_param.source_reference, "direction of parameter `%s' is incompatible with the target delegate", lambda_param.name);
                        }
 
                        lambda_param.variable_type = cb_param.variable_type.get_actual_type (target_type, null, this);
index 96d9f5a6970e3c8222d960e6018142c54728dcb9..eeb8e912b43a733bf1b951fd6e5126240b12bbc6 100644 (file)
@@ -150,7 +150,7 @@ public class Vala.LocalVariable : Variable {
                        }
                        if (initializer.value_type is FieldPrototype || initializer.value_type is PropertyPrototype) {
                                error = true;
-                               Report.error (initializer.source_reference, "Access to instance member `%s' denied".printf (initializer.symbol_reference.get_full_name ()));
+                               Report.error (initializer.source_reference, "Access to instance member `%s' denied", initializer.symbol_reference.get_full_name ());
                                return false;
                        }
 
@@ -197,7 +197,7 @@ public class Vala.LocalVariable : Variable {
                                                unowned Method m = (Method) initializer.symbol_reference;
                                                unowned Delegate cb = ((DelegateType) variable_type).delegate_symbol;
                                                error = true;
-                                               Report.error (source_reference, "Declaration of method `%s' is not compatible with delegate `%s'".printf (m.get_full_name (), cb.get_full_name ()));
+                                               Report.error (source_reference, "Declaration of method `%s' is not compatible with delegate `%s'", m.get_full_name (), cb.get_full_name ());
                                                return false;
                                        }
                                } else {
@@ -209,7 +209,7 @@ public class Vala.LocalVariable : Variable {
 
                        if (!initializer.value_type.compatible (variable_type)) {
                                error = true;
-                               Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'".printf (initializer.value_type.to_string (), variable_type.to_string ()));
+                               Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'", initializer.value_type.to_string (), variable_type.to_string ());
                                return false;
                        }
 
index a8f61a7c961dee4fa5f100b54344d4196b3e7b42..e8e85891099c2a21cb0f27c365db8b3edf0f8f9e 100644 (file)
@@ -57,7 +57,7 @@ public class Vala.MarkupReader {
                        line = 1;
                        column = 1;
                } catch (FileError e) {
-                       Report.error (null, "Unable to map file `%s': %s".printf (filename, e.message));
+                       Report.error (null, "Unable to map file `%s': %s", filename, e.message);
                }
        }
 
index b1cc20ada6533f101918adc6c3314026208e8964..54caa3a2327cbed3609dd97768d8f988e01e3a1e 100644 (file)
@@ -341,7 +341,7 @@ public class Vala.MemberAccess : Expression {
                                        if (local_sym != null) {
                                                if (symbol_reference != null && symbol_reference != local_sym) {
                                                        error = true;
-                                                       Report.error (source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (member_name, symbol_reference.get_full_name (), local_sym.get_full_name ()));
+                                                       Report.error (source_reference, "`%s' is an ambiguous reference between `%s' and `%s'", member_name, symbol_reference.get_full_name (), local_sym.get_full_name ());
                                                        return false;
                                                }
 
@@ -381,7 +381,7 @@ public class Vala.MemberAccess : Expression {
                                unowned MemberAccess ma = (MemberAccess) inner;
                                if (ma.prototype_access) {
                                        error = true;
-                                       Report.error (source_reference, "Access to instance member `%s' denied".printf (inner.symbol_reference.get_full_name ()));
+                                       Report.error (source_reference, "Access to instance member `%s' denied", inner.symbol_reference.get_full_name ());
                                        return false;
                                }
                        }
@@ -477,7 +477,7 @@ public class Vala.MemberAccess : Expression {
                                                        unowned MemberAccess? arg = s.handler as MemberAccess;
                                                        if (arg == null || !arg.check (context) || !(arg.symbol_reference is Method)) {
                                                                error = true;
-                                                               Report.error (s.handler.source_reference, "Invalid handler for `%s'".printf (s.get_full_name ()));
+                                                               Report.error (s.handler.source_reference, "Invalid handler for `%s'", s.get_full_name ());
                                                        }
                                                }
                                                s.access = SymbolAccessibility.PUBLIC;
@@ -556,7 +556,7 @@ public class Vala.MemberAccess : Expression {
                                visited_types_string += " or `%s'".printf (type.to_string ());
                        }
 
-                       Report.error (source_reference, "The name `%s' does not exist in the context of `%s'%s%s".printf (member_name, base_type_name, base_type_package, visited_types_string));
+                       Report.error (source_reference, "The name `%s' does not exist in the context of `%s'%s%s", member_name, base_type_name, base_type_package, visited_types_string);
                        value_type = new InvalidType ();
                        return false;
                } else if (symbol_reference.error) {
@@ -581,7 +581,7 @@ public class Vala.MemberAccess : Expression {
                                        symbol_reference = sig.emitter;
                                } else {
                                        error = true;
-                                       Report.error (source_reference, "Signal `%s' requires emitter in this context".printf (symbol_reference.get_full_name ()));
+                                       Report.error (source_reference, "Signal `%s' requires emitter in this context", symbol_reference.get_full_name ());
                                        return false;
                                }
                        }
@@ -638,7 +638,7 @@ public class Vala.MemberAccess : Expression {
 
                                if (param.direction != ParameterDirection.IN) {
                                        error = true;
-                                       Report.error (source_reference, "Cannot capture reference or output parameter `%s'".printf (param.get_full_name ()));
+                                       Report.error (source_reference, "Cannot capture reference or output parameter `%s'", param.get_full_name ());
                                }
                        } else {
                                unowned PropertyAccessor? acc = param.parent_symbol.parent_symbol as PropertyAccessor;
@@ -698,7 +698,7 @@ public class Vala.MemberAccess : Expression {
                                }
                                if (!is_valid_access) {
                                        error = true;
-                                       Report.error (source_reference, "Access to async callback `%s' not allowed in this context".printf (m.get_full_name ()));
+                                       Report.error (source_reference, "Access to async callback `%s' not allowed in this context", m.get_full_name ());
                                        return false;
                                }
 
@@ -784,7 +784,7 @@ public class Vala.MemberAccess : Expression {
                        if (lvalue) {
                                if (prop.set_accessor == null) {
                                        error = true;
-                                       Report.error (source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+                                       Report.error (source_reference, "Property `%s' is read-only", prop.get_full_name ());
                                        return false;
                                }
                                if (prop.access == SymbolAccessibility.PUBLIC) {
@@ -796,7 +796,7 @@ public class Vala.MemberAccess : Expression {
                        } else {
                                if (prop.get_accessor == null) {
                                        error = true;
-                                       Report.error (source_reference, "Property `%s' is write-only".printf (prop.get_full_name ()));
+                                       Report.error (source_reference, "Property `%s' is write-only", prop.get_full_name ());
                                        return false;
                                }
                                if (prop.access == SymbolAccessibility.PUBLIC) {
@@ -855,7 +855,7 @@ public class Vala.MemberAccess : Expression {
 
                        if (!in_subtype) {
                                error = true;
-                               Report.error (source_reference, "Access to protected member `%s' denied".printf (member.get_full_name ()));
+                               Report.error (source_reference, "Access to protected member `%s' denied", member.get_full_name ());
                                return false;
                        }
                } else if (access == SymbolAccessibility.PRIVATE) {
@@ -871,7 +871,7 @@ public class Vala.MemberAccess : Expression {
 
                        if (!in_target_type) {
                                error = true;
-                               Report.error (source_reference, "Access to private member `%s' denied".printf (member.get_full_name ()));
+                               Report.error (source_reference, "Access to private member `%s' denied", member.get_full_name ());
                                return false;
                        }
                }
@@ -930,7 +930,7 @@ public class Vala.MemberAccess : Expression {
                                if (inner.symbol_reference is Method) {
                                        // do not warn when calling .begin or .end on static async method
                                } else {
-                                       Report.warning (source_reference, "Access to static member `%s' with an instance reference".printf (symbol_reference.get_full_name ()));
+                                       Report.warning (source_reference, "Access to static member `%s' with an instance reference", symbol_reference.get_full_name ());
 
                                        // Transform to static member access
                                        unowned Symbol? inner_sym = symbol_reference.parent_symbol;
@@ -947,7 +947,7 @@ public class Vala.MemberAccess : Expression {
                        if (context.experimental_non_null && instance && inner.value_type.nullable &&
                            !(inner.value_type is PointerType) && !(inner.value_type is GenericType) &&
                                !(inner.value_type is ArrayType)) {
-                               Report.error (source_reference, "Access to instance member `%s' from nullable reference denied".printf (symbol_reference.get_full_name ()));
+                               Report.error (source_reference, "Access to instance member `%s' from nullable reference denied", symbol_reference.get_full_name ());
                        }
 
                        unowned Method? m = symbol_reference as Method;
index 6c1c7733be8fc2e1efb631fe5681bca990bbde21..9a0fc2aff750de2bc23ca88df63fa0da88d101ff 100644 (file)
@@ -628,7 +628,7 @@ public class Vala.Method : Subroutine, Callable {
                                if (!compatible (base_method, out invalid_match)) {
                                        error = true;
                                        var base_method_type = new MethodType (base_method);
-                                       Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.".printf (get_full_name (), base_method_type.to_prototype_string (), invalid_match));
+                                       Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.", get_full_name (), base_method_type.to_prototype_string (), invalid_match);
                                        return;
                                }
 
@@ -699,12 +699,12 @@ public class Vala.Method : Subroutine, Callable {
                } else if (!hides && invalid_base_match != null) {
                        error = true;
                        var base_method_type = new MethodType (invalid_base_match);
-                       Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.".printf (get_full_name (), base_method_type.to_prototype_string (), invalid_error));
+                       Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.", get_full_name (), base_method_type.to_prototype_string (), invalid_error);
                        return;
                }
 
                if (base_interface_type != null) {
-                       Report.error (source_reference, "`%s': no suitable interface method found to implement".printf (get_full_name ()));
+                       Report.error (source_reference, "`%s': no suitable interface method found to implement", get_full_name ());
                }
        }
 
@@ -810,7 +810,7 @@ public class Vala.Method : Subroutine, Callable {
 
                if (return_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
                        error = true;
-                       Report.error (source_reference, "`%s' not supported as return type".printf (return_type.type_symbol.get_full_name ()));
+                       Report.error (source_reference, "`%s' not supported as return type", return_type.type_symbol.get_full_name ());
                        return false;
                }
 
@@ -906,7 +906,7 @@ public class Vala.Method : Subroutine, Callable {
                                // check whether error type is at least as accessible as the method
                                if (!context.analyzer.is_type_accessible (this, error_type)) {
                                        error = true;
-                                       Report.error (source_reference, "error type `%s' is less accessible than method `%s'".printf (error_type.to_string (), get_full_name ()));
+                                       Report.error (source_reference, "error type `%s' is less accessible than method `%s'", error_type.to_string (), get_full_name ());
                                        return false;
                                }
                        }
@@ -935,17 +935,17 @@ public class Vala.Method : Subroutine, Callable {
                if (context.analyzer.current_struct != null) {
                        if (is_abstract || is_virtual || overrides) {
                                error = true;
-                               Report.error (source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ()));
+                               Report.error (source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract", get_full_name ());
                                return false;
                        }
                } else if (overrides && base_method == null && base_interface_method != null && base_interface_method.is_abstract) {
-                       Report.warning (source_reference, "`override' not required to implement `abstract' interface method `%s'".printf (base_interface_method.get_full_name ()));
+                       Report.warning (source_reference, "`override' not required to implement `abstract' interface method `%s'", base_interface_method.get_full_name ());
                        overrides = false;
                } else if (overrides && base_method == null && base_interface_method == null) {
-                       Report.error (source_reference, "`%s': no suitable method found to override".printf (get_full_name ()));
+                       Report.error (source_reference, "`%s': no suitable method found to override", get_full_name ());
                } else if ((is_abstract || is_virtual || overrides) && access == SymbolAccessibility.PRIVATE) {
                        error = true;
-                       Report.error (source_reference, "Private member `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ()));
+                       Report.error (source_reference, "Private member `%s' cannot be marked as override, virtual, or abstract", get_full_name ());
                        return false;
                }
 
@@ -956,8 +956,8 @@ public class Vala.Method : Subroutine, Callable {
                                        m.checked = true;
                                        m.error = true;
                                        error = true;
-                                       Report.error (source_reference, "`%s' already contains an implementation for `%s'".printf (cl.get_full_name (), base_interface_method.get_full_name ()));
-                                       Report.notice (m.source_reference, "previous implementation of `%s' was here".printf (base_interface_method.get_full_name ()));
+                                       Report.error (source_reference, "`%s' already contains an implementation for `%s'", cl.get_full_name (), base_interface_method.get_full_name ());
+                                       Report.notice (m.source_reference, "previous implementation of `%s' was here", base_interface_method.get_full_name ());
                                        return false;
                                }
                        }
@@ -967,13 +967,13 @@ public class Vala.Method : Subroutine, Callable {
                context.analyzer.current_symbol = old_symbol;
 
                if (!external_package && !overrides && !hides && get_hidden_member () != null) {
-                       Report.warning (source_reference, "%s hides inherited method `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+                       Report.warning (source_reference, "%s hides inherited method `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
                }
 
                // check whether return type is at least as accessible as the method
                if (!context.analyzer.is_type_accessible (this, return_type)) {
                        error = true;
-                       Report.error (source_reference, "return type `%s' is less accessible than method `%s'".printf (return_type.to_string (), get_full_name ()));
+                       Report.error (source_reference, "return type `%s' is less accessible than method `%s'", return_type.to_string (), get_full_name ());
                        return false;
                }
 
@@ -1020,7 +1020,7 @@ public class Vala.Method : Subroutine, Callable {
                                }
                                bool is_dynamic_error = body_error_type is ErrorType && ((ErrorType) body_error_type).dynamic_error;
                                if (!can_propagate_error && !is_dynamic_error) {
-                                       Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+                                       Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string());
                                }
                        }
                }
@@ -1061,7 +1061,7 @@ public class Vala.Method : Subroutine, Callable {
                if (is_possible_entry_point (context)) {
                        if (context.entry_point != null) {
                                error = true;
-                               Report.error (source_reference, "program already has an entry point `%s'".printf (context.entry_point.get_full_name ()));
+                               Report.error (source_reference, "program already has an entry point `%s'", context.entry_point.get_full_name ());
                                return false;
                        }
                        entry_point = true;
index ab98f99bd6c8c09c102d2e0c1aa24b7b7329e2fb..db6b6e2ab08e93f1ca4651aea3cc301d99381190 100644 (file)
@@ -192,7 +192,7 @@ public class Vala.MethodCall : Expression {
                        unowned MemberAccess ma = (MemberAccess) call;
                        if (ma.prototype_access) {
                                error = true;
-                               Report.error (source_reference, "Access to instance member `%s' denied".printf (call.symbol_reference.get_full_name ()));
+                               Report.error (source_reference, "Access to instance member `%s' denied", call.symbol_reference.get_full_name ());
                                return false;
                        }
 
@@ -274,18 +274,18 @@ public class Vala.MethodCall : Expression {
                                base_cm = cl.default_construction_method;
                                if (base_cm == null) {
                                        error = true;
-                                       Report.error (source_reference, "chain up to `%s' not supported".printf (cl.get_full_name ()));
+                                       Report.error (source_reference, "chain up to `%s' not supported", cl.get_full_name ());
                                        return false;
                                } else if (!base_cm.has_construct_function) {
                                        error = true;
-                                       Report.error (source_reference, "chain up to `%s' not supported".printf (base_cm.get_full_name ()));
+                                       Report.error (source_reference, "chain up to `%s' not supported", base_cm.get_full_name ());
                                        return false;
                                }
                        } else if (call.symbol_reference is CreationMethod && call.symbol_reference.parent_symbol is Class) {
                                base_cm = (CreationMethod) call.symbol_reference;
                                if (!base_cm.has_construct_function) {
                                        error = true;
-                                       Report.error (source_reference, "chain up to `%s' not supported".printf (base_cm.get_full_name ()));
+                                       Report.error (source_reference, "chain up to `%s' not supported", base_cm.get_full_name ());
                                        return false;
                                }
                        } else if (gobject_chainup) {
@@ -368,7 +368,7 @@ public class Vala.MethodCall : Expression {
                                        }
                                } else if (ma.member_name == "begin" || ma.member_name == "end") {
                                        error = true;
-                                       Report.error (ma.source_reference, "use of `%s' not allowed in yield statement".printf (ma.member_name));
+                                       Report.error (ma.source_reference, "use of `%s' not allowed in yield statement", ma.member_name);
                                }
                        }
 
@@ -532,7 +532,7 @@ public class Vala.MethodCall : Expression {
                                unowned Property? prop = inner.symbol_reference as Property;
                                if (prop != null && (prop.set_accessor == null || !prop.set_accessor.writable)) {
                                        error = true;
-                                       Report.error (inner.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+                                       Report.error (inner.source_reference, "Property `%s' is read-only", prop.get_full_name ());
                                }
                        }
                        // avoid passing possible null to ref_sink_function without checking
@@ -597,7 +597,7 @@ public class Vala.MethodCall : Expression {
 
                                                if (type_arg == null) {
                                                        error = true;
-                                                       Report.error (ma.source_reference, "cannot infer generic type argument for type parameter `%s'".printf (type_param.get_full_name ()));
+                                                       Report.error (ma.source_reference, "cannot infer generic type argument for type parameter `%s'", type_param.get_full_name ());
                                                        return false;
                                                }
 
index 9c7f6133cfde4cbb6dde33a582e7dbf62cb0d463..54c42153699a9a98bafa449a4ce2fb02a4157948 100644 (file)
@@ -213,7 +213,7 @@ public class Vala.ObjectCreationExpression : Expression {
                                var constructor = (Method) constructor_sym;
                                if (!(constructor_sym is CreationMethod)) {
                                        error = true;
-                                       Report.error (source_reference, "`%s' is not a creation method".printf (constructor.get_full_name ()));
+                                       Report.error (source_reference, "`%s' is not a creation method", constructor.get_full_name ());
                                        return false;
                                }
 
@@ -242,7 +242,7 @@ public class Vala.ObjectCreationExpression : Expression {
                                symbol_reference = type_sym;
                        } else {
                                error = true;
-                               Report.error (source_reference, "`%s' is not a class, struct, or error code".printf (type_sym.get_full_name ()));
+                               Report.error (source_reference, "`%s' is not a class, struct, or error code", type_sym.get_full_name ());
                                return false;
                        }
 
@@ -273,7 +273,7 @@ public class Vala.ObjectCreationExpression : Expression {
                        if (cl.is_abstract) {
                                value_type = null;
                                error = true;
-                               Report.error (source_reference, "Can't create instance of abstract class `%s'".printf (cl.get_full_name ()));
+                               Report.error (source_reference, "Can't create instance of abstract class `%s'", cl.get_full_name ());
                                return false;
                        }
 
@@ -282,7 +282,7 @@ public class Vala.ObjectCreationExpression : Expression {
 
                                if (symbol_reference == null) {
                                        error = true;
-                                       Report.error (source_reference, "`%s' does not have a default constructor".printf (cl.get_full_name ()));
+                                       Report.error (source_reference, "`%s' does not have a default constructor", cl.get_full_name ());
                                        return false;
                                }
 
@@ -303,7 +303,7 @@ public class Vala.ObjectCreationExpression : Expression {
 
                                if (!in_target_type) {
                                        error = true;
-                                       Report.error (source_reference, "Access to non-public constructor `%s' denied".printf (symbol_reference.get_full_name ()));
+                                       Report.error (source_reference, "Access to non-public constructor `%s' denied", symbol_reference.get_full_name ());
                                        return false;
                                }
                        }
@@ -332,7 +332,7 @@ public class Vala.ObjectCreationExpression : Expression {
 
                        if (context.profile == Profile.GOBJECT && st.is_simple_type () && symbol_reference == null && object_initializer.size == 0) {
                                error = true;
-                               Report.error (source_reference, "`%s' does not have a default constructor".printf (st.get_full_name ()));
+                               Report.error (source_reference, "`%s' does not have a default constructor", st.get_full_name ());
                                return false;
                        }
                }
@@ -350,7 +350,7 @@ public class Vala.ObjectCreationExpression : Expression {
                if (symbol_reference == null && argument_list.size != 0) {
                        value_type = null;
                        error = true;
-                       Report.error (source_reference, "No arguments allowed when constructing type `%s'".printf (type.get_full_name ()));
+                       Report.error (source_reference, "No arguments allowed when constructing type `%s'", type.get_full_name ());
                        return false;
                }
 
index d93dad3240b54cd5d0076a6f4352936876c6f7e5..41a59da6105a80a12ff9363eefbaa9f23d21456d 100644 (file)
@@ -183,19 +183,19 @@ public class Vala.Parameter : Variable {
                        if (initializer is NullLiteral
                            && !variable_type.nullable
                            && direction != ParameterDirection.OUT) {
-                               Report.warning (source_reference, "`null' incompatible with parameter type `%s'".printf (variable_type.to_string ()));
+                               Report.warning (source_reference, "`null' incompatible with parameter type `%s'", variable_type.to_string ());
                        } else if (!(initializer is NullLiteral) && direction == ParameterDirection.OUT) {
                                error = true;
                                Report.error (source_reference, "only `null' is allowed as default value for out parameters");
                        } else if (direction == ParameterDirection.IN && !initializer.value_type.compatible (variable_type)) {
                                error = true;
-                               Report.error (initializer.source_reference, "Cannot convert from `%s' to `%s'".printf (initializer.value_type.to_string (), variable_type.to_string ()));
+                               Report.error (initializer.source_reference, "Cannot convert from `%s' to `%s'", initializer.value_type.to_string (), variable_type.to_string ());
                        } else if (direction == ParameterDirection.REF) {
                                error = true;
                                Report.error (source_reference, "default value not allowed for ref parameter");
                        } else if (!initializer.is_accessible (this)) {
                                error = true;
-                               Report.error (initializer.source_reference, "default value is less accessible than method `%s'".printf (parent_symbol.get_full_name ()));
+                               Report.error (initializer.source_reference, "default value is less accessible than method `%s'", parent_symbol.get_full_name ());
                        }
                }
 
@@ -212,7 +212,7 @@ public class Vala.Parameter : Variable {
                        // check whether parameter type is at least as accessible as the method
                        if (!context.analyzer.is_type_accessible (this, variable_type)) {
                                error = true;
-                               Report.error (source_reference, "parameter type `%s' is less accessible than method `%s'".printf (variable_type.to_string (), parent_symbol.get_full_name ()));
+                               Report.error (source_reference, "parameter type `%s' is less accessible than method `%s'", variable_type.to_string (), parent_symbol.get_full_name ());
                        }
                }
 
index 74cf0f2f48363188dcbfdc860ca89aab7b6267c5..fc130c7cbad53f0c985acc4279e4ef0008767068 100644 (file)
@@ -134,7 +134,7 @@ public class Vala.Parser : CodeVisitor {
        void report_parse_error (ParseError e) {
                var begin = get_location ();
                next ();
-               Report.error (get_src (begin), "syntax error, " + e.message);
+               Report.error (get_src (begin), "syntax error, %s", e.message);
        }
 
        inline bool expect (TokenType type) throws ParseError {
@@ -1646,12 +1646,12 @@ public class Vala.Parser : CodeVisitor {
                        try {
                                rollback (begin);
                                stmt = parse_expression_statement ();
-                               Report.warning (get_src (begin), "`%s' is a syntax keyword, replace with `@%s'".printf (token, token));
+                               Report.warning (get_src (begin), "`%s' is a syntax keyword, replace with `@%s'", token, token);
                        } catch (ParseError e2) {
                                var e2_begin = get_location ();
                                rollback (e_begin);
                                next ();
-                               Report.error (get_src (e_begin), "Possible `%s-statement' syntax error, %s".printf (token, e.message));
+                               Report.error (get_src (e_begin), "Possible `%s-statement' syntax error, %s", token, e.message);
                                rollback (e2_begin);
                                throw e2;
                        }
@@ -1863,7 +1863,7 @@ public class Vala.Parser : CodeVisitor {
                switch (current ()) {
                case TokenType.SEMICOLON:
                        if (!accept_empty_body) {
-                               Report.warning (get_current_src (), "%s-statement without body".printf (statement_name));
+                               Report.warning (get_current_src (), "%s-statement without body", statement_name);
                        }
                        return parse_empty_statement ();
                case TokenType.IF:
@@ -2436,7 +2436,7 @@ public class Vala.Parser : CodeVisitor {
                if (attributes != null) {
                        foreach (Attribute attr in (List<Attribute>) attributes) {
                                if (node.get_attribute (attr.name) != null) {
-                                       Report.error (attr.source_reference, "duplicate attribute `%s'".printf (attr.name));
+                                       Report.error (attr.source_reference, "duplicate attribute `%s'", attr.name);
                                }
                                node.attributes.append (attr);
                        }
index e38de9becd1add8408f4cb84a288f1dc4df2425f..24fa709b2a2aebdc8e5b0606040e461cfda10bb1 100644 (file)
@@ -121,7 +121,7 @@ public class Vala.PostfixExpression : Expression {
 
                        if (ma.prototype_access) {
                                error = true;
-                               Report.error (source_reference, "Access to instance member `%s' denied".printf (ma.symbol_reference.get_full_name ()));
+                               Report.error (source_reference, "Access to instance member `%s' denied", ma.symbol_reference.get_full_name ());
                                return false;
                        }
 
@@ -151,7 +151,7 @@ public class Vala.PostfixExpression : Expression {
 
                                if (prop.set_accessor == null || !prop.set_accessor.writable) {
                                        ma.error = true;
-                                       Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+                                       Report.error (ma.source_reference, "Property `%s' is read-only", prop.get_full_name ());
                                        return false;
                                }
                        }
index b04cf19b0d96cfb62a16707c42f4550b6d5df3a8..2c73fcbc435b7cc31a6ed822cecfcda68aae2169 100644 (file)
@@ -364,7 +364,7 @@ public class Vala.Property : Symbol, Lockable {
                                string invalid_match;
                                if (!compatible (base_property, out invalid_match)) {
                                        error = true;
-                                       Report.error (source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s': %s.".printf (get_full_name (), base_property.get_full_name (), invalid_match));
+                                       Report.error (source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s': %s.", get_full_name (), base_property.get_full_name (), invalid_match);
                                        return;
                                }
 
@@ -389,7 +389,7 @@ public class Vala.Property : Symbol, Lockable {
                                                string invalid_match;
                                                if (!compatible (base_property, out invalid_match)) {
                                                        error = true;
-                                                       Report.error (source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s': %s.".printf (get_full_name (), base_property.get_full_name (), invalid_match));
+                                                       Report.error (source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s': %s.", get_full_name (), base_property.get_full_name (), invalid_match);
                                                        return;
                                                }
 
@@ -475,7 +475,7 @@ public class Vala.Property : Symbol, Lockable {
 
                if (get_accessor == null && set_accessor == null) {
                        error = true;
-                       Report.error (source_reference, "Property `%s' must have a `get' accessor and/or a `set' mutator".printf (get_full_name ()));
+                       Report.error (source_reference, "Property `%s' must have a `get' accessor and/or a `set' mutator", get_full_name ());
                        return false;
                }
 
@@ -487,7 +487,7 @@ public class Vala.Property : Symbol, Lockable {
                }
 
                if (initializer != null && field == null && !is_abstract) {
-                       Report.error (source_reference, "Property `%s' with custom `get' accessor and/or `set' mutator cannot have `default' value".printf (get_full_name ()));
+                       Report.error (source_reference, "Property `%s' with custom `get' accessor and/or `set' mutator cannot have `default' value", get_full_name ());
                }
 
                if (initializer != null) {
@@ -497,28 +497,28 @@ public class Vala.Property : Symbol, Lockable {
                // check whether property type is at least as accessible as the property
                if (!context.analyzer.is_type_accessible (this, property_type)) {
                        error = true;
-                       Report.error (source_reference, "property type `%s' is less accessible than property `%s'".printf (property_type.to_string (), get_full_name ()));
+                       Report.error (source_reference, "property type `%s' is less accessible than property `%s'", property_type.to_string (), get_full_name ());
                }
 
                if (overrides && base_property == null && base_interface_property == null) {
-                       Report.error (source_reference, "%s: no suitable property found to override".printf (get_full_name ()));
+                       Report.error (source_reference, "%s: no suitable property found to override", get_full_name ());
                }
 
                if (!external_package && !overrides && !hides && get_hidden_member () != null) {
-                       Report.warning (source_reference, "%s hides inherited property `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+                       Report.warning (source_reference, "%s hides inherited property `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
                }
 
                /* construct properties must be public */
                if (set_accessor != null && set_accessor.construction) {
                        if (access != SymbolAccessibility.PUBLIC) {
                                error = true;
-                               Report.error (source_reference, "%s: construct properties must be public".printf (get_full_name ()));
+                               Report.error (source_reference, "%s: construct properties must be public", get_full_name ());
                        }
                }
 
                if (initializer != null && !initializer.error && initializer.value_type != null && !(initializer.value_type.compatible (property_type))) {
                        error = true;
-                       Report.error (initializer.source_reference, "Expected initializer of type `%s' but got `%s'".printf (property_type.to_string (), initializer.value_type.to_string ()));
+                       Report.error (initializer.source_reference, "Expected initializer of type `%s' but got `%s'", property_type.to_string (), initializer.value_type.to_string ());
                }
 
                context.analyzer.current_source_file = old_source_file;
index 92f9a9315a1418c195fd81f075bc832aa5687889..adcb628dbee4660d378fd1fd9f7223594f31a083 100644 (file)
@@ -171,7 +171,7 @@ public class Vala.PropertyAccessor : Subroutine {
                                                // Hopefully good as is
                                        } else if (!value_type.value_owned && source_reference.file.file_type == SourceFileType.SOURCE) {
                                                error = true;
-                                               Report.error (source_reference, "unowned return value for getter of property `%s' not supported without accessor".printf (prop.get_full_name ()));
+                                               Report.error (source_reference, "unowned return value for getter of property `%s' not supported without accessor", prop.get_full_name ());
                                        }
                                } else if (value_type.value_owned && (source_reference == null || source_reference.file == null)) {
                                        if (value_type is DelegateType || value_type is PointerType || (value_type is ValueType && !value_type.nullable)) {
@@ -203,7 +203,7 @@ public class Vala.PropertyAccessor : Subroutine {
 
                if ((prop.is_abstract || prop.is_virtual || prop.overrides) && access == SymbolAccessibility.PRIVATE) {
                        error = true;
-                       Report.error (source_reference, "Property `%s' with private accessor cannot be marked as abstract, virtual or override".printf (prop.get_full_name ()));
+                       Report.error (source_reference, "Property `%s' with private accessor cannot be marked as abstract, virtual or override", prop.get_full_name ());
                        return false;
                }
 
@@ -228,7 +228,7 @@ public class Vala.PropertyAccessor : Subroutine {
 
                if (body != null && prop.is_abstract) {
                        error = true;
-                       Report.error (source_reference, "Accessor of abstract property `%s' cannot have body".printf (prop.get_full_name ()));
+                       Report.error (source_reference, "Accessor of abstract property `%s' cannot have body", prop.get_full_name ());
                        return false;
                }
 
@@ -245,7 +245,7 @@ public class Vala.PropertyAccessor : Subroutine {
                        body.get_error_types (error_types);
                        foreach (DataType body_error_type in error_types) {
                                if (!((ErrorType) body_error_type).dynamic_error) {
-                                       Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+                                       Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string ());
                                }
                        }
                }
index e0e49af35803af417526bf58d631a01140cae4b8..512143b05ad6894c13675e69ecf0219718a03dea 100644 (file)
@@ -74,7 +74,7 @@ public class Vala.RegexLiteral : Literal {
                        if (regex != null) { /* Regex is valid. */ }
                } catch (RegexError err) {
                        error = true;
-                       Report.error (source_reference, "Invalid regular expression `%s'.".printf (value));
+                       Report.error (source_reference, "Invalid regular expression `%s'.", value);
                        return false;
                }
 
index 8ba02e6491b9d42e5c876422b0f67e00a11e702a..3873083ee648228398c689316f43873dacf78d0e 100644 (file)
@@ -119,7 +119,7 @@ public class Vala.ReturnStatement : CodeNode, Statement {
 
                if (!return_expression.value_type.compatible (context.analyzer.current_return_type)) {
                        error = true;
-                       Report.error (source_reference, "Return: Cannot convert from `%s' to `%s'".printf (return_expression.value_type.to_string (), context.analyzer.current_return_type.to_string ()));
+                       Report.error (source_reference, "Return: Cannot convert from `%s' to `%s'", return_expression.value_type.to_string (), context.analyzer.current_return_type.to_string ());
                        return false;
                }
 
@@ -140,7 +140,7 @@ public class Vala.ReturnStatement : CodeNode, Statement {
 
                if (return_expression is NullLiteral
                    && !context.analyzer.current_return_type.nullable) {
-                       Report.warning (source_reference, "`null' incompatible with return type `%s'".printf (context.analyzer.current_return_type.to_string ()));
+                       Report.warning (source_reference, "`null' incompatible with return type `%s'", context.analyzer.current_return_type.to_string ());
                }
 
                return !error;
index 7ad6b3c3f0f435a3dadbb7f2b4fa459760fefb85..36f274e6fc9cbd36d8771ba64b9b173e3902bbed 100644 (file)
@@ -1252,7 +1252,7 @@ public class Vala.Scanner {
                                if (current < end) {
                                        current++;
                                } else {
-                                       Report.error (get_source_reference (token_length_in_chars), "syntax error, expected %c".printf (begin[0]));
+                                       Report.error (get_source_reference (token_length_in_chars), "syntax error, expected %c", begin[0]);
                                }
                                break;
                        default:
index f0f02561bc07dc665d074618d9baa94615b88ef8..21de5f894ffaf93e904af79675d7f1d28752dde2 100644 (file)
@@ -66,11 +66,11 @@ public class Vala.Scope {
                        } else if (lookup (name) != null) {
                                owner.error = true;
                                if (owner.name == null && owner.parent_symbol == null) {
-                                       Report.error (sym.source_reference, "The root namespace already contains a definition for `%s'".printf (name));
+                                       Report.error (sym.source_reference, "The root namespace already contains a definition for `%s'", name);
                                } else {
-                                       Report.error (sym.source_reference, "`%s' already contains a definition for `%s'".printf (owner.get_full_name (), name));
+                                       Report.error (sym.source_reference, "`%s' already contains a definition for `%s'", owner.get_full_name (), name);
                                }
-                               Report.notice (lookup (name).source_reference, "previous definition of `%s' was here".printf (name));
+                               Report.notice (lookup (name).source_reference, "previous definition of `%s' was here", name);
                                return;
                        }
 
index fed1e86b04fa267acdb078c4c21531ce8091cb27..2c8db80c0209fc15f5dde9dff8e107cfc4caadaa 100644 (file)
@@ -398,7 +398,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                } else if (sym is ErrorCode) {
                        type = new ErrorType ((ErrorDomain) sym.parent_symbol, (ErrorCode) sym);
                } else {
-                       Report.error (null, "internal error: `%s' is not a supported type".printf (sym.get_full_name ()));
+                       Report.error (null, "internal error: `%s' is not a supported type", sym.get_full_name ());
                        return new InvalidType ();
                }
 
@@ -543,9 +543,9 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                                        expr.error = true;
                                        unowned MethodType? m = mtype as MethodType;
                                        if (m != null) {
-                                               Report.error (expr.source_reference, "%d missing arguments for `%s'".printf (m.get_parameters ().size - args.size, m.to_prototype_string ()));
+                                               Report.error (expr.source_reference, "%d missing arguments for `%s'", m.get_parameters ().size - args.size, m.to_prototype_string ());
                                        } else {
-                                               Report.error (expr.source_reference, "Too few arguments, method `%s' does not take %d arguments".printf (mtype.to_string (), args.size));
+                                               Report.error (expr.source_reference, "Too few arguments, method `%s' does not take %d arguments", mtype.to_string (), args.size);
                                        }
                                        error = true;
                                } else {
@@ -580,9 +580,9 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        expr.error = true;
                        unowned MethodType? m = mtype as MethodType;
                        if (m != null) {
-                               Report.error (expr.source_reference, "%d extra arguments for `%s'".printf (args.size - m.get_parameters ().size, m.to_prototype_string ()));
+                               Report.error (expr.source_reference, "%d extra arguments for `%s'", args.size - m.get_parameters ().size, m.to_prototype_string ());
                        } else {
-                               Report.error (expr.source_reference, "Too many arguments, method `%s' does not take %d arguments".printf (mtype.to_string (), args.size));
+                               Report.error (expr.source_reference, "Too many arguments, method `%s' does not take %d arguments", mtype.to_string (), args.size);
                        }
                        error = true;
                }
@@ -607,7 +607,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                } else if (arg.value_type == null) {
                        // disallow untyped arguments except for type inference of callbacks
                        if (!(arg.target_type is DelegateType) || !(arg.symbol_reference is Method)) {
-                               Report.error (arg.source_reference, "Invalid type for argument %d".printf (i + 1));
+                               Report.error (arg.source_reference, "Invalid type for argument %d", i + 1);
                                return false;
                        }
                } else {
@@ -626,19 +626,19 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 
                        if (arg_type == 0) {
                                if (direction == ParameterDirection.REF) {
-                                       Report.error (arg.source_reference, "Argument %d: Cannot pass null to reference parameter".printf (i + 1));
+                                       Report.error (arg.source_reference, "Argument %d: Cannot pass null to reference parameter", i + 1);
                                        return false;
                                } else if (direction != ParameterDirection.OUT && !arg.target_type.nullable) {
-                                       Report.warning (arg.source_reference, "Argument %d: Cannot pass null to non-null parameter type".printf (i + 1));
+                                       Report.warning (arg.source_reference, "Argument %d: Cannot pass null to non-null parameter type", i + 1);
                                }
                        } else if (arg_type == 1) {
                                if (direction != ParameterDirection.IN) {
-                                       Report.error (arg.source_reference, "Argument %d: Cannot pass value to reference or output parameter".printf (i + 1));
+                                       Report.error (arg.source_reference, "Argument %d: Cannot pass value to reference or output parameter", i + 1);
                                        return false;
                                }
                        } else if (arg_type == 2) {
                                if (direction != ParameterDirection.REF) {
-                                       Report.error (arg.source_reference, "Argument %d: Cannot pass ref argument to non-reference parameter".printf (i + 1));
+                                       Report.error (arg.source_reference, "Argument %d: Cannot pass ref argument to non-reference parameter", i + 1);
                                        return false;
                                }
 
@@ -646,7 +646,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                                if (arg.target_type.is_disposable ()) {
                                        if (!(arg.value_type is PointerType) && !arg.value_type.value_owned) {
                                                /* variable doesn't own the value */
-                                               Report.error (arg.source_reference, "Argument %d: Cannot pass unowned ref argument to owned reference parameter".printf (i + 1));
+                                               Report.error (arg.source_reference, "Argument %d: Cannot pass unowned ref argument to owned reference parameter", i + 1);
                                                return false;
                                        }
                                }
@@ -655,13 +655,13 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                                if (arg.value_type.is_disposable ()) {
                                        if (!arg.target_type.value_owned) {
                                                /* parameter doesn't own the value */
-                                               Report.error (arg.source_reference, "Argument %d: Cannot pass owned ref argument to unowned reference parameter".printf (i + 1));
+                                               Report.error (arg.source_reference, "Argument %d: Cannot pass owned ref argument to unowned reference parameter", i + 1);
                                                return false;
                                        }
                                }
                        } else if (arg_type == 3) {
                                if (direction != ParameterDirection.OUT) {
-                                       Report.error (arg.source_reference, "Argument %d: Cannot pass out argument to non-output parameter".printf (i + 1));
+                                       Report.error (arg.source_reference, "Argument %d: Cannot pass out argument to non-output parameter", i + 1);
                                        return false;
                                }
 
@@ -679,12 +679,12 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                if (arg.target_type != null) {
                        if ((direction == ParameterDirection.IN || direction == ParameterDirection.REF)
                            && !arg.value_type.compatible (arg.target_type)) {
-                               Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.value_type.to_prototype_string (), arg.target_type.to_prototype_string ()));
+                               Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'", i + 1, arg.value_type.to_prototype_string (), arg.target_type.to_prototype_string ());
                                return false;
                        } else if ((direction == ParameterDirection.REF || direction == ParameterDirection.OUT)
                                && !arg.target_type.compatible (arg.value_type)
                                && !(arg is NullLiteral)) {
-                               Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.target_type.to_prototype_string (), arg.value_type.to_prototype_string ()));
+                               Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'", i + 1, arg.target_type.to_prototype_string (), arg.value_type.to_prototype_string ());
                                return false;
                        }
                }
@@ -694,7 +694,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        // allow prototype access if target type is delegate without target
                        unowned DelegateType? deleg_type = arg.target_type as DelegateType;
                        if (deleg_type == null || deleg_type.delegate_symbol.has_target) {
-                               Report.error (arg.source_reference, "Access to instance member `%s' denied".printf (arg.symbol_reference.get_full_name ()));
+                               Report.error (arg.source_reference, "Access to instance member `%s' denied", arg.symbol_reference.get_full_name ());
                                return false;
                        }
                }
@@ -714,12 +714,12 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        } else if (arg.value_type == null) {
                                // disallow untyped arguments except for type inference of callbacks
                                if (!(arg.symbol_reference is Method)) {
-                                       Report.error (source_reference, "Invalid type for argument %d".printf (i + 1));
+                                       Report.error (source_reference, "Invalid type for argument %d", i + 1);
                                        return false;
                                }
                        } else if (arg.target_type != null && !arg.value_type.compatible (arg.target_type)) {
                                // target_type known for printf arguments
-                               Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.value_type.to_string (), arg.target_type.to_string ()));
+                               Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'", i + 1, arg.value_type.to_string (), arg.target_type.to_string ());
                                return false;
                        }
 
@@ -952,7 +952,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                                if (instance_type == null) {
                                        if (node_reference != null) {
                                                CodeNode? reference = get_symbol_for_data_type (derived_instance_type);
-                                               Report.error ((reference ?? node_reference).source_reference, "The type-parameter `%s' is missing".printf (generic_type.to_string ()));
+                                               Report.error ((reference ?? node_reference).source_reference, "The type-parameter `%s' is missing", generic_type.to_string ());
                                                node_reference.error = true;
                                        }
                                        return new InvalidType ();
@@ -966,7 +966,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                                }
                                if (param_index == -1) {
                                        if (node_reference != null) {
-                                               Report.error (node_reference.source_reference, "internal error: unknown type parameter %s".printf (generic_type.type_parameter.name));
+                                               Report.error (node_reference.source_reference, "internal error: unknown type parameter %s", generic_type.type_parameter.name);
                                                node_reference.error = true;
                                        }
                                        return new InvalidType ();
@@ -983,7 +983,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        int param_index = m.get_type_parameter_index (generic_type.type_parameter.name);
                        if (param_index == -1) {
                                if (node_reference != null) {
-                                       Report.error (node_reference.source_reference, "internal error: unknown type parameter %s".printf (generic_type.type_parameter.name));
+                                       Report.error (node_reference.source_reference, "internal error: unknown type parameter %s", generic_type.type_parameter.name);
                                        node_reference.error = true;
                                }
                                return new InvalidType ();
@@ -1049,12 +1049,12 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                init.symbol_reference = symbol_lookup_inherited (type.type_symbol, init.name);
                if (!(init.symbol_reference is Field || init.symbol_reference is Property)) {
                        init.error = true;
-                       Report.error (init.source_reference, "Invalid member `%s' in `%s'".printf (init.name, type.type_symbol.get_full_name ()));
+                       Report.error (init.source_reference, "Invalid member `%s' in `%s'", init.name, type.type_symbol.get_full_name ());
                        return;
                }
                if (init.symbol_reference.access != SymbolAccessibility.PUBLIC) {
                        init.error = true;
-                       Report.error (init.source_reference, "Access to private member `%s' denied".printf (init.symbol_reference.get_full_name ()));
+                       Report.error (init.source_reference, "Access to private member `%s' denied", init.symbol_reference.get_full_name ());
                        return;
                }
                DataType member_type = null;
@@ -1066,7 +1066,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        member_type = prop.property_type;
                        if (prop.set_accessor == null || !prop.set_accessor.writable) {
                                init.error = true;
-                               Report.error (init.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+                               Report.error (init.source_reference, "Property `%s' is read-only", prop.get_full_name ());
                                return;
                        }
                }
@@ -1080,7 +1080,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 
                if (init.initializer.value_type == null || !init.initializer.value_type.compatible (init.initializer.target_type)) {
                        init.error = true;
-                       Report.error (init.source_reference, "Invalid type for member `%s'".printf (init.name));
+                       Report.error (init.source_reference, "Invalid type for member `%s'", init.name);
                        return;
                }
        }
@@ -1362,7 +1362,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                } else if (type_arg is ArrayType) {
                        Report.error (type_arg.source_reference, "Arrays are not supported as generic type arguments");
                } else {
-                       Report.error (type_arg.source_reference, "`%s' is not a supported generic type argument, use `?' to box value types".printf (type_arg.to_string ()));
+                       Report.error (type_arg.source_reference, "`%s' is not a supported generic type argument, use `?' to box value types", type_arg.to_string ());
                }
        }
 }
index df7d761990b92e04b51232315a8fd84669ac50e9..3acbf3b03b8f90cef7d5036264f85f3f42789f53 100644 (file)
@@ -207,7 +207,7 @@ public class Vala.Signal : Symbol, Callable {
 
                if (return_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
                        error = true;
-                       Report.error (source_reference, "`%s' not supported as return type".printf (return_type.type_symbol.get_full_name ()));
+                       Report.error (source_reference, "`%s' not supported as return type", return_type.type_symbol.get_full_name ());
                        return false;
                }
 
@@ -274,7 +274,7 @@ public class Vala.Signal : Symbol, Callable {
 
 
                if (!external_package && !hides && get_hidden_member () != null) {
-                       Report.warning (source_reference, "%s hides inherited signal `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+                       Report.warning (source_reference, "%s hides inherited signal `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
                }
 
                return !error;
index 1cfe497c32942aaf2cdd61611bbbc0e41631e671..8eca80998c3ecbc0d06bd0dae8def1d47f50b468 100644 (file)
@@ -170,7 +170,7 @@ public class Vala.SliceExpression : Expression {
                        }
 
                        error = true;
-                       Report.error (source_reference, "The expression `%s' does not denote an array".printf (container.value_type.to_string ()));
+                       Report.error (source_reference, "The expression `%s' does not denote an array", container.value_type.to_string ());
                }
 
                return !error;
index ac9000f49f2aa701db42ec28eea181ab430e2577..709053bccc08088ec013174399675a0da297bbe3 100644 (file)
@@ -347,7 +347,7 @@ public class Vala.SourceFile {
                        try {
                                mapped_file = new MappedFile (filename, false);
                        } catch (FileError e) {
-                               Report.error (null, "Unable to map file `%s': %s".printf (filename, e.message));
+                               Report.error (null, "Unable to map file `%s': %s", filename, e.message);
                                return null;
                        }
                }
index 53a952753425e810e16ad8a4060c02b6cc3bc1a4..5909bf7e88086a3228ab4be54cf1b519cbb2e819 100644 (file)
@@ -250,7 +250,7 @@ public class Vala.Struct : TypeSymbol {
                        var cm = (CreationMethod) m;
                        if (cm.class_name != null && cm.class_name != name) {
                                // type_name is null for constructors generated by GIdlParser
-                               Report.error (m.source_reference, "missing return type in method `%s.%s´".printf (get_full_name (), cm.class_name));
+                               Report.error (m.source_reference, "missing return type in method `%s.%s´", get_full_name (), cm.class_name);
                                m.error = true;
                                return;
                        }
@@ -503,7 +503,7 @@ public class Vala.Struct : TypeSymbol {
 
                        if (!(base_type is ValueType)) {
                                error = true;
-                               Report.error (source_reference, "The base type `%s' of struct `%s' is not a struct".printf (base_type.to_string (), get_full_name ()));
+                               Report.error (source_reference, "The base type `%s' of struct `%s' is not a struct", base_type.to_string (), get_full_name ());
                                return false;
                        }
                }
@@ -566,10 +566,10 @@ public class Vala.Struct : TypeSymbol {
                        }
                        if (base_type == null && !has_instance_field && !is_boolean_type () && !is_integer_type () && !is_floating_type ()) {
                                error = true;
-                               Report.error (source_reference, "struct `%s' cannot be empty".printf (get_full_name ()));
+                               Report.error (source_reference, "struct `%s' cannot be empty", get_full_name ());
                        } else if (base_type != null && has_instance_field) {
                                error = true;
-                               Report.error (source_reference, "derived struct `%s' may not have instance fields".printf (get_full_name ()));
+                               Report.error (source_reference, "derived struct `%s' may not have instance fields", get_full_name ());
                        }
                }
 
index 27adbd2cd5dd896dbb8b99bd078c5523de9ec261..df920d6f109d5b9c5291f80072305bf00dea20d3 100644 (file)
@@ -112,7 +112,7 @@ public class Vala.SwitchLabel : CodeNode {
                        }
                        if (!expression.value_type.compatible (switch_statement.expression.value_type)) {
                                error = true;
-                               Report.error (expression.source_reference, "Cannot convert from `%s' to `%s'".printf (expression.value_type.to_string (), switch_statement.expression.value_type.to_string ()));
+                               Report.error (expression.source_reference, "Cannot convert from `%s' to `%s'", expression.value_type.to_string (), switch_statement.expression.value_type.to_string ());
                                return false;
                        }
                }
index a55299b19f8e03dc542b5790d14b0dd934ab3ced..7e8b4493a450cb5c8efe64a6a0e9de5aebebcd57 100644 (file)
@@ -452,59 +452,59 @@ public abstract class Vala.Symbol : CodeNode {
        }
 
        public virtual void add_namespace (Namespace ns) {
-               Report.error (ns.source_reference, "inner `%s' is not supported in `%s'".printf ("namespace", get_full_name ()));
+               Report.error (ns.source_reference, "inner `%s' is not supported in `%s'", "namespace", get_full_name ());
        }
 
        public virtual void add_class (Class cl) {
-               Report.error (cl.source_reference, "inner `%s' types are not supported in `%s'".printf ("class", get_full_name ()));
+               Report.error (cl.source_reference, "inner `%s' types are not supported in `%s'", "class", get_full_name ());
        }
 
        public virtual void add_interface (Interface iface) {
-               Report.error (iface.source_reference, "inner `%s' types are not supported in `%s'".printf ("interface", get_full_name ()));
+               Report.error (iface.source_reference, "inner `%s' types are not supported in `%s'", "interface", get_full_name ());
        }
 
        public virtual void add_struct (Struct st) {
-               Report.error (st.source_reference, "inner `%s' types are not supported in `%s'".printf ("struct", get_full_name ()));
+               Report.error (st.source_reference, "inner `%s' types are not supported in `%s'", "struct", get_full_name ());
        }
 
        public virtual void add_enum (Enum en) {
-               Report.error (en.source_reference, "inner `%s' types are not supported in `%s'".printf ("enum", get_full_name ()));
+               Report.error (en.source_reference, "inner `%s' types are not supported in `%s'", "enum", get_full_name ());
        }
 
        public virtual void add_error_domain (ErrorDomain edomain) {
-               Report.error (edomain.source_reference, "inner `%s' types are not supported in `%s'".printf ("errordomain", get_full_name ()));
+               Report.error (edomain.source_reference, "inner `%s' types are not supported in `%s'", "errordomain", get_full_name ());
        }
 
        public virtual void add_delegate (Delegate d) {
-               Report.error (d.source_reference, "inner `%s' types are not supported in `%s'".printf ("delegate", get_full_name ()));
+               Report.error (d.source_reference, "inner `%s' types are not supported in `%s'", "delegate", get_full_name ());
        }
 
        public virtual void add_constant (Constant constant) {
-               Report.error (constant.source_reference, "constants are not allowed in `%s'".printf (get_full_name ()));
+               Report.error (constant.source_reference, "constants are not allowed in `%s'", get_full_name ());
        }
 
        public virtual void add_field (Field f) {
-               Report.error (f.source_reference, "fields are not allowed in `%s'".printf (get_full_name ()));
+               Report.error (f.source_reference, "fields are not allowed in `%s'", get_full_name ());
        }
 
        public virtual void add_method (Method m) {
-               Report.error (m.source_reference, "methods are not allowed in `%s'".printf (get_full_name ()));
+               Report.error (m.source_reference, "methods are not allowed in `%s'", get_full_name ());
        }
 
        public virtual void add_property (Property prop) {
-               Report.error (prop.source_reference, "properties are not allowed in `%s'".printf (get_full_name ()));
+               Report.error (prop.source_reference, "properties are not allowed in `%s'", get_full_name ());
        }
 
        public virtual void add_signal (Signal sig) {
-               Report.error (sig.source_reference, "signals are not allowed in `%s'".printf (get_full_name ()));
+               Report.error (sig.source_reference, "signals are not allowed in `%s'", get_full_name ());
        }
 
        public virtual void add_constructor (Constructor c) {
-               Report.error (c.source_reference, "constructors are not allowed in `%s'".printf (get_full_name ()));
+               Report.error (c.source_reference, "constructors are not allowed in `%s'", get_full_name ());
        }
 
        public virtual void add_destructor (Destructor d) {
-               Report.error (d.source_reference, "destructors are not allowed in `%s'".printf (get_full_name ()));
+               Report.error (d.source_reference, "destructors are not allowed in `%s'", get_full_name ());
        }
 
        public override string to_string () {
index 3f9bc6de00a370928b8cfd9c54294d4f2e5d9a94..823d689d70db5ad564f03b60f621e3ee5b7d3970 100644 (file)
@@ -67,13 +67,13 @@ public class Vala.SymbolResolver : CodeVisitor {
                        if (type.type_symbol is Class) {
                                if (cl.base_class != null) {
                                        cl.error = true;
-                                       Report.error (type.source_reference, "%s: Classes cannot have multiple base classes (`%s' and `%s')".printf (cl.get_full_name (), cl.base_class.get_full_name (), type.type_symbol.get_full_name ()));
+                                       Report.error (type.source_reference, "%s: Classes cannot have multiple base classes (`%s' and `%s')", cl.get_full_name (), cl.base_class.get_full_name (), type.type_symbol.get_full_name ());
                                        return;
                                }
                                cl.base_class = (Class) type.type_symbol;
                                if (cl.base_class.is_subtype_of (cl)) {
                                        cl.error = true;
-                                       Report.error (type.source_reference, "Base class cycle (`%s' and `%s')".printf (cl.get_full_name (), cl.base_class.get_full_name ()));
+                                       Report.error (type.source_reference, "Base class cycle (`%s' and `%s')", cl.get_full_name (), cl.base_class.get_full_name ());
                                        return;
                                }
                        }
@@ -96,7 +96,7 @@ public class Vala.SymbolResolver : CodeVisitor {
                        if (base_type != null) {
                                if (base_type.is_subtype_of (st)) {
                                        st.error = true;
-                                       Report.error (st.source_reference, "Base struct cycle (`%s' and `%s')".printf (st.get_full_name (), base_type.get_full_name ()));
+                                       Report.error (st.source_reference, "Base struct cycle (`%s' and `%s')", st.get_full_name (), base_type.get_full_name ());
                                        return;
                                }
                        }
@@ -117,7 +117,7 @@ public class Vala.SymbolResolver : CodeVisitor {
                foreach (DataType type in iface.get_prerequisites ()) {
                        if (type.type_symbol != null && type.type_symbol.is_subtype_of (iface)) {
                                iface.error = true;
-                               Report.error (type.source_reference, "Prerequisite cycle (`%s' and `%s')".printf (iface.get_full_name (), type.type_symbol.get_full_name ()));
+                               Report.error (type.source_reference, "Prerequisite cycle (`%s' and `%s')", iface.get_full_name (), type.type_symbol.get_full_name ());
                                return;
                        }
                }
@@ -263,7 +263,7 @@ public class Vala.SymbolResolver : CodeVisitor {
                        ns.namespace_symbol = resolve_symbol (unresolved_symbol);
                        if (!(ns.namespace_symbol is Namespace)) {
                                ns.error = true;
-                               Report.error (ns.source_reference, "The namespace name `%s' could not be found".printf (unresolved_symbol.to_string ()));
+                               Report.error (ns.source_reference, "The namespace name `%s' could not be found", unresolved_symbol.to_string ());
                                return;
                        }
                }
@@ -322,7 +322,7 @@ public class Vala.SymbolResolver : CodeVisitor {
                                        if (local_sym != null && local_sym.access == SymbolAccessibility.PUBLIC) {
                                                if (sym != null && sym != local_sym) {
                                                        unresolved_symbol.error = true;
-                                                       Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ()));
+                                                       Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'", unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ());
                                                        return null;
                                                }
                                                sym = local_sym;
@@ -345,7 +345,7 @@ public class Vala.SymbolResolver : CodeVisitor {
                                        if (local_sym != null) {
                                                if (sym != null && sym != local_sym) {
                                                        unresolved_symbol.error = true;
-                                                       Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ()));
+                                                       Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'", unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ());
                                                        return null;
                                                }
                                                sym = local_sym;
@@ -357,7 +357,7 @@ public class Vala.SymbolResolver : CodeVisitor {
                        var parent_symbol = resolve_symbol (unresolved_symbol.inner);
                        if (parent_symbol == null) {
                                unresolved_symbol.error = true;
-                               Report.error (unresolved_symbol.inner.source_reference, "The symbol `%s' could not be found".printf (unresolved_symbol.inner.name));
+                               Report.error (unresolved_symbol.inner.source_reference, "The symbol `%s' could not be found", unresolved_symbol.inner.name);
                                return null;
                        }
                        parent_symbol.used = true;
@@ -434,7 +434,7 @@ public class Vala.SymbolResolver : CodeVisitor {
                if (sym == null) {
                        // don't report same error twice
                        if (!unresolved_type.unresolved_symbol.error) {
-                               Report.error (unresolved_type.source_reference, "The type name `%s' could not be found".printf (unresolved_type.unresolved_symbol.to_string ()));
+                               Report.error (unresolved_type.source_reference, "The type name `%s' could not be found", unresolved_type.unresolved_symbol.to_string ());
                        }
                        return new InvalidType ();
                }
@@ -462,11 +462,11 @@ public class Vala.SymbolResolver : CodeVisitor {
                        } else if (sym is ErrorCode) {
                                type = new ErrorType ((ErrorDomain) sym.parent_symbol, (ErrorCode) sym, unresolved_type.source_reference);
                        } else {
-                               Report.error (unresolved_type.source_reference, "internal error: `%s' is not a supported type".printf (sym.get_full_name ()));
+                               Report.error (unresolved_type.source_reference, "internal error: `%s' is not a supported type", sym.get_full_name ());
                                return new InvalidType ();
                        }
                } else {
-                       Report.error (unresolved_type.source_reference, "`%s' is not a type".printf (sym.get_full_name ()));
+                       Report.error (unresolved_type.source_reference, "`%s' is not a type", sym.get_full_name ());
                        return new InvalidType ();
                }
 
index ae73dcb7555dd56c5eff6e1b0b2ec72ed864a746..8a6e04be77c7ecde8344090a1cf1922025d47282 100644 (file)
@@ -113,7 +113,7 @@ public class Vala.ThrowStatement : CodeNode, Statement {
                        }
 
                        if (context.profile == Profile.GOBJECT && !(error_expression.value_type is ErrorType)) {
-                               Report.error (error_expression.source_reference, "`%s' is not an error type".printf (error_expression.value_type.to_string ()));
+                               Report.error (error_expression.source_reference, "`%s' is not an error type", error_expression.value_type.to_string ());
                                error = true;
                                return false;
                        }
index abcfeb830fe03afcdeb2d45dca3aa8dcd795ede0..848b4f45743224c8eae9369138669b7f6845b39e 100644 (file)
@@ -117,7 +117,7 @@ public class Vala.TypeCheck : Expression {
                }
 
                if (type_reference is ErrorType && !(expression.value_type is ErrorType)) {
-                       Report.error (expression.source_reference, "`%s' must be an error".printf (expression.to_string ()));
+                       Report.error (expression.source_reference, "`%s' must be an error", expression.to_string ());
                        error = true;
                        return false;
                }
index a97c0b2046ee17e7c9e225272e98aa9bcd3da417..76c31cd7aba254913cf427b2bf200cbdf594e1da 100644 (file)
@@ -162,7 +162,7 @@ public class Vala.UnaryExpression : Expression {
 
                if (inner.value_type is FieldPrototype || inner.value_type is PropertyPrototype) {
                        error = true;
-                       Report.error (inner.source_reference, "Access to instance member `%s' denied".printf (inner.symbol_reference.get_full_name ()));
+                       Report.error (inner.source_reference, "Access to instance member `%s' denied", inner.symbol_reference.get_full_name ());
                        return false;
                }
 
@@ -172,7 +172,7 @@ public class Vala.UnaryExpression : Expression {
                        // integer or floating point type
                        if (!is_numeric_type (inner.value_type)) {
                                error = true;
-                               Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
+                               Report.error (source_reference, "Operator not supported for `%s'", inner.value_type.to_string ());
                                return false;
                        }
 
@@ -182,7 +182,7 @@ public class Vala.UnaryExpression : Expression {
                        // boolean type
                        if (inner.value_type.nullable || !inner.value_type.compatible (context.analyzer.bool_type)) {
                                error = true;
-                               Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
+                               Report.error (source_reference, "Operator not supported for `%s'", inner.value_type.to_string ());
                                return false;
                        }
 
@@ -192,7 +192,7 @@ public class Vala.UnaryExpression : Expression {
                        // integer type
                        if (!is_integer_type (inner.value_type) && !(inner.value_type is EnumValueType)) {
                                error = true;
-                               Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
+                               Report.error (source_reference, "Operator not supported for `%s'", inner.value_type.to_string ());
                                return false;
                        }
 
@@ -203,7 +203,7 @@ public class Vala.UnaryExpression : Expression {
                        // integer type
                        if (!is_integer_type (inner.value_type)) {
                                error = true;
-                               Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
+                               Report.error (source_reference, "Operator not supported for `%s'", inner.value_type.to_string ());
                                return false;
                        }
 
index ce9fbaf1d32208130f536353cf3899c0242f9995..ffb142eb05b8ceb75cb2dceec53f55e2cce93f87 100644 (file)
@@ -137,11 +137,11 @@ public class Vala.UsedAttr : CodeVisitor {
                        foreach (unowned Attribute attr in sym.attributes) {
                                var set = marked.get (attr.name);
                                if (set == null) {
-                                       Report.warning (attr.source_reference, "attribute `%s' never used".printf (attr.name));
+                                       Report.warning (attr.source_reference, "Attribute `%s' never used", attr.name);
                                } else {
                                        foreach (var arg in attr.args.get_keys()) {
                                                if (!set.contains (arg)) {
-                                                       Report.warning (attr.source_reference, "argument `%s' never used".printf (arg));
+                                                       Report.warning (attr.source_reference, "Argument `%s' never used", arg);
                                                }
                                        }
                                }
index ce46406cd0534d45210c9621661e892ff2478eff..9ef5e0e915fa05df97a4d128cd0863fe0c22a233 100644 (file)
@@ -153,7 +153,7 @@ public class Vala.VersionAttribute {
                        string? package_version = symbol.source_reference.file.installed_version;
 
                        if (!context.deprecated && (package_version == null || deprecated_since == null || VersionAttribute.cmp_versions (package_version, deprecated_since) >= 0)) {
-                               Report.deprecated (source_ref, "`%s' %s%s".printf (symbol.get_full_name (), (deprecated_since == null) ? "is deprecated" : "has been deprecated since %s".printf (deprecated_since), (replacement == null) ? "" : ". Use %s".printf (replacement)));
+                               Report.deprecated (source_ref, "`%s' %s%s", symbol.get_full_name (), (deprecated_since == null) ? "is deprecated" : "has been deprecated since %s".printf (deprecated_since), (replacement == null) ? "" : ". Use %s".printf (replacement));
                        }
                        result = true;
                }
@@ -165,7 +165,7 @@ public class Vala.VersionAttribute {
                        if (context.since_check && package_version != null && VersionAttribute.cmp_versions (package_version, since) < 0) {
                                unowned string filename = symbol.source_reference.file.filename;
                                string pkg = Path.get_basename (filename[0:filename.last_index_of_char ('.')]);
-                               Report.error (source_ref, "`%s' is not available in %s %s. Use %s >= %s".printf (symbol.get_full_name (), pkg, package_version, pkg, since));
+                               Report.error (source_ref, "`%s' is not available in %s %s. Use %s >= %s", symbol.get_full_name (), pkg, package_version, pkg, since);
                        }
                        result = true;
                }
@@ -177,7 +177,7 @@ public class Vala.VersionAttribute {
                                string? experimental_until = this.experimental_until;
 
                                if (experimental_until == null || package_version == null || VersionAttribute.cmp_versions (package_version, experimental_until) < 0) {
-                                       Report.experimental (source_ref, "`%s' is experimental%s".printf (symbol.get_full_name (), (experimental_until != null) ? " until %s".printf (experimental_until) : ""));
+                                       Report.experimental (source_ref, "`%s' is experimental%s", symbol.get_full_name (), (experimental_until != null) ? " until %s".printf (experimental_until) : "");
                                }
                        }
                        result = true;
index 4df5d4d0d27cee61557802f93db3b5ba396fd2ff..4e227952f24ee949f3ab0e0f2abf678ae788c708 100644 (file)
@@ -365,7 +365,7 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor {
 
                var package_path = context.get_vapi_path (pkg) ?? context.get_gir_path (pkg);
                if (package_path == null) {
-                       Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (pkg));
+                       Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories", pkg);
                        return false;
                }
 
@@ -390,12 +390,12 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor {
                                        dep = dep.strip ();
                                        if (dep != "") {
                                                if (!add_package (context, dep)) {
-                                                       Vala.Report.error (null, "%s, dependency of %s, not found in specified Vala API directories".printf (dep, pkg_name));
+                                                       Vala.Report.error (null, "`%s', dependency of `%s', not found in specified Vala API directories", dep, pkg_name);
                                                }
                                        }
                                }
                        } catch (FileError e) {
-                               Vala.Report.error (null, "Unable to read dependency file: %s".printf (e.message));
+                               Vala.Report.error (null, "Unable to read dependency file: %s", e.message);
                        }
                }
        }
@@ -409,7 +409,7 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor {
        private void add_depencies (Vala.CodeContext context, string[] packages) {
                foreach (string package in packages) {
                        if (!add_package (context, package)) {
-                               Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (package));
+                               Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories", package);
                        }
                }
        }
@@ -465,10 +465,10 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor {
                                        context.add_c_source_file (rpath);
                                        tree.add_external_c_files (rpath);
                                } else {
-                                       Vala.Report.error (null, "%s is not a supported source file type. Only .vala, .vapi, .gs, and .c files are supported.".printf (source));
+                                       Vala.Report.error (null, "%s is not a supported source file type. Only .vala, .vapi, .gs, and .c files are supported.", source);
                                }
                        } else {
-                               Vala.Report.error (null, "%s not found".printf (source));
+                               Vala.Report.error (null, "%s not found", source);
                        }
                }
        }
index d4c70d8a21529936ccedc876585875f5918503eb..9355a8516982b5a4ebfccb492bb76dbceccf1526 100644 (file)
@@ -132,7 +132,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                        codenode_attributes_map[tokens[0]] = tokens[1];
                                }
                        } catch (FileError e) {
-                               Report.error (null, "Unable to read metadata file: %s".printf (e.message));
+                               Report.error (null, "Unable to read metadata file: %s", e.message);
                        }
                }
        
@@ -148,7 +148,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                }
                        }
                } catch (MarkupError e) {
-                       Report.error (null, "Unable to parse GIDL file: %s".printf (e.message));
+                       Report.error (null, "Unable to parse GIDL file: %s", e.message);
                }
        }
 
index 45eb33c8eede2dc6fe59228c0ab87a1a48ce07de..9214e16ecb7a985911483affc33271472d9016a4 100644 (file)
@@ -138,7 +138,7 @@ class Vala.VAPICheck {
 
                                if (symbol.length > 0 && !_symbols.contains (symbol)) {
                                        var src = new SourceReference (metadata, SourceLocation (null, lineno, 1), SourceLocation (null, lineno, (int)symbol.length));
-                                       Report.error (src, "Symbol `%s' not found".printf (symbol));
+                                       Report.error (src, "Symbol `%s' not found", symbol);
                                }
 
                                lineno += 1;
@@ -146,19 +146,19 @@ class Vala.VAPICheck {
 
                        return 0;
                } catch (Error error) {
-                       Report.error (null, "%s: %s".printf (metadata.filename, error.message));
+                       Report.error (null, "%s: %s", metadata.filename, error.message);
                        return 1;
                }
        }
 
        public int run () {
                if (!FileUtils.test (gidl.filename, FileTest.IS_REGULAR)) {
-                       Report.error (null, "%s not found".printf (gidl.filename));
+                       Report.error (null, "%s not found", gidl.filename);
                        return 2;
                }
 
                if (!FileUtils.test (metadata.filename, FileTest.IS_REGULAR)) {
-                       Report.error (null, "%s not found".printf (metadata.filename));
+                       Report.error (null, "%s not found", metadata.filename);
                        return 2;
                }
 
index f39c5250e891d95848de1e5191416d55d4738427..7eb4fc0444d40962b1bdca67dd37cb61dbfd18fa 100644 (file)
@@ -130,7 +130,7 @@ class Vala.VAPIGen {
                                source_file.from_commandline = true;
                                context.add_source_file (source_file);
                        } else {
-                               Report.error (null, "%s not found".printf (source));
+                               Report.error (null, "%s not found", source);
                        }
                }
                
@@ -193,7 +193,7 @@ class Vala.VAPIGen {
 
                var library_name = Path.get_basename (library);
                if (package_names.length > 0 && !(library_name in package_names)) {
-                       Report.warning (null, "Given library name `%s' does not match pkg-config name `%s'".printf (library_name, string.join ("', `", package_names)));
+                       Report.warning (null, "Given library name `%s' does not match pkg-config name `%s'", library_name, string.join ("', `", package_names));
                }
 
                var interface_writer = new CodeWriter (CodeWriterType.VAPIGEN);