diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-10-26 16:10:37 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-10-26 16:10:37 +0100 |
commit | 1d78426a2b172f0b0ba2f04d1f5c51ad75c82ef5 (patch) | |
tree | 7f82f8eed0a1590ecbb830d575ee0f092a2e433e | |
parent | 545121d1322d3f73880b3f14d86d3d7bd976e664 (diff) | |
download | vala-1d78426a2b172f0b0ba2f04d1f5c51ad75c82ef5.tar.gz |
vala: Make use of new printf-like API of Report.*()
60 files changed, 296 insertions, 296 deletions
diff --git a/ccode/valaccodefile.vala b/ccode/valaccodefile.vala index b04b73d10..629d2d198 100644 --- a/ccode/valaccodefile.vala +++ b/ccode/valaccodefile.vala @@ -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; } diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index 4cf66f3c5..e5a6a21d1 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -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 (); diff --git a/vala/valaarraycreationexpression.vala b/vala/valaarraycreationexpression.vala index 8af8fa8fe..fdc2eef8d 100644 --- a/vala/valaarraycreationexpression.vala +++ b/vala/valaarraycreationexpression.vala @@ -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 ()); } } diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala index f40bfd4e7..79090ad9b 100644 --- a/vala/valaassignment.vala +++ b/vala/valaassignment.vala @@ -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; } diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala index e1732156c..7b9b78214 100644 --- a/vala/valabinaryexpression.vala +++ b/vala/valabinaryexpression.vala @@ -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; } diff --git a/vala/valablock.vala b/vala/valablock.vala index 5ae943c32..e13f2b2be 100644 --- a/vala/valablock.vala +++ b/vala/valablock.vala @@ -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; diff --git a/vala/valacastexpression.vala b/vala/valacastexpression.vala index d938b5391..86b9f9a12 100644 --- a/vala/valacastexpression.vala +++ b/vala/valacastexpression.vala @@ -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 ()); } } diff --git a/vala/valacatchclause.vala b/vala/valacatchclause.vala index 4ecb79db8..085d2c49b 100644 --- a/vala/valacatchclause.vala +++ b/vala/valacatchclause.vala @@ -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; } diff --git a/vala/valaclass.vala b/vala/valaclass.vala index 3d7fee98c..9ebb17271 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -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 ()); } } } diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index 6b6665274..510225e15 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -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) { diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala index 20415cbdd..f555b7a02 100644 --- a/vala/valacodewriter.vala +++ b/vala/valacodewriter.vala @@ -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; } diff --git a/vala/valaconstant.vala b/vala/valaconstant.vala index 871cff62e..fcbb4c321 100644 --- a/vala/valaconstant.vala +++ b/vala/valaconstant.vala @@ -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; diff --git a/vala/valaconstructor.vala b/vala/valaconstructor.vala index 733a1566d..97f4bf4f4 100644 --- a/vala/valaconstructor.vala +++ b/vala/valaconstructor.vala @@ -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()); } } } diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala index ed15bf46d..c5a98dc08 100644 --- a/vala/valacreationmethod.vala +++ b/vala/valacreationmethod.vala @@ -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()); } } } diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala index b498133c6..770d39ac6 100644 --- a/vala/valadelegate.vala +++ b/vala/valadelegate.vala @@ -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; } } diff --git a/vala/valadeletestatement.vala b/vala/valadeletestatement.vala index 2613a83fb..f0a39f7c7 100644 --- a/vala/valadeletestatement.vala +++ b/vala/valadeletestatement.vala @@ -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; diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala index 45b02ecdb..d866d2f0b 100644 --- a/vala/valaelementaccess.vala +++ b/vala/valaelementaccess.vala @@ -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; } diff --git a/vala/valaenum.vala b/vala/valaenum.vala index 592e6e7a8..7a9aa5bb0 100644 --- a/vala/valaenum.vala +++ b/vala/valaenum.vala @@ -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; } diff --git a/vala/valaerrordomain.vala b/vala/valaerrordomain.vala index 311f29975..b6239f1a4 100644 --- a/vala/valaerrordomain.vala +++ b/vala/valaerrordomain.vala @@ -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; } diff --git a/vala/valafield.vala b/vala/valafield.vala index ed59f582a..bee686222 100644 --- a/vala/valafield.vala +++ b/vala/valafield.vala @@ -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; diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala index 907c219ea..a859d7b8b 100644 --- a/vala/valaflowanalyzer.vala +++ b/vala/valaflowanalyzer.vala @@ -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 ()); } } diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala index 2c74773e8..da80b24aa 100644 --- a/vala/valaforeachstatement.vala +++ b/vala/valaforeachstatement.vala @@ -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; } diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala index ef87646f4..239a72542 100644 --- a/vala/valagenieparser.vala +++ b/vala/valagenieparser.vala @@ -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); } diff --git a/vala/valageniescanner.vala b/vala/valageniescanner.vala index f5672a64d..a10efdad8 100644 --- a/vala/valageniescanner.vala +++ b/vala/valageniescanner.vala @@ -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: diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 5bd8406c7..65de9ea85 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -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) { diff --git a/vala/valainitializerlist.vala b/vala/valainitializerlist.vala index 5451739ef..9cb0b91eb 100644 --- a/vala/valainitializerlist.vala +++ b/vala/valainitializerlist.vala @@ -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 ()); } } diff --git a/vala/valainterface.vala b/vala/valainterface.vala index e46b379d1..5cd8bd446 100644 --- a/vala/valainterface.vala +++ b/vala/valainterface.vala @@ -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) { diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala index f48f73b9d..054badac5 100644 --- a/vala/valalambdaexpression.vala +++ b/vala/valalambdaexpression.vala @@ -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); diff --git a/vala/valalocalvariable.vala b/vala/valalocalvariable.vala index 96d9f5a69..eeb8e912b 100644 --- a/vala/valalocalvariable.vala +++ b/vala/valalocalvariable.vala @@ -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; } diff --git a/vala/valamarkupreader.vala b/vala/valamarkupreader.vala index a8f61a7c9..e8e858910 100644 --- a/vala/valamarkupreader.vala +++ b/vala/valamarkupreader.vala @@ -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); } } diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala index b1cc20ada..54caa3a23 100644 --- a/vala/valamemberaccess.vala +++ b/vala/valamemberaccess.vala @@ -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; diff --git a/vala/valamethod.vala b/vala/valamethod.vala index 6c1c7733b..9a0fc2aff 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -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; diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index ab98f99bd..db6b6e2ab 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -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; } diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index 9c7f6133c..54c421536 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -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; } diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala index d93dad324..41a59da61 100644 --- a/vala/valaparameter.vala +++ b/vala/valaparameter.vala @@ -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 ()); } } diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 74cf0f2f4..fc130c7cb 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -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); } diff --git a/vala/valapostfixexpression.vala b/vala/valapostfixexpression.vala index e38de9bec..24fa709b2 100644 --- a/vala/valapostfixexpression.vala +++ b/vala/valapostfixexpression.vala @@ -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; } } diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala index b04cf19b0..2c73fcbc4 100644 --- a/vala/valaproperty.vala +++ b/vala/valaproperty.vala @@ -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; diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala index 92f9a9315..adcb628db 100644 --- a/vala/valapropertyaccessor.vala +++ b/vala/valapropertyaccessor.vala @@ -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 ()); } } } diff --git a/vala/valaregexliteral.vala b/vala/valaregexliteral.vala index e0e49af35..512143b05 100644 --- a/vala/valaregexliteral.vala +++ b/vala/valaregexliteral.vala @@ -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; } diff --git a/vala/valareturnstatement.vala b/vala/valareturnstatement.vala index 8ba02e649..3873083ee 100644 --- a/vala/valareturnstatement.vala +++ b/vala/valareturnstatement.vala @@ -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; diff --git a/vala/valascanner.vala b/vala/valascanner.vala index 7ad6b3c3f..36f274e6f 100644 --- a/vala/valascanner.vala +++ b/vala/valascanner.vala @@ -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: diff --git a/vala/valascope.vala b/vala/valascope.vala index f0f02561b..21de5f894 100644 --- a/vala/valascope.vala +++ b/vala/valascope.vala @@ -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; } diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index fed1e86b0..2c8db80c0 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -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 ()); } } } diff --git a/vala/valasignal.vala b/vala/valasignal.vala index df7d76199..3acbf3b03 100644 --- a/vala/valasignal.vala +++ b/vala/valasignal.vala @@ -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; diff --git a/vala/valasliceexpression.vala b/vala/valasliceexpression.vala index 1cfe497c3..8eca80998 100644 --- a/vala/valasliceexpression.vala +++ b/vala/valasliceexpression.vala @@ -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; diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala index ac9000f49..709053bcc 100644 --- a/vala/valasourcefile.vala +++ b/vala/valasourcefile.vala @@ -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; } } diff --git a/vala/valastruct.vala b/vala/valastruct.vala index 53a952753..5909bf7e8 100644 --- a/vala/valastruct.vala +++ b/vala/valastruct.vala @@ -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 ()); } } diff --git a/vala/valaswitchlabel.vala b/vala/valaswitchlabel.vala index 27adbd2cd..df920d6f1 100644 --- a/vala/valaswitchlabel.vala +++ b/vala/valaswitchlabel.vala @@ -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; } } diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala index a55299b19..7e8b4493a 100644 --- a/vala/valasymbol.vala +++ b/vala/valasymbol.vala @@ -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 () { diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala index 3f9bc6de0..823d689d7 100644 --- a/vala/valasymbolresolver.vala +++ b/vala/valasymbolresolver.vala @@ -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 (); } diff --git a/vala/valathrowstatement.vala b/vala/valathrowstatement.vala index ae73dcb75..8a6e04be7 100644 --- a/vala/valathrowstatement.vala +++ b/vala/valathrowstatement.vala @@ -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; } diff --git a/vala/valatypecheck.vala b/vala/valatypecheck.vala index abcfeb830..848b4f457 100644 --- a/vala/valatypecheck.vala +++ b/vala/valatypecheck.vala @@ -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; } diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala index a97c0b204..76c31cd7a 100644 --- a/vala/valaunaryexpression.vala +++ b/vala/valaunaryexpression.vala @@ -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; } diff --git a/vala/valausedattr.vala b/vala/valausedattr.vala index ce9fbaf1d..ffb142eb0 100644 --- a/vala/valausedattr.vala +++ b/vala/valausedattr.vala @@ -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); } } } diff --git a/vala/valaversionattribute.vala b/vala/valaversionattribute.vala index ce46406cd..9ef5e0e91 100644 --- a/vala/valaversionattribute.vala +++ b/vala/valaversionattribute.vala @@ -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; diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala index 4df5d4d0d..4e227952f 100644 --- a/valadoc/treebuilder.vala +++ b/valadoc/treebuilder.vala @@ -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); } } } diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index d4c70d8a2..9355a8516 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -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); } } diff --git a/vapigen/valavapicheck.vala b/vapigen/valavapicheck.vala index 45eb33c8e..9214e16ec 100644 --- a/vapigen/valavapicheck.vala +++ b/vapigen/valavapicheck.vala @@ -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; } diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala index f39c5250e..7eb4fc044 100644 --- a/vapigen/valavapigen.vala +++ b/vapigen/valavapigen.vala @@ -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); |