From: Rico Tzschichholz Date: Tue, 27 Mar 2018 10:46:26 +0000 (+0200) Subject: Drop trailing spaces/tabs X-Git-Tag: 0.41.90~209 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55d883a5b593be366aff440ead4571ee76d86d02;p=thirdparty%2Fvala.git Drop trailing spaces/tabs It was about time to do this. --- diff --git a/ccode/valaccodeassignment.vala b/ccode/valaccodeassignment.vala index 57f525d1b..247496df0 100644 --- a/ccode/valaccodeassignment.vala +++ b/ccode/valaccodeassignment.vala @@ -30,7 +30,7 @@ public class Vala.CCodeAssignment : CCodeExpression { * Left hand side of the assignment. */ public CCodeExpression left { get; set; } - + /** * Assignment operator. */ @@ -40,13 +40,13 @@ public class Vala.CCodeAssignment : CCodeExpression { * Right hand side of the assignment. */ public CCodeExpression right { get; set; } - + public CCodeAssignment (CCodeExpression l, CCodeExpression r, CCodeAssignmentOperator op = CCodeAssignmentOperator.SIMPLE) { left = l; operator = op; right = r; } - + public override void write (CCodeWriter writer) { left.write (writer); @@ -74,7 +74,7 @@ public class Vala.CCodeAssignment : CCodeExpression { writer.write_string (")"); } } - + public enum Vala.CCodeAssignmentOperator { SIMPLE, BITWISE_OR, diff --git a/ccode/valaccodebinaryexpression.vala b/ccode/valaccodebinaryexpression.vala index 651e2cac3..f001c0825 100644 --- a/ccode/valaccodebinaryexpression.vala +++ b/ccode/valaccodebinaryexpression.vala @@ -40,13 +40,13 @@ public class Vala.CCodeBinaryExpression : CCodeExpression { * The right operand. */ public CCodeExpression right { get; set; } - + public CCodeBinaryExpression (CCodeBinaryOperator op, CCodeExpression l, CCodeExpression r) { operator = op; left = l; right = r; } - + public override void write (CCodeWriter writer) { left.write_inner (writer); diff --git a/ccode/valaccodeblock.vala b/ccode/valaccodeblock.vala index 5c8f2c74d..6c9bbe4af 100644 --- a/ccode/valaccodeblock.vala +++ b/ccode/valaccodeblock.vala @@ -33,14 +33,14 @@ public class Vala.CCodeBlock : CCodeStatement { public bool suppress_newline { get; set; } private List statements = new ArrayList (); - + /** * Prepend the specified statement to the list of statements. */ public void prepend_statement (CCodeNode statement) { statements.insert (0, statement); } - + /** * Append the specified statement to the list of statements. */ @@ -48,7 +48,7 @@ public class Vala.CCodeBlock : CCodeStatement { /* allow generic nodes to include comments */ statements.add (statement); } - + public override void write (CCodeWriter writer) { // the last reachable statement CCodeNode last_statement = null; diff --git a/ccode/valaccodecasestatement.vala b/ccode/valaccodecasestatement.vala index 82b85f45a..021d28078 100644 --- a/ccode/valaccodecasestatement.vala +++ b/ccode/valaccodecasestatement.vala @@ -30,11 +30,11 @@ public class Vala.CCodeCaseStatement : CCodeStatement { * The case expression. */ public CCodeExpression expression { get; set; } - + public CCodeCaseStatement (CCodeExpression expression) { this.expression = expression; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("case "); diff --git a/ccode/valaccodecastexpression.vala b/ccode/valaccodecastexpression.vala index e53e6c2b6..a06b1fa39 100644 --- a/ccode/valaccodecastexpression.vala +++ b/ccode/valaccodecastexpression.vala @@ -30,17 +30,17 @@ public class Vala.CCodeCastExpression : CCodeExpression { * The expression to be cast. */ public CCodeExpression inner { get; set; } - + /** * The target type. */ public string type_name { get; set; } - + public CCodeCastExpression (CCodeExpression expr, string type) { inner = expr; type_name = type; } - + public override void write (CCodeWriter writer) { writer.write_string ("("); writer.write_string (type_name); diff --git a/ccode/valaccodecommaexpression.vala b/ccode/valaccodecommaexpression.vala index 6010428e0..f72a98713 100644 --- a/ccode/valaccodecommaexpression.vala +++ b/ccode/valaccodecommaexpression.vala @@ -27,7 +27,7 @@ using GLib; */ public class Vala.CCodeCommaExpression : CCodeExpression { private List inner = new ArrayList (); - + /** * Appends the specified expression to the expression list. * @@ -47,7 +47,7 @@ public class Vala.CCodeCommaExpression : CCodeExpression { public override void write (CCodeWriter writer) { bool first = true; - + writer.write_string ("("); foreach (CCodeExpression expr in inner) { if (!first) { diff --git a/ccode/valaccodecomment.vala b/ccode/valaccodecomment.vala index 3aacaa488..2902ebfd7 100644 --- a/ccode/valaccodecomment.vala +++ b/ccode/valaccodecomment.vala @@ -30,11 +30,11 @@ public class Vala.CCodeComment : CCodeNode { * The text content of the comment. */ public string text { get; set; } - + public CCodeComment (string _text) { text = _text; } - + public override void write (CCodeWriter writer) { writer.write_comment (text); } diff --git a/ccode/valaccodeconditionalexpression.vala b/ccode/valaccodeconditionalexpression.vala index b894928d7..24e5f9e74 100644 --- a/ccode/valaccodeconditionalexpression.vala +++ b/ccode/valaccodeconditionalexpression.vala @@ -30,23 +30,23 @@ public class Vala.CCodeConditionalExpression : CCodeExpression { * The condition. */ public CCodeExpression condition { get; set; } - + /** * The expression to be evaluated if the condition holds. */ public CCodeExpression true_expression { get; set; } - + /** * The expression to be evaluated if the condition doesn't hold. */ public CCodeExpression false_expression { get; set; } - + public CCodeConditionalExpression (CCodeExpression cond, CCodeExpression true_expr, CCodeExpression false_expr) { condition = cond; true_expression = true_expr; false_expression = false_expr; } - + public override void write (CCodeWriter writer) { condition.write_inner (writer); writer.write_string (" ? "); diff --git a/ccode/valaccodedeclaration.vala b/ccode/valaccodedeclaration.vala index 4cbd86204..eb69c6a61 100644 --- a/ccode/valaccodedeclaration.vala +++ b/ccode/valaccodedeclaration.vala @@ -32,11 +32,11 @@ public class Vala.CCodeDeclaration : CCodeStatement { public string type_name { get; set; } private List declarators = new ArrayList (); - + public CCodeDeclaration (string type_name) { this.type_name = type_name; } - + /** * Adds the specified declarator to this declaration. * @@ -45,7 +45,7 @@ public class Vala.CCodeDeclaration : CCodeStatement { public void add_declarator (CCodeDeclarator decl) { declarators.add (decl); } - + public override void write (CCodeWriter writer) { if ((modifiers & (CCodeModifiers.STATIC | CCodeModifiers.INTERNAL | CCodeModifiers.EXTERN)) == 0) { foreach (CCodeDeclarator decl in declarators) { @@ -110,7 +110,7 @@ public class Vala.CCodeDeclaration : CCodeStatement { } writer.write_string (type_name); writer.write_string (" "); - + bool first = true; foreach (CCodeDeclarator decl in declarators) { if (!first) { diff --git a/ccode/valaccodedostatement.vala b/ccode/valaccodedostatement.vala index 7101f8bdb..18c803e94 100644 --- a/ccode/valaccodedostatement.vala +++ b/ccode/valaccodedostatement.vala @@ -35,12 +35,12 @@ public class Vala.CCodeDoStatement : CCodeStatement { * The loop condition. */ public CCodeExpression condition { get; set; } - + public CCodeDoStatement (CCodeStatement stmt, CCodeExpression cond) { body = stmt; condition = cond; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("do"); diff --git a/ccode/valaccodeelementaccess.vala b/ccode/valaccodeelementaccess.vala index dc62485ba..3586aec1f 100644 --- a/ccode/valaccodeelementaccess.vala +++ b/ccode/valaccodeelementaccess.vala @@ -32,18 +32,18 @@ public class Vala.CCodeElementAccess : CCodeExpression { * Expression representing the container on which we want to access. */ public CCodeExpression container { get; set; } - + /** * Expression representing the index we want to access inside the * container. */ public CCodeExpression index { get; set; } - + public CCodeElementAccess (CCodeExpression cont, CCodeExpression i) { container = cont; index = i; } - + public override void write (CCodeWriter writer) { container.write_inner (writer); writer.write_string ("["); diff --git a/ccode/valaccodeenum.vala b/ccode/valaccodeenum.vala index f2a378879..c94ad02ae 100644 --- a/ccode/valaccodeenum.vala +++ b/ccode/valaccodeenum.vala @@ -32,11 +32,11 @@ public class Vala.CCodeEnum : CCodeNode { public string name { get; set; } private List values = new ArrayList (); - + public CCodeEnum (string? name = null) { this.name = name; } - + /** * Adds the specified value to this enum. * @@ -45,7 +45,7 @@ public class Vala.CCodeEnum : CCodeNode { public void add_value (CCodeEnumValue value) { values.add (value); } - + public override void write (CCodeWriter writer) { if (name != null) { writer.write_string ("typedef "); diff --git a/ccode/valaccodeenumvalue.vala b/ccode/valaccodeenumvalue.vala index 2fa408587..f11326f56 100644 --- a/ccode/valaccodeenumvalue.vala +++ b/ccode/valaccodeenumvalue.vala @@ -35,7 +35,7 @@ public class Vala.CCodeEnumValue : CCodeNode { * The numerical representation of this enum value. */ public CCodeExpression? value { get; set; } - + public CCodeEnumValue (string name, CCodeExpression? value = null) { this.name = name; this.value = value; diff --git a/ccode/valaccodeexpressionstatement.vala b/ccode/valaccodeexpressionstatement.vala index 57b2b2da4..ae721939a 100644 --- a/ccode/valaccodeexpressionstatement.vala +++ b/ccode/valaccodeexpressionstatement.vala @@ -30,7 +30,7 @@ public class Vala.CCodeExpressionStatement : CCodeStatement { * The expression to evaluate. */ public CCodeExpression expression { get; set; } - + public CCodeExpressionStatement (CCodeExpression expr) { expression = expr; } diff --git a/ccode/valaccodeforstatement.vala b/ccode/valaccodeforstatement.vala index c4d14be95..f821e0d46 100644 --- a/ccode/valaccodeforstatement.vala +++ b/ccode/valaccodeforstatement.vala @@ -30,15 +30,15 @@ public class Vala.CCodeForStatement : CCodeStatement { * The loop condition. */ public CCodeExpression? condition { get; set; } - + /** * The loop body. */ public CCodeStatement body { get; set; } - + private List initializer = new ArrayList (); private List iterator = new ArrayList (); - + public CCodeForStatement (CCodeExpression? condition, CCodeStatement? body = null) { this.condition = condition; this.body = body; @@ -61,13 +61,13 @@ public class Vala.CCodeForStatement : CCodeStatement { public void add_iterator (CCodeExpression expr) { iterator.add (expr); } - + public override void write (CCodeWriter writer) { bool first; - + writer.write_indent (line); writer.write_string ("for ("); - + first = true; foreach (CCodeExpression init_expr in initializer) { if (!first) { @@ -85,7 +85,7 @@ public class Vala.CCodeForStatement : CCodeStatement { condition.write (writer); } writer.write_string ("; "); - + first = true; foreach (CCodeExpression it_expr in iterator) { if (!first) { diff --git a/ccode/valaccodefragment.vala b/ccode/valaccodefragment.vala index 0e229fffa..51538da6b 100644 --- a/ccode/valaccodefragment.vala +++ b/ccode/valaccodefragment.vala @@ -27,7 +27,7 @@ using GLib; */ public class Vala.CCodeFragment : CCodeNode { private List children = new ArrayList (); - + /** * Appends the specified code node to this code fragment. * @@ -36,7 +36,7 @@ public class Vala.CCodeFragment : CCodeNode { public void append (CCodeNode node) { children.add (node); } - + /** * Returns a copy of the list of children. * diff --git a/ccode/valaccodefunction.vala b/ccode/valaccodefunction.vala index 2458d9c3b..688c6d1eb 100644 --- a/ccode/valaccodefunction.vala +++ b/ccode/valaccodefunction.vala @@ -30,7 +30,7 @@ public class Vala.CCodeFunction : CCodeNode { * The name of this function. */ public string name { get; set; } - + /** * The function return type. */ @@ -63,7 +63,7 @@ public class Vala.CCodeFunction : CCodeNode { this.block = new CCodeBlock (); current_block = block; } - + /** * Appends the specified parameter to the list of function parameters. * @@ -100,12 +100,12 @@ public class Vala.CCodeFunction : CCodeNode { foreach (CCodeParameter param in parameters) { func.parameters.add (param); } - + func.is_declaration = is_declaration; func.block = block; return func; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); if (CCodeModifiers.INTERNAL in modifiers) { @@ -126,7 +126,7 @@ public class Vala.CCodeFunction : CCodeNode { writer.write_string (name); writer.write_string (" ("); int param_pos_begin = (is_declaration ? return_type.char_count () + 1 : 0 ) + name.char_count () + 2; - + bool has_args = (CCodeModifiers.PRINTF in modifiers || CCodeModifiers.SCANF in modifiers); int i = 0; int format_arg_index = -1; @@ -151,7 +151,7 @@ public class Vala.CCodeFunction : CCodeNode { if (i == 0) { writer.write_string ("void"); } - + writer.write_string (")"); if (is_declaration) { diff --git a/ccode/valaccodefunctioncall.vala b/ccode/valaccodefunctioncall.vala index e9e7d14c3..e4a8ec16d 100644 --- a/ccode/valaccodefunctioncall.vala +++ b/ccode/valaccodefunctioncall.vala @@ -30,13 +30,13 @@ public class Vala.CCodeFunctionCall : CCodeExpression { * The function to be called. */ public CCodeExpression? call { get; set; } - + private List arguments = new ArrayList (); - + public CCodeFunctionCall (CCodeExpression? call = null) { this.call = call; } - + /** * Appends the specified expression to the list of arguments. * @@ -70,7 +70,7 @@ public class Vala.CCodeFunctionCall : CCodeExpression { } else { first = false; } - + if (expr != null) { expr.write (writer); } diff --git a/ccode/valaccodefunctiondeclarator.vala b/ccode/valaccodefunctiondeclarator.vala index 30f0c63b1..529473d14 100644 --- a/ccode/valaccodefunctiondeclarator.vala +++ b/ccode/valaccodefunctiondeclarator.vala @@ -30,13 +30,13 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator { * The declarator name. */ public string name { get; set; } - + private List parameters = new ArrayList (); - + public CCodeFunctionDeclarator (string name) { this.name = name; } - + /** * Appends the specified parameter to the list of function parameters. * @@ -45,16 +45,16 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator { public void add_parameter (CCodeParameter param) { parameters.add (param); } - + public override void write (CCodeWriter writer) { write_declaration (writer); } - + public override void write_declaration (CCodeWriter writer) { writer.write_string ("(*"); writer.write_string (name); writer.write_string (") ("); - + bool has_args = (CCodeModifiers.PRINTF in modifiers || CCodeModifiers.SCANF in modifiers); int i = 0; int format_arg_index = -1; @@ -74,7 +74,7 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator { } i++; } - + writer.write_string (")"); if (CCodeModifiers.DEPRECATED in modifiers) { diff --git a/ccode/valaccodegotostatement.vala b/ccode/valaccodegotostatement.vala index 14e2c7d88..b1e0d2980 100644 --- a/ccode/valaccodegotostatement.vala +++ b/ccode/valaccodegotostatement.vala @@ -34,7 +34,7 @@ public class Vala.CCodeGotoStatement : CCodeStatement { public CCodeGotoStatement (string name) { this.name = name; } - + public override void write (CCodeWriter writer) { writer.write_indent (); writer.write_string ("goto "); diff --git a/ccode/valaccodeidentifier.vala b/ccode/valaccodeidentifier.vala index 0954e0a50..f0b1f0106 100644 --- a/ccode/valaccodeidentifier.vala +++ b/ccode/valaccodeidentifier.vala @@ -30,11 +30,11 @@ public class Vala.CCodeIdentifier : CCodeExpression { * The name of this identifier. */ public string name { get; set; } - + public CCodeIdentifier (string _name) { name = _name; } - + public override void write (CCodeWriter writer) { writer.write_string (name); } diff --git a/ccode/valaccodeifstatement.vala b/ccode/valaccodeifstatement.vala index 31a7da996..c4522302e 100644 --- a/ccode/valaccodeifstatement.vala +++ b/ccode/valaccodeifstatement.vala @@ -30,29 +30,29 @@ public class Vala.CCodeIfStatement : CCodeStatement { * The boolean condition to evaluate. */ public CCodeExpression condition { get; set; } - + /** * The statement to be evaluated if the condition holds. */ public CCodeStatement true_statement { get; set; } - + /** * The optional statement to be evaluated if the condition doesn't hold. */ public CCodeStatement? false_statement { get; set; } - + public CCodeIfStatement (CCodeExpression cond, CCodeStatement true_stmt, CCodeStatement? false_stmt = null) { condition = cond; true_statement = true_stmt; false_statement = false_stmt; } - + /** * Specifies whether this if statement is part of an else if statement. * This only affects the output formatting. */ public bool else_if { get; set; } - + public override void write (CCodeWriter writer) { if (!else_if) { writer.write_indent (line); @@ -64,13 +64,13 @@ public class Vala.CCodeIfStatement : CCodeStatement { condition.write (writer); } writer.write_string (")"); - + /* else shouldn't be on a separate line */ if (false_statement != null && true_statement is CCodeBlock) { var cblock = (CCodeBlock) true_statement; cblock.suppress_newline = true; } - + true_statement.write (writer); if (false_statement != null) { if (writer.bol) { @@ -79,13 +79,13 @@ public class Vala.CCodeIfStatement : CCodeStatement { } else { writer.write_string (" else"); } - + /* else if should be on one line */ if (false_statement is CCodeIfStatement) { var cif = (CCodeIfStatement) false_statement; cif.else_if = true; } - + false_statement.write (writer); } } diff --git a/ccode/valaccodeincludedirective.vala b/ccode/valaccodeincludedirective.vala index 549e3f751..184185d95 100644 --- a/ccode/valaccodeincludedirective.vala +++ b/ccode/valaccodeincludedirective.vala @@ -30,18 +30,18 @@ public class Vala.CCodeIncludeDirective : CCodeNode { * The file to be included. */ public string filename { get; set; } - + /** * Specifies whether the specified file should be searched in the local * directory. */ public bool local { get; set; } - + public CCodeIncludeDirective (string _filename, bool _local = false) { filename = _filename; local = _local; } - + public override void write (CCodeWriter writer) { writer.write_indent (); writer.write_string ("#include "); diff --git a/ccode/valaccodeinitializerlist.vala b/ccode/valaccodeinitializerlist.vala index 26cb56e1d..2be3a846a 100644 --- a/ccode/valaccodeinitializerlist.vala +++ b/ccode/valaccodeinitializerlist.vala @@ -27,7 +27,7 @@ using GLib; */ public class Vala.CCodeInitializerList : CCodeExpression { private List initializers = new ArrayList (); - + /** * Appends the specified expression to this initializer list. * @@ -36,7 +36,7 @@ public class Vala.CCodeInitializerList : CCodeExpression { public void append (CCodeExpression expr) { initializers.add (expr); } - + public override void write (CCodeWriter writer) { writer.write_string ("{"); @@ -47,7 +47,7 @@ public class Vala.CCodeInitializerList : CCodeExpression { } else { first = false; } - + if (expr != null) { expr.write (writer); } diff --git a/ccode/valaccodelabel.vala b/ccode/valaccodelabel.vala index efb186693..c0a85788f 100644 --- a/ccode/valaccodelabel.vala +++ b/ccode/valaccodelabel.vala @@ -34,7 +34,7 @@ public class Vala.CCodeLabel : CCodeStatement { public CCodeLabel (string name) { this.name = name; } - + public override void write (CCodeWriter writer) { writer.write_indent (); writer.write_string (name); diff --git a/ccode/valaccodelinedirective.vala b/ccode/valaccodelinedirective.vala index 96b0e017b..c5e61114b 100644 --- a/ccode/valaccodelinedirective.vala +++ b/ccode/valaccodelinedirective.vala @@ -30,12 +30,12 @@ public class Vala.CCodeLineDirective : CCodeNode { * The name of the source file to be presumed. */ public string filename { get; set; } - + /** * The line number in the source file to be presumed. */ public int line_number { get; set; } - + public CCodeLineDirective (string _filename, int _line) { filename = _filename; line_number = _line; diff --git a/ccode/valaccodememberaccess.vala b/ccode/valaccodememberaccess.vala index 2935fc15b..2ed1fe9f9 100644 --- a/ccode/valaccodememberaccess.vala +++ b/ccode/valaccodememberaccess.vala @@ -30,29 +30,29 @@ public class Vala.CCodeMemberAccess : CCodeExpression { * The parent of the member. */ public CCodeExpression inner { get; set; } - + /** * The name of the member. */ public string member_name { get; set; } - + /** * Specifies whether the member access happens by pointer dereferencing. */ public bool is_pointer { get; set; } - + public CCodeMemberAccess (CCodeExpression container, string member, bool pointer = false) { inner = container; member_name = member; is_pointer = pointer; } - + public CCodeMemberAccess.pointer (CCodeExpression container, string member) { inner = container; member_name = member; is_pointer = true; } - + public override void write (CCodeWriter writer) { inner.write_inner (writer); if (is_pointer) { diff --git a/ccode/valaccodeoncesection.vala b/ccode/valaccodeoncesection.vala index 10aa861cc..30b9a369e 100644 --- a/ccode/valaccodeoncesection.vala +++ b/ccode/valaccodeoncesection.vala @@ -30,11 +30,11 @@ public class Vala.CCodeOnceSection : CCodeFragment { * The name of the guarding define. */ public string define { get; set; } - + public CCodeOnceSection (string def) { define = def; } - + public override void write (CCodeWriter writer) { writer.write_indent (); writer.write_string ("#ifndef "); @@ -50,7 +50,7 @@ public class Vala.CCodeOnceSection : CCodeFragment { writer.write_string ("#endif"); writer.write_newline (); } - + public override void write_declaration (CCodeWriter writer) { } } diff --git a/ccode/valaccodeparameter.vala b/ccode/valaccodeparameter.vala index 9f1c2e186..b4bc74963 100644 --- a/ccode/valaccodeparameter.vala +++ b/ccode/valaccodeparameter.vala @@ -30,7 +30,7 @@ public class Vala.CCodeParameter : CCodeNode { * The parameter name. */ public string name { get; set; } - + /** * The parameter type. */ diff --git a/ccode/valaccodeparenthesizedexpression.vala b/ccode/valaccodeparenthesizedexpression.vala index 1fe28702f..08b0807b6 100644 --- a/ccode/valaccodeparenthesizedexpression.vala +++ b/ccode/valaccodeparenthesizedexpression.vala @@ -30,14 +30,14 @@ public class Vala.CCodeParenthesizedExpression : CCodeExpression { * The expression in the parenthesis. */ public CCodeExpression inner { get; set; } - + public CCodeParenthesizedExpression (CCodeExpression expr) { inner = expr; } - + public override void write (CCodeWriter writer) { writer.write_string ("("); - + inner.write (writer); writer.write_string (")"); diff --git a/ccode/valaccodereturnstatement.vala b/ccode/valaccodereturnstatement.vala index 15d91b650..50be0ac7f 100644 --- a/ccode/valaccodereturnstatement.vala +++ b/ccode/valaccodereturnstatement.vala @@ -30,15 +30,15 @@ public class Vala.CCodeReturnStatement : CCodeStatement { * The optional expression to return. */ public CCodeExpression? return_expression { get; set; } - + public CCodeReturnStatement (CCodeExpression? expr = null) { return_expression = expr; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("return"); - + if (return_expression != null) { writer.write_string (" "); return_expression.write (writer); diff --git a/ccode/valaccodestruct.vala b/ccode/valaccodestruct.vala index fce7fcba8..50af6a2bf 100644 --- a/ccode/valaccodestruct.vala +++ b/ccode/valaccodestruct.vala @@ -34,11 +34,11 @@ public class Vala.CCodeStruct : CCodeNode { public bool is_empty { get { return declarations.size == 0; } } private List declarations = new ArrayList (); - + public CCodeStruct (string name) { this.name = name; } - + /** * Adds the specified declaration as member to this struct. * @@ -47,7 +47,7 @@ public class Vala.CCodeStruct : CCodeNode { public void add_declaration (CCodeDeclaration decl) { declarations.add (decl); } - + /** * Adds a variable with the specified type and name to this struct. * @@ -60,7 +60,7 @@ public class Vala.CCodeStruct : CCodeNode { decl.modifiers = modifiers; add_declaration (decl); } - + public override void write (CCodeWriter writer) { writer.write_string ("struct "); writer.write_string (name); diff --git a/ccode/valaccodeswitchstatement.vala b/ccode/valaccodeswitchstatement.vala index 04edaf5f7..ba6534211 100644 --- a/ccode/valaccodeswitchstatement.vala +++ b/ccode/valaccodeswitchstatement.vala @@ -30,11 +30,11 @@ public class Vala.CCodeSwitchStatement : CCodeBlock { * The switch expression. */ public CCodeExpression expression { get; set; } - + public CCodeSwitchStatement (CCodeExpression expression) { this.expression = expression; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("switch ("); diff --git a/ccode/valaccodetypedefinition.vala b/ccode/valaccodetypedefinition.vala index 797c3baf0..f476ad12b 100644 --- a/ccode/valaccodetypedefinition.vala +++ b/ccode/valaccodetypedefinition.vala @@ -30,7 +30,7 @@ public class Vala.CCodeTypeDefinition : CCodeNode { * The type name. */ public string type_name { get; set; } - + /** * The type declarator. */ @@ -40,18 +40,18 @@ public class Vala.CCodeTypeDefinition : CCodeNode { type_name = type; declarator = decl; } - + public override void write (CCodeWriter writer) { } - + public override void write_declaration (CCodeWriter writer) { writer.write_indent (); writer.write_string ("typedef "); - + writer.write_string (type_name); - + writer.write_string (" "); - + declarator.write_declaration (writer); if (CCodeModifiers.DEPRECATED in modifiers) { diff --git a/ccode/valaccodeunaryexpression.vala b/ccode/valaccodeunaryexpression.vala index afcb8c494..548e42181 100644 --- a/ccode/valaccodeunaryexpression.vala +++ b/ccode/valaccodeunaryexpression.vala @@ -30,17 +30,17 @@ public class Vala.CCodeUnaryExpression : CCodeExpression { * The unary operator. */ public CCodeUnaryOperator operator { get; set; } - + /** * The operand. */ public CCodeExpression inner { get; set; } - + public CCodeUnaryExpression (CCodeUnaryOperator op, CCodeExpression expr) { operator = op; inner = expr; } - + public override void write (CCodeWriter writer) { switch (operator) { case CCodeUnaryOperator.PLUS: writer.write_string ("+"); inner.write_inner (writer); break; diff --git a/ccode/valaccodevariabledeclarator.vala b/ccode/valaccodevariabledeclarator.vala index 43372bf6d..17fa478a3 100644 --- a/ccode/valaccodevariabledeclarator.vala +++ b/ccode/valaccodevariabledeclarator.vala @@ -30,7 +30,7 @@ public class Vala.CCodeVariableDeclarator : CCodeDeclarator { * The variable name. */ public string name { get; set; } - + /** * The optional initializer expression. */ diff --git a/ccode/valaccodewhilestatement.vala b/ccode/valaccodewhilestatement.vala index c47a89071..836806e01 100644 --- a/ccode/valaccodewhilestatement.vala +++ b/ccode/valaccodewhilestatement.vala @@ -30,17 +30,17 @@ public class Vala.CCodeWhileStatement : CCodeStatement { * The loop condition. */ public CCodeExpression condition { get; set; } - + /** * The loop body. */ public CCodeStatement body { get; set; } - + public CCodeWhileStatement (CCodeExpression cond, CCodeStatement? stmt = null) { condition = cond; body = stmt; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("while ("); diff --git a/ccode/valaccodewriter.vala b/ccode/valaccodewriter.vala index 0215e7590..26b284c4c 100644 --- a/ccode/valaccodewriter.vala +++ b/ccode/valaccodewriter.vala @@ -54,14 +54,14 @@ public class Vala.CCodeWriter { private bool file_exists; private FileStream? stream; - + private int indent; private int current_line_number = 1; private bool using_line_directive; /* at begin of line */ private bool _bol = true; - + public CCodeWriter (string filename, string? source_filename = null) { this.filename = filename; this.source_filename = source_filename; @@ -115,7 +115,7 @@ public class Vala.CCodeWriter { */ public void close () { stream = null; - + if (file_exists) { var changed = true; @@ -133,7 +133,7 @@ public class Vala.CCodeWriter { } catch (FileError e) { // assume changed if mmap comparison doesn't work } - + if (changed) { FileUtils.rename (temp_filename, filename); } else { @@ -149,7 +149,7 @@ public class Vala.CCodeWriter { } } } - + /** * Writes tabs according to the current indent level. */ @@ -169,11 +169,11 @@ public class Vala.CCodeWriter { if (!_bol) { write_newline (); } - + stream.puts (string.nfill (indent, '\t')); _bol = false; } - + /** * Writes n spaces. */ @@ -190,7 +190,7 @@ public class Vala.CCodeWriter { stream.puts (s); _bol = false; } - + /** * Writes a newline. */ @@ -199,7 +199,7 @@ public class Vala.CCodeWriter { current_line_number++; _bol = true; } - + /** * Opens a new block, increasing the indent level. */ @@ -213,18 +213,18 @@ public class Vala.CCodeWriter { write_newline (); indent++; } - + /** * Closes the current block, decreasing the indent level. */ public void write_end_block () { assert (indent > 0); - + indent--; write_indent (); stream.putc ('}'); } - + /** * Writes the specified text as comment. * diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala index 13be80c3a..39a98e45f 100644 --- a/codegen/valaccodearraymodule.vala +++ b/codegen/valaccodearraymodule.vala @@ -75,12 +75,12 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule { cexpr = new CCodeBinaryExpression (CCodeBinaryOperator.MUL, cexpr, csize); } } - + // add extra item to have array NULL-terminated for all reference types if (expr.element_type.data_type != null && expr.element_type.data_type.is_reference_type ()) { cexpr = new CCodeBinaryExpression (CCodeBinaryOperator.PLUS, cexpr, new CCodeConstant ("1")); } - + gnew.add_argument (cexpr); var temp_var = get_temp_variable (expr.value_type, true, expr); @@ -732,7 +732,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule { if (param.direction != ParameterDirection.IN) { length_ctype = "%s*".printf (length_ctype); } - + for (int dim = 1; dim <= array_type.rank; dim++) { var cparam = new CCodeParameter (get_parameter_array_length_cname (param, dim), length_ctype); cparam_map.set (get_param_pos (get_ccode_array_length_pos (param) + 0.01 * dim), cparam); diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 5ff51e6f2..096426254 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -235,7 +235,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public EmitContext base_finalize_context; public EmitContext instance_init_context; public EmitContext instance_finalize_context; - + public CCodeStruct param_spec_struct; public CCodeStruct closure_struct; public CCodeEnum prop_enum; @@ -251,7 +251,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public Set predefined_marshal_set; /* (constant) hash table with all reserved identifiers in the generated code */ Set reserved_identifiers; - + public int next_temp_var_id { get { return emit_context.next_temp_var_id; } set { emit_context.next_temp_var_id = value; } @@ -325,7 +325,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public bool in_plugin = false; public string module_init_param_name; - + public bool gvaluecollector_h_needed; public bool requires_assert; public bool requires_array_free; @@ -718,11 +718,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public override void visit_source_file (SourceFile source_file) { cfile = new CCodeFile (); - + user_marshal_set = new HashSet (str_hash, str_equal); - + next_regex_id = 0; - + gvaluecollector_h_needed = false; requires_assert = false; requires_array_free = false; @@ -1127,13 +1127,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var rhs = get_cvalue (f.initializer); if (!is_simple_struct_creation (f, f.initializer)) { // otherwise handled in visit_object_creation_expression - + ccode.add_assignment (lhs, rhs); - + if (f.variable_type is ArrayType && get_ccode_array_length (f)) { var array_type = (ArrayType) f.variable_type; var field_value = get_field_cvalue (f, load_this_parameter ((TypeSymbol) f.parent_symbol)); - + var glib_value = (GLibValue) f.initializer.target_value; if (glib_value.array_length_cvalues != null) { for (int dim = 1; dim <= array_type.rank; dim++) { @@ -1144,14 +1144,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { requires_array_length = true; var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length")); len_call.add_argument (get_cvalue_ (glib_value)); - + ccode.add_assignment (get_array_length_cvalue (field_value, 1), len_call); } else { for (int dim = 1; dim <= array_type.rank; dim++) { ccode.add_assignment (get_array_length_cvalue (field_value, dim), new CCodeConstant ("-1")); } } - + if (array_type.rank == 1 && f.is_internal_symbol ()) { var lhs_array_size = get_array_size_cvalue (field_value); var rhs_array_len = get_array_length_cvalue (field_value, 1); @@ -1178,7 +1178,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { pop_context (); } - + if (requires_destroy (f.variable_type) && instance_finalize_context != null) { push_context (instance_finalize_context); ccode.add_expression (destroy_field (f, load_this_parameter ((TypeSymbol) f.parent_symbol))); @@ -2094,7 +2094,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var unref_fun = new CCodeFunction ("block%d_data_unref".printf (block_id), "void"); unref_fun.add_parameter (new CCodeParameter ("_userdata_", "void *")); unref_fun.modifiers = CCodeModifiers.STATIC; - + push_function (unref_fun); ccode.add_declaration (struct_name + "*", new CCodeVariableDeclarator ("_data%d_".printf (block_id), new CCodeCastExpression (new CCodeIdentifier ("_userdata_"), struct_name + "*"))); @@ -2604,7 +2604,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } next_temp_var_id++; - + return local; } @@ -3140,7 +3140,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { generic_elements = (type_arg is GenericType); } } - + if (elements_require_free) { CCodeExpression? cexpr = null; if (element_destroy_func_expression is CCodeIdentifier || element_destroy_func_expression is CCodeMemberAccess) { @@ -3448,7 +3448,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } /* (foo == NULL ? NULL : foo = (unref (foo), NULL)) */ - + /* can be simplified to * foo = (unref (foo), NULL) * if foo is of static type non-null @@ -3511,10 +3511,10 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } } - + ccomma.append_expression (ccall); ccomma.append_expression (new CCodeConstant ("NULL")); - + var cassign = new CCodeAssignment (cvar, ccomma); // g_free (NULL) is allowed @@ -3526,7 +3526,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { return new CCodeConditionalExpression (cisnull, new CCodeConstant ("NULL"), cassign); } - + public override void visit_end_full_expression (Expression expr) { /* expr is a full expression, i.e. an initializer, the * expression in an expression statement, the controlling @@ -3551,7 +3551,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { temp_ref_values.clear (); } - + public void emit_temp_var (LocalVariable local) { var init = (!local.name.has_prefix ("*") && local.init); if (is_in_coroutine ()) { @@ -3857,7 +3857,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var inner_node = ((MemberAccess)resource).inner; var member = resource.symbol_reference; var parent = (TypeSymbol)resource.symbol_reference.parent_symbol; - + if (member.is_instance_member ()) { if (inner_node == null) { l = new CCodeIdentifier ("self"); @@ -3888,7 +3888,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } return l; } - + public override void visit_lock_statement (LockStatement stmt) { var l = get_lock_expression (stmt, stmt.resource); @@ -3897,13 +3897,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { ccode.add_expression (fc); } - + public override void visit_unlock_statement (UnlockStatement stmt) { var l = get_lock_expression (stmt, stmt.resource); - + var fc = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_name (mutex_type.scope.lookup ("unlock")))); fc.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, l)); - + ccode.add_expression (fc); } @@ -4156,17 +4156,17 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { // return previous value expr.target_value = temp_value; } - + private MemberAccess? find_property_access (Expression expr) { if (!(expr is MemberAccess)) { return null; } - + var ma = (MemberAccess) expr; if (ma.symbol_reference is Property) { return ma; } - + return null; } @@ -4310,7 +4310,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { * ref (expr) * if static type of expr is non-null */ - + var dupexpr = get_dup_func_expression (type, node.source_reference); if (dupexpr == null) { @@ -4358,7 +4358,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { if (!(type is ArrayType) && get_non_null (value) && !is_ref_function_void (type)) { // expression is non-null ccall.add_argument (cexpr); - + return store_temp_value (new GLibValue (type, ccall), node); } else { var cnotnull = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, cexpr, new CCodeConstant ("NULL")); @@ -4775,14 +4775,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { cexpr = handle_struct_argument (null, arg, cexpr); arg_pos = get_param_pos (i, ellipsis); } - + carg_map.set (arg_pos, cexpr); i++; } if (params_it.next ()) { var param = params_it.get (); - + /* if there are more parameters than arguments, * the additional parameter is an ellipsis parameter * otherwise there is a bug in the semantic analyzer @@ -5315,7 +5315,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } } - + public override void visit_named_argument (NamedArgument expr) { set_cvalue (expr, get_cvalue (expr.inner)); } @@ -5363,7 +5363,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } else { ccode.add_assignment (get_cvalue (expr.inner), new CCodeConstant ("NULL")); - } + } } public override void visit_binary_expression (BinaryExpression expr) { @@ -5459,7 +5459,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } else { assert_not_reached (); } - + if (expr.operator == BinaryOperator.EQUALITY || expr.operator == BinaryOperator.INEQUALITY) { var left_type = expr.left.target_type; @@ -5904,7 +5904,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { array_needs_copy = requires_copy (target_array.element_type); } } - + if (!gvalue_boxing && !gvariant_boxing && target_type.value_owned && (!type.value_owned || boxing || unboxing || array_needs_copy) && requires_copy (target_type) && !(type is NullType)) { // need to copy value var copy = (GLibValue) copy_value (result, node); @@ -5964,7 +5964,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var base_class = (Class) prop.base_property.parent_symbol; var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_class, null)))); vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (current_class, null)))); - + var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, "set_%s".printf (prop.name))); ccall.add_argument ((CCodeExpression) get_ccodenode (instance)); var cexpr = get_cvalue_ (value); @@ -5992,7 +5992,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } var set_func = "g_object_set"; - + var base_property = prop; if (!get_ccode_no_accessor_method (prop)) { if (prop.base_property != null) { @@ -6016,7 +6016,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } } - + var ccall = new CCodeFunctionCall (new CCodeIdentifier (set_func)); if (prop.binding == MemberBinding.INSTANCE) { @@ -6135,7 +6135,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } return null; } - + private void create_property_type_check_statement (Property prop, bool check_return_type, TypeSymbol t, bool non_null, string var_name) { if (check_return_type) { create_type_check_statement (prop, prop.property_type, t, non_null, var_name); diff --git a/codegen/valaccodecontrolflowmodule.vala b/codegen/valaccodecontrolflowmodule.vala index 91268e7d1..6b5505b12 100644 --- a/codegen/valaccodecontrolflowmodule.vala +++ b/codegen/valaccodecontrolflowmodule.vala @@ -145,7 +145,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule { n++; } - + if (default_section != null) { if (n > 0) { ccode.add_else (); @@ -228,7 +228,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule { visit_local_variable (collection_backup); ccode.add_assignment (get_variable_cexpression (get_local_cname (collection_backup)), get_cvalue (stmt.collection)); - + if (stmt.tree_can_fail && stmt.collection.tree_can_fail) { // exception handling add_simple_check (stmt.collection); @@ -245,7 +245,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule { var iterator_variable = new LocalVariable (int_type.copy (), stmt.variable_name + "_it"); visit_local_variable (iterator_variable); var it_name = get_local_cname (iterator_variable); - + var ccond = new CCodeBinaryExpression (CCodeBinaryOperator.LESS_THAN, get_variable_cexpression (it_name), array_len); ccode.open_for (new CCodeAssignment (get_variable_cexpression (it_name), new CCodeConstant ("0")), @@ -278,7 +278,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule { var iterator_variable = new LocalVariable (collection_type.copy (), stmt.variable_name + "_it"); visit_local_variable (iterator_variable); var it_name = get_local_cname (iterator_variable); - + var ccond = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, get_variable_cexpression (it_name), new CCodeConstant ("NULL")); ccode.open_for (new CCodeAssignment (get_variable_cexpression (it_name), get_variable_cexpression (get_local_cname (collection_backup))), diff --git a/codegen/valaccodedelegatemodule.vala b/codegen/valaccodedelegatemodule.vala index 13a402568..82202c97a 100644 --- a/codegen/valaccodedelegatemodule.vala +++ b/codegen/valaccodedelegatemodule.vala @@ -60,12 +60,12 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule { // handle array parameters if (get_ccode_array_length (param) && param.variable_type is ArrayType) { var array_type = (ArrayType) param.variable_type; - + var length_ctype = "int"; if (param.direction != ParameterDirection.IN) { length_ctype = "int*"; } - + for (int dim = 1; dim <= array_type.rank; dim++) { cparam = new CCodeParameter (get_parameter_array_length_cname (param, dim), length_ctype); cfundecl.add_parameter (cparam); diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala index f4eae3cee..71702a9c1 100644 --- a/codegen/valaccodememberaccessmodule.vala +++ b/codegen/valaccodememberaccessmodule.vala @@ -25,7 +25,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { public override void visit_member_access (MemberAccess expr) { CCodeExpression pub_inst = null; - + if (expr.inner != null) { pub_inst = get_cvalue (expr.inner); } @@ -53,7 +53,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { var base_class = (Class) m.base_method.parent_symbol; var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_class, null)))); vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (current_class, null)))); - + set_cvalue (expr, new CCodeMemberAccess.pointer (vcast, get_ccode_vfunc_name (m))); return; } else if (m.base_interface_method != null) { @@ -181,7 +181,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { var base_class = (Class) base_prop.parent_symbol; var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_class, null)))); vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (current_class, null)))); - + var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, "get_%s".printf (prop.name))); ccall.add_argument (get_cvalue (expr.inner)); if (prop.property_type.is_real_non_null_struct_type ()) { diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala index 6ab1597bb..65b455fa5 100644 --- a/codegen/valaccodemethodcallmodule.vala +++ b/codegen/valaccodemethodcallmodule.vala @@ -35,12 +35,12 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { Method m = null; Delegate deleg = null; List params; - + var ma = expr.call as MemberAccess; - + var itype = expr.call.value_type; params = itype.get_parameters (); - + if (itype is MethodType) { assert (ma != null); m = ((MethodType) itype).method_symbol; @@ -238,7 +238,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { } else if (m != null && m.binding == MemberBinding.CLASS) { var cl = (Class) m.parent_symbol; var cast = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_upper_case_name (cl, null) + "_CLASS")); - + CCodeExpression klass; if (ma.inner == null) { if (get_this_type () == null) { @@ -335,7 +335,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { } bool ellipsis = false; - + int i = 1; int arg_pos; Iterator params_it = params.iterator (); @@ -675,7 +675,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { } // append C arguments in the right order - + int last_pos; int min_pos; @@ -838,7 +838,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { params_it = params.iterator (); foreach (Expression arg in expr.get_argument_list ()) { Parameter param = null; - + if (params_it.next ()) { param = params_it.get (); if (param.params_array || param.ellipsis) { @@ -865,7 +865,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { requires_array_length = true; var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length")); len_call.add_argument (get_cvalue_ (unary.inner.target_value)); - + ccode.add_assignment (get_array_length_cvalue (unary.inner.target_value, 1), len_call); } } diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index 1b9c677a3..8caaef347 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -1103,7 +1103,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { vcast = new CCodeIdentifier ("self"); } } - + cname = get_ccode_vfunc_name (m); if (suffix == "_finish" && cname.has_suffix ("_async")) { cname = cname.substring (0, cname.length - "_async".length); @@ -1202,7 +1202,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { return; } } - + ccode.add_expression (ccheck); } diff --git a/codegen/valaclassregisterfunction.vala b/codegen/valaclassregisterfunction.vala index dcff2ed63..b4906d5de 100644 --- a/codegen/valaclassregisterfunction.vala +++ b/codegen/valaclassregisterfunction.vala @@ -40,11 +40,11 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { public ClassRegisterFunction (Class cl) { class_reference = cl; } - + public override TypeSymbol get_type_declaration () { return class_reference; } - + public override string get_type_struct_name () { return "%sClass".printf (get_ccode_name (class_reference)); } @@ -76,15 +76,15 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { public override string get_class_init_func_name () { return "%s_class_init".printf (get_ccode_lower_case_name (class_reference, null)); } - + public override string get_instance_struct_size () { return "sizeof (%s)".printf (get_ccode_name (class_reference)); } - + public override string get_instance_init_func_name () { return "%s_instance_init".printf (get_ccode_lower_case_name (class_reference, null)); } - + public override string get_parent_type_name () { return get_ccode_type_id (class_reference.base_class); } @@ -151,22 +151,22 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { public override CCodeFragment get_type_interface_init_declaration () { var frag = new CCodeFragment (); - + foreach (DataType base_type in class_reference.get_base_types ()) { if (!(base_type.data_type is Interface)) { continue; } - + var iface = (Interface) base_type.data_type; - + var iface_info_name = "%s_info".printf (get_ccode_lower_case_name (iface, null)); - + var ctypedecl = new CCodeDeclaration ("const GInterfaceInfo"); ctypedecl.modifiers = CCodeModifiers.STATIC; ctypedecl.add_declarator (new CCodeVariableDeclarator (iface_info_name, new CCodeConstant ("{ (GInterfaceInitFunc) %s_%s_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}".printf (get_ccode_lower_case_name (class_reference), get_ccode_lower_case_name (iface))))); frag.append (ctypedecl); } - + return frag; } @@ -175,9 +175,9 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { if (!(base_type.data_type is Interface)) { continue; } - + var iface = (Interface) base_type.data_type; - + var iface_info_name = "%s_info".printf (get_ccode_lower_case_name (iface, null)); if (!plugin) { var reg_call = new CCodeFunctionCall (new CCodeIdentifier ("g_type_add_interface_static")); @@ -194,7 +194,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { block.add_statement (new CCodeExpressionStatement (reg_call)); } } - + ((CCodeBaseModule) context.codegen).register_dbus_info (block, class_reference); } } diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala index bd814f08e..d0de35052 100644 --- a/codegen/valagirwriter.vala +++ b/codegen/valagirwriter.vala @@ -1090,7 +1090,7 @@ public class Vala.GIRWriter : CodeVisitor { write_indent (); buffer.append_printf ("\n", tag_name); } - + public override void visit_creation_method (CreationMethod m) { if (m.external_package) { return; @@ -1194,7 +1194,7 @@ public class Vala.GIRWriter : CodeVisitor { if (sig.emitter != null) { sig.emitter.accept (this); } - + write_indent (); buffer.append_printf (" 0) { ccode.add_assignment (new CCodeMemberAccess.pointer (ccall, "set_property"), new CCodeIdentifier ("_vala_%s_set_property".printf (get_ccode_lower_case_name (cl, null)))); } - + /* set constructor */ if (cl.constructor != null) { var ccast = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_CLASS")); @@ -192,7 +192,7 @@ public class Vala.GObjectModule : GTypeModule { get_prop.add_parameter (new CCodeParameter ("pspec", "GParamSpec *")); push_function (get_prop); - + CCodeFunctionCall ccall = generate_instance_cast (new CCodeIdentifier ("object"), cl); ccode.add_declaration ("%s *".printf (get_ccode_name (cl)), new CCodeVariableDeclarator ("self", ccall)); @@ -290,7 +290,7 @@ public class Vala.GObjectModule : GTypeModule { cfile.add_function_declaration (get_prop); cfile.add_function (get_prop); } - + private void add_set_property_function (Class cl) { var set_prop = new CCodeFunction ("_vala_%s_set_property".printf (get_ccode_lower_case_name (cl, null)), "void"); set_prop.modifiers = CCodeModifiers.STATIC; @@ -300,7 +300,7 @@ public class Vala.GObjectModule : GTypeModule { set_prop.add_parameter (new CCodeParameter ("pspec", "GParamSpec *")); push_function (set_prop); - + CCodeFunctionCall ccall = generate_instance_cast (new CCodeIdentifier ("object"), cl); ccode.add_declaration ("%s *".printf (get_ccode_name (cl)), new CCodeVariableDeclarator ("self", ccall)); @@ -442,11 +442,11 @@ public class Vala.GObjectModule : GTypeModule { var function = new CCodeFunction ("%s_constructor".printf (get_ccode_lower_case_name (cl, null)), "GObject *"); function.modifiers = CCodeModifiers.STATIC; - + function.add_parameter (new CCodeParameter ("type", "GType")); function.add_parameter (new CCodeParameter ("n_construct_properties", "guint")); function.add_parameter (new CCodeParameter ("construct_properties", "GObjectConstructParam *")); - + cfile.add_function_declaration (function); push_function (function); @@ -705,7 +705,7 @@ public class Vala.GObjectModule : GTypeModule { inst_ma.target_value = new GLibValue (get_data_type_for_symbol ((Class) prop.parent_symbol), new CCodeIdentifier ("self"), true); store_property (prop, inst_ma, prop.initializer.target_value); - temp_ref_values.clear (); + temp_ref_values.clear (); pop_context (); } } diff --git a/codegen/valagsignalmodule.vala b/codegen/valagsignalmodule.vala index 4f99941d6..7bf71f344 100644 --- a/codegen/valagsignalmodule.vala +++ b/codegen/valagsignalmodule.vala @@ -35,9 +35,9 @@ public class Vala.GSignalModule : GObjectModule { prefix = "g_cclosure_user_marshal"; } } - + ret = "%s_%s_".printf (prefix, get_ccode_marshaller_type_name (return_type)); - + if (params == null || params.size == 0) { ret = ret + "_VOID"; } else { @@ -45,10 +45,10 @@ public class Vala.GSignalModule : GObjectModule { ret = "%s_%s".printf (ret, get_ccode_marshaller_type_name (p).replace (",", "_")); } } - + return ret; } - + private string? get_value_type_name_from_type_reference (DataType t) { if (t is PointerType || t is GenericType) { return "gpointer"; @@ -74,10 +74,10 @@ public class Vala.GSignalModule : GObjectModule { } else if (t is ErrorType) { return "gpointer"; } - + return null; } - + private string? get_value_type_name_from_parameter (Parameter p) { if (p.direction != ParameterDirection.IN) { return "gpointer"; @@ -85,10 +85,10 @@ public class Vala.GSignalModule : GObjectModule { return get_value_type_name_from_type_reference (p.variable_type); } } - + private string get_marshaller_signature (List params, DataType return_type) { string signature; - + signature = "%s:".printf (get_ccode_marshaller_type_name (return_type)); if (params == null || params.size == 0) { signature = signature + "VOID"; @@ -103,7 +103,7 @@ public class Vala.GSignalModule : GObjectModule { } } } - + return signature; } @@ -198,16 +198,16 @@ public class Vala.GSignalModule : GObjectModule { void generate_marshaller (List params, DataType return_type) { string signature; int n_params, i; - + /* check whether a signal with the same signature already exists for this source file (or predefined) */ signature = get_marshaller_signature (params, return_type); if (predefined_marshal_set.contains (signature) || user_marshal_set.contains (signature)) { return; } - + var signal_marshaller = new CCodeFunction (get_marshaller_function (params, return_type, null), "void"); signal_marshaller.modifiers = CCodeModifiers.STATIC; - + signal_marshaller.add_parameter (new CCodeParameter ("closure", "GClosure *")); signal_marshaller.add_parameter (new CCodeParameter ("return_value", "GValue *")); signal_marshaller.add_parameter (new CCodeParameter ("n_param_values", "guint")); @@ -244,7 +244,7 @@ public class Vala.GSignalModule : GObjectModule { if (return_type.data_type != null || return_type.is_array ()) { ccode.add_declaration (get_value_type_name_from_type_reference (return_type), new CCodeVariableDeclarator ("v_return")); - + fc = new CCodeFunctionCall (new CCodeIdentifier ("g_return_if_fail")); fc.add_argument (new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, new CCodeIdentifier ("return_value"), new CCodeConstant ("NULL"))); ccode.add_expression (fc); @@ -268,7 +268,7 @@ public class Vala.GSignalModule : GObjectModule { var c_assign_rhs = new CCodeCastExpression (new CCodeConditionalExpression (new CCodeIdentifier ("marshal_data"), new CCodeIdentifier ("marshal_data"), new CCodeMemberAccess (new CCodeIdentifier ("cc"), "callback", true)), get_marshaller_function (params, return_type, "GMarshalFunc")); ccode.add_assignment (new CCodeIdentifier ("callback"), c_assign_rhs); - + fc = new CCodeFunctionCall (new CCodeIdentifier ("callback")); fc.add_argument (new CCodeIdentifier ("data1")); i = 1; @@ -306,10 +306,10 @@ public class Vala.GSignalModule : GObjectModule { } } fc.add_argument (new CCodeIdentifier ("data2")); - + if (return_type.data_type != null || return_type.is_array ()) { ccode.add_assignment (new CCodeIdentifier ("v_return"), fc); - + CCodeFunctionCall set_fc; if (return_type.is_array ()) { if (((ArrayType) return_type).element_type.data_type == string_type.data_type) { @@ -332,14 +332,14 @@ public class Vala.GSignalModule : GObjectModule { } set_fc.add_argument (new CCodeIdentifier ("return_value")); set_fc.add_argument (new CCodeIdentifier ("v_return")); - + ccode.add_expression (set_fc); } else { ccode.add_expression (fc); } - + pop_function (); - + cfile.add_function_declaration (signal_marshaller); cfile.add_function (signal_marshaller); user_marshal_set.add (signature); @@ -530,20 +530,20 @@ public class Vala.GSignalModule : GObjectModule { public override void visit_member_access (MemberAccess expr) { if (expr.symbol_reference is Signal) { CCodeExpression pub_inst = null; - + if (expr.inner != null) { pub_inst = get_cvalue (expr.inner); } var sig = (Signal) expr.symbol_reference; var cl = (TypeSymbol) sig.parent_symbol; - + if (expr.inner is BaseAccess && sig.is_virtual) { var m = sig.default_handler; var base_class = (Class) m.parent_symbol; var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_class, null)))); vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (current_class)))); - + set_cvalue (expr, new CCodeMemberAccess.pointer (vcast, m.name)); return; } @@ -574,7 +574,7 @@ public class Vala.GSignalModule : GObjectModule { ccall.add_argument (pub_inst); ccall.add_argument (get_signal_canonical_constant (sig)); - + set_cvalue (expr, ccall); } } else { diff --git a/codegen/valagtkmodule.vala b/codegen/valagtkmodule.vala index 5d3299d5f..309d1378e 100644 --- a/codegen/valagtkmodule.vala +++ b/codegen/valagtkmodule.vala @@ -193,7 +193,7 @@ public class Vala.GtkModule : GSignalModule { // detailed signal, we don't care about the detail signal_name = signal_name.substring (0, sep_idx); } - + var sig = SemanticAnalyzer.symbol_lookup_inherited (current_class, signal_name.replace ("-", "_")) as Signal; if (sig != null) { current_handler_to_signal_map.set (handler_name, sig); @@ -326,7 +326,7 @@ public class Vala.GtkModule : GSignalModule { ccode.add_expression (call); pop_context (); - + if (!field_class.external && !field_class.external_package) { current_required_app_classes.add (field_class); } @@ -387,7 +387,7 @@ public class Vala.GtkModule : GSignalModule { call.add_argument (get_type_id_expression (SemanticAnalyzer.get_data_type_for_symbol (req))); ccode.add_expression (call); } - + var call = new CCodeFunctionCall (new CCodeIdentifier ("gtk_widget_init_template")); call.add_argument (new CCodeIdentifier ("GTK_WIDGET (self)")); ccode.add_expression (call); diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala index 7a4dcabdf..3e553ec7e 100644 --- a/codegen/valagtypemodule.vala +++ b/codegen/valagtypemodule.vala @@ -720,7 +720,7 @@ public class Vala.GTypeModule : GErrorModule { add_interface_init_function (cl, (Interface) base_type.data_type); } } - + add_instance_init_function (cl); if (!cl.is_compact && (cl.get_fields ().size > 0 || cl.destructor != null || cl.is_fundamental ())) { @@ -830,7 +830,7 @@ public class Vala.GTypeModule : GErrorModule { function.modifiers = CCodeModifiers.STATIC; push_function (function); - + var vpointer = new CCodeMemberAccess(new CCodeMemberAccess.pointer (new CCodeIdentifier ("value"), "data[0]"),"v_pointer"); var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%sunref".printf (get_ccode_lower_case_prefix (cl)))); ccall.add_argument (vpointer); @@ -1236,7 +1236,7 @@ public class Vala.GTypeModule : GErrorModule { func.modifiers = CCodeModifiers.STATIC; CCodeFunctionCall ccall; - + /* save pointer to parent class */ var parent_decl = new CCodeDeclaration ("gpointer"); var parent_var_decl = new CCodeVariableDeclarator ("%s_parent_class".printf (get_ccode_lower_case_name (cl, null))); @@ -1251,7 +1251,7 @@ public class Vala.GTypeModule : GErrorModule { ccall.add_argument (new CCodeIdentifier ("klass")); var parent_assignment = new CCodeAssignment (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (cl, null))), ccall); ccode.add_expression (parent_assignment); - + if (!cl.is_compact && !cl.is_subtype_of (gobject_type) && (cl.get_fields ().size > 0 || cl.destructor != null || cl.is_fundamental ())) { // set finalize function @@ -1310,7 +1310,7 @@ public class Vala.GTypeModule : GErrorModule { continue; } var base_type = prop.base_property.parent_symbol; - + var ccast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_type)))); ccast.add_argument (new CCodeIdentifier ("klass")); @@ -1344,7 +1344,7 @@ public class Vala.GTypeModule : GErrorModule { private void add_class_init_function (Class cl) { cfile.add_function (class_init_context.ccode); } - + private void add_generic_accessor_function (string base_name, string return_type, CCodeExpression? expression, TypeParameter p, Class cl, Interface iface) { string name = "%s_%s_%s".printf (get_ccode_lower_case_name (cl), get_ccode_lower_case_name (iface), base_name); @@ -1372,9 +1372,9 @@ public class Vala.GTypeModule : GErrorModule { iface_init.modifiers = CCodeModifiers.STATIC; push_function (iface_init); - + CCodeFunctionCall ccall; - + /* save pointer to parent vtable */ string parent_iface_var = "%s_%s_parent_iface".printf (get_ccode_lower_case_name (cl), get_ccode_lower_case_name (iface)); var parent_decl = new CCodeDeclaration ("%s *".printf (get_ccode_type_name (iface))); @@ -1396,7 +1396,7 @@ public class Vala.GTypeModule : GErrorModule { if (base_type != iface) { continue; } - + var ciface = new CCodeIdentifier ("iface"); CCodeExpression cfunc; if (m.is_abstract || m.is_virtual) { @@ -1478,7 +1478,7 @@ public class Vala.GTypeModule : GErrorModule { if (base_type != iface) { continue; } - + var ciface = new CCodeIdentifier ("iface"); if (!get_ccode_no_accessor_method (prop.base_interface_property) && !get_ccode_concrete_accessor (prop.base_interface_property)) { @@ -1683,7 +1683,7 @@ public class Vala.GTypeModule : GErrorModule { push_context (instance_init_context); end_instance_init (cl); pop_context (); - + cfile.add_function (instance_init_context.ccode); } @@ -2001,7 +2001,7 @@ public class Vala.GTypeModule : GErrorModule { } else { cspec.call = new CCodeIdentifier ("g_param_spec_pointer"); } - + var pflags = "G_PARAM_STATIC_STRINGS"; if (prop.get_accessor != null && prop.get_accessor.access != SymbolAccessibility.PRIVATE) { pflags = "%s%s".printf (pflags, " | G_PARAM_READABLE"); @@ -2044,7 +2044,7 @@ public class Vala.GTypeModule : GErrorModule { } var type_struct = new CCodeStruct ("_%s".printf (get_ccode_type_name (iface))); - + decl_space.add_type_declaration (new CCodeNewline ()); var macro = "(%s_get_type ())".printf (get_ccode_lower_case_name (iface, null)); decl_space.add_type_declaration (new CCodeMacroReplacement (get_ccode_type_id (iface), macro)); diff --git a/codegen/valagvariantmodule.vala b/codegen/valagvariantmodule.vala index bca03f12c..79c29fdb1 100644 --- a/codegen/valagvariantmodule.vala +++ b/codegen/valagvariantmodule.vala @@ -431,7 +431,7 @@ public class Vala.GVariantModule : GAsyncModule { hash_table_new.add_argument (new CCodeIdentifier ("g_direct_hash")); hash_table_new.add_argument (new CCodeIdentifier ("g_direct_equal")); } - + if (key_type.data_type.is_subtype_of (string_type.data_type)) { hash_table_new.add_argument (new CCodeIdentifier ("g_free")); } else if (key_type.data_type == gvariant_type) { @@ -441,7 +441,7 @@ public class Vala.GVariantModule : GAsyncModule { } else { hash_table_new.add_argument (new CCodeIdentifier ("NULL")); } - + if (value_type.data_type.is_subtype_of (string_type.data_type)) { hash_table_new.add_argument (new CCodeIdentifier ("g_free")); } else if (value_type.data_type == gvariant_type) { diff --git a/codegen/valainterfaceregisterfunction.vala b/codegen/valainterfaceregisterfunction.vala index 505766900..e2c673229 100644 --- a/codegen/valainterfaceregisterfunction.vala +++ b/codegen/valainterfaceregisterfunction.vala @@ -32,15 +32,15 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction { * Specifies the interface to be registered. */ public weak Interface interface_reference { get; set; } - + public InterfaceRegisterFunction (Interface iface) { interface_reference = iface; } - + public override TypeSymbol get_type_declaration () { return interface_reference; } - + public override string get_type_struct_name () { return get_ccode_type_name (interface_reference); } @@ -64,11 +64,11 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction { public override string get_instance_struct_size () { return "0"; } - + public override string get_instance_init_func_name () { return "NULL"; } - + public override string get_parent_type_name () { return "G_TYPE_INTERFACE"; } @@ -81,11 +81,11 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction { /* register all prerequisites */ foreach (DataType prereq_ref in interface_reference.get_prerequisites ()) { var prereq = prereq_ref.data_type; - + var func = new CCodeFunctionCall (new CCodeIdentifier ("g_type_interface_add_prerequisite")); func.add_argument (new CCodeIdentifier ("%s_type_id".printf (get_ccode_lower_case_name (interface_reference)))); func.add_argument (new CCodeIdentifier (get_ccode_type_id (prereq))); - + block.add_statement (new CCodeExpressionStatement (func)); } diff --git a/codegen/valastructregisterfunction.vala b/codegen/valastructregisterfunction.vala index 90234bd11..c210f8631 100644 --- a/codegen/valastructregisterfunction.vala +++ b/codegen/valastructregisterfunction.vala @@ -40,7 +40,7 @@ public class Vala.StructRegisterFunction : TypeRegisterFunction { public StructRegisterFunction (Struct st) { struct_reference = st; } - + public override TypeSymbol get_type_declaration () { return struct_reference; } diff --git a/codegen/valatyperegisterfunction.vala b/codegen/valatyperegisterfunction.vala index 1580c9e8c..51993f358 100644 --- a/codegen/valatyperegisterfunction.vala +++ b/codegen/valatyperegisterfunction.vala @@ -256,7 +256,7 @@ public abstract class Vala.TypeRegisterFunction { definition_fragment.append (fun); } - + /** * Returns the data type to be registered. * @@ -414,7 +414,7 @@ public abstract class Vala.TypeRegisterFunction { */ public virtual void get_type_interface_init_statements (CodeContext context, CCodeBlock block, bool plugin) { } - + public CCodeFragment get_source_declaration () { return source_declaration_fragment; } @@ -427,7 +427,7 @@ public abstract class Vala.TypeRegisterFunction { public CCodeFragment get_declaration () { return declaration_fragment; } - + /** * Returns the definition for this type register function in C code. * diff --git a/gee/timsort.vala b/gee/timsort.vala index e8efa2330..2db14fd3e 100644 --- a/gee/timsort.vala +++ b/gee/timsort.vala @@ -278,7 +278,7 @@ internal class Vala.TimSort { #endif Slice a = (owned) pending[index]; Slice b = (owned) pending[index + 1]; - + assert (a.length > 0); assert (b.length > 0); assert (a.index + a.length == b.index); @@ -648,7 +648,7 @@ internal class Vala.TimSort { this.index = index; this.length = length; } - + ~Slice () { if (new_list != null) free (new_list); diff --git a/libvaladoc/api/attribute.vala b/libvaladoc/api/attribute.vala index da6591992..e138389be 100644 --- a/libvaladoc/api/attribute.vala +++ b/libvaladoc/api/attribute.vala @@ -101,7 +101,7 @@ public class Valadoc.Api.Attribute : Item { } builder.append_attribute ("]"); - + return builder.get (); } } diff --git a/libvaladoc/api/signaturebuilder.vala b/libvaladoc/api/signaturebuilder.vala index a897dae6b..2ad71e9d8 100644 --- a/libvaladoc/api/signaturebuilder.vala +++ b/libvaladoc/api/signaturebuilder.vala @@ -46,7 +46,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds text onto the end of the builder. + * Adds text onto the end of the builder. * * @param text a string * @param spaced add a space at the front of the string if necessary @@ -59,7 +59,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds text onto the end of the builder. + * Adds text onto the end of the builder. * * @param text a string * @param spaced add a space at the front of the string if necessary @@ -72,7 +72,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds highlighted text onto the end of the builder. + * Adds highlighted text onto the end of the builder. * * @param text a string * @param spaced add a space at the front of the string if necessary @@ -86,7 +86,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a Inline onto the end of the builder. + * Adds a Inline onto the end of the builder. * * @param content a content * @param spaced add a space at the front of the inline if necessary @@ -101,7 +101,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a keyword onto the end of the builder. + * Adds a keyword onto the end of the builder. * * @param keyword a keyword * @param spaced add a space at the front of the keyword if necessary @@ -114,7 +114,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a symbol onto the end of the builder. + * Adds a symbol onto the end of the builder. * * @param node a node * @param spaced add a space at the front of the node if necessary @@ -127,7 +127,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a type onto the end of the builder. + * Adds a type onto the end of the builder. * * @param node a node * @param spaced add a space at the front of the node if necessary @@ -145,7 +145,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a type name onto the end of the builder. + * Adds a type name onto the end of the builder. * * @param name a type name * @param spaced add a space at the front of the type name if necessary @@ -158,7 +158,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a literal onto the end of the builder. + * Adds a literal onto the end of the builder. * * @param literal a literal * @param spaced add a space at the front of the literal if necessary diff --git a/libvaladoc/api/sourcecomment.vala b/libvaladoc/api/sourcecomment.vala index 2d8eb1485..710e411ed 100644 --- a/libvaladoc/api/sourcecomment.vala +++ b/libvaladoc/api/sourcecomment.vala @@ -27,7 +27,7 @@ public class Valadoc.Api.SourceComment { public SourceFile file { private set; - get; + get; } /** diff --git a/libvaladoc/api/tree.vala b/libvaladoc/api/tree.vala index b505fafcd..833aea529 100644 --- a/libvaladoc/api/tree.vala +++ b/libvaladoc/api/tree.vala @@ -181,7 +181,7 @@ public class Valadoc.Api.Tree { _cresolver = new CTypeResolver (this); } - return _cresolver.resolve_symbol_type (cname); + return _cresolver.resolve_symbol_type (cname); } public Node? search_symbol_cstr (Node? element, string cname) { diff --git a/libvaladoc/api/typeparameter.vala b/libvaladoc/api/typeparameter.vala index 9cfe86482..e28215804 100644 --- a/libvaladoc/api/typeparameter.vala +++ b/libvaladoc/api/typeparameter.vala @@ -34,7 +34,7 @@ public class Valadoc.Api.TypeParameter : Symbol { /** * {@inheritDoc} - */ + */ protected override Inline build_signature () { return new SignatureBuilder () .append_symbol (this) @@ -43,12 +43,12 @@ public class Valadoc.Api.TypeParameter : Symbol { /** * {@inheritDoc} - */ + */ public override NodeType node_type { get { return NodeType.TYPE_PARAMETER; } } /** * {@inheritDoc} - */ + */ public override void accept (Visitor visitor) { visitor.visit_type_parameter (this); } diff --git a/libvaladoc/api/typereference.vala b/libvaladoc/api/typereference.vala index 3fd975c4b..5f29f293f 100644 --- a/libvaladoc/api/typereference.vala +++ b/libvaladoc/api/typereference.vala @@ -120,7 +120,7 @@ public class Valadoc.Api.TypeReference : Item { /** * {@inheritDoc} - */ + */ protected override Inline build_signature () { var signature = new SignatureBuilder (); diff --git a/libvaladoc/content/link.vala b/libvaladoc/content/link.vala index 4e91aabe2..c48429c41 100644 --- a/libvaladoc/content/link.vala +++ b/libvaladoc/content/link.vala @@ -47,7 +47,7 @@ public class Valadoc.Content.Link : InlineContent, Inline { public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { - + // Internal gktdoc-id? (gir-importer) if (id_registrar != null) { Api.Node? node = id_registrar.map_symbol_id (url); @@ -61,7 +61,7 @@ public class Valadoc.Content.Link : InlineContent, Inline { replacement.check (api_root, container, file_path, reporter, settings); _parent.replace_node (this, replacement); return ; - } + } string _url = id_registrar.map_url_id (url); diff --git a/libvaladoc/content/run.vala b/libvaladoc/content/run.vala index c2228b76a..d2edd1650 100644 --- a/libvaladoc/content/run.vala +++ b/libvaladoc/content/run.vala @@ -37,7 +37,7 @@ public class Valadoc.Content.Run : InlineContent, Inline { LANG_PREPROCESSOR, LANG_COMMENT, LANG_ESCAPE, - + XML_ESCAPE, XML_ELEMENT, XML_ATTRIBUTE, @@ -60,7 +60,7 @@ public class Valadoc.Content.Run : InlineContent, Inline { return Style.UNDERLINED; case "monospaced": - return Style.MONOSPACED; + return Style.MONOSPACED; case "stroke": return Style.STROKE; diff --git a/libvaladoc/documentation/documentationparser.vala b/libvaladoc/documentation/documentationparser.vala index 4a9c0c9bd..b6c28d075 100644 --- a/libvaladoc/documentation/documentationparser.vala +++ b/libvaladoc/documentation/documentationparser.vala @@ -71,7 +71,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { private CommentScanner _comment_scanner; private Parser _wiki_parser; private Parser _comment_parser; - + private Parser _parser; private Scanner _scanner; @@ -331,7 +331,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { Rule.many ({ TokenType.SPACE }) }); - Rule optional_spaces = + Rule optional_spaces = Rule.option ({ Rule.many ({ TokenType.SPACE.action (add_content_space) @@ -415,7 +415,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { //TODO: Find a nicer way to allow empty tags (''run?'' won't work) Rule bold = Rule.seq ({ - TokenType.SINGLE_QUOTE_2, + TokenType.SINGLE_QUOTE_2, Rule.one_of ({ TokenType.SINGLE_QUOTE_2, Rule.seq ({ optional_spaces, run, TokenType.SINGLE_QUOTE_2 }) @@ -859,7 +859,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { Rule? taglet_rule; if (taglet is BlockContent) { - taglet_rule = taglet.get_parser_rule (multiline_block_run); + taglet_rule = taglet.get_parser_rule (multiline_block_run); } else { taglet_rule = taglet.get_parser_rule (multiline_run); } diff --git a/libvaladoc/documentation/gtkdoccommentparser.vala b/libvaladoc/documentation/gtkdoccommentparser.vala index ede991ce8..20535b764 100644 --- a/libvaladoc/documentation/gtkdoccommentparser.vala +++ b/libvaladoc/documentation/gtkdoccommentparser.vala @@ -515,7 +515,7 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { next (); ListItem item = factory.create_list_item (); - + item.content.add_all (parse_mixed_content ()); if (!check_xml_close_tag ("listitem")) { @@ -1307,7 +1307,7 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { } parse_docbook_spaces (); - ListItem? desc = parse_docbook_listitem (); + ListItem? desc = parse_docbook_listitem (); if (desc == null) { return null; } diff --git a/libvaladoc/documentation/gtkdoccommentscanner.vala b/libvaladoc/documentation/gtkdoccommentscanner.vala index d81bc9156..d9b638227 100644 --- a/libvaladoc/documentation/gtkdoccommentscanner.vala +++ b/libvaladoc/documentation/gtkdoccommentscanner.vala @@ -213,7 +213,7 @@ public class Valadoc.Gtkdoc.Scanner { builder.append_c ('>'); } } - } + } if (&txt == &start) { return txt; @@ -359,7 +359,7 @@ public class Valadoc.Gtkdoc.Scanner { unowned string start = this.pos; int column_start = this.column; - next_char (); + next_char (); int id_len = 0; @@ -387,12 +387,12 @@ public class Valadoc.Gtkdoc.Scanner { } } else if (this.pos.has_prefix ("->") || this.pos.has_prefix (".")) { unowned string sep_start = this.pos; - int sep_column_start = this.column; + int sep_column_start = this.column; int separator_len = 1; if (this.pos.has_prefix ("->")) { separator_len = 2; - next_char (); + next_char (); } next_char (); @@ -425,11 +425,11 @@ public class Valadoc.Gtkdoc.Scanner { private inline Token? gtkdoc_property_prefix () { if (get () != ':') { return null; - } + } unowned string start = this.pos; int column_start = this.column; - next_char (); + next_char (); int id_len = 0; @@ -452,7 +452,7 @@ public class Valadoc.Gtkdoc.Scanner { private inline Token? gtkdoc_signal_prefix () { if (get () != ':') { return null; - } + } unowned string start = this.pos; int column_start = this.column; @@ -464,7 +464,7 @@ public class Valadoc.Gtkdoc.Scanner { start = this.pos; - next_char (); + next_char (); int id_len = 0; diff --git a/libvaladoc/documentation/gtkdocmarkdownparser.vala b/libvaladoc/documentation/gtkdocmarkdownparser.vala index 206abb7f3..ee95c4ea0 100644 --- a/libvaladoc/documentation/gtkdocmarkdownparser.vala +++ b/libvaladoc/documentation/gtkdocmarkdownparser.vala @@ -77,7 +77,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator { Valadoc.TokenType.MARKDOWN_PARAMETER.action ((token) => { Run _run = null; - if (token.value == gir_comment.instance_param_name) { + if (token.value == gir_comment.instance_param_name) { _run = _factory.create_run (Run.Style.LANG_KEYWORD); _run.content.add (_factory.create_text ("this")); } else if (is_error_parameter (token.value)) { @@ -434,7 +434,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator { .set_start (() => { var siblings = ((BlockContent) peek ()).content; if (siblings.size > 0 && siblings.last () is Content.List) { - push (siblings.last ()); + push (siblings.last ()); } else { Content.List list = _factory.create_list (); list.bullet = Content.List.Bullet.UNORDERED; @@ -463,7 +463,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator { .set_start (() => { var siblings = ((BlockContent) peek ()).content; if (siblings.size > 0 && siblings.last () is Content.List) { - push (siblings.last ()); + push (siblings.last ()); } else { Content.List list = _factory.create_list (); list.bullet = Content.List.Bullet.ORDERED_NUMBER; @@ -529,7 +529,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator { .set_start (() => { push (_factory.create_headline ()); }) .set_reduce (() => { Headline h = (Headline) pop (); - ((BlockContent) peek ()).content.add (h); + ((BlockContent) peek ()).content.add (h); }) .set_name ("Headline"); diff --git a/libvaladoc/documentation/gtkdocmarkdownscanner.vala b/libvaladoc/documentation/gtkdocmarkdownscanner.vala index 6df58d07d..e7afe18b4 100644 --- a/libvaladoc/documentation/gtkdocmarkdownscanner.vala +++ b/libvaladoc/documentation/gtkdocmarkdownscanner.vala @@ -90,7 +90,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { _skip = 0; _current_string.erase (0, -1); contains_at = false; - + states.clear (); push_state (State.NORMAL); } @@ -112,7 +112,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { while (!_stop && _index.get_char () != 0) { unichar c = _index.get_char (); accept (c); - + _index = _index.next_char (); } @@ -120,7 +120,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { // Close open blocks: while (peek_state () != State.NORMAL) { if (peek_state () == State.BLOCK) { - emit_token (Valadoc.TokenType.MARKDOWN_BLOCK_END); + emit_token (Valadoc.TokenType.MARKDOWN_BLOCK_END); pop_state (); } else { close_block (); @@ -140,7 +140,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { // In headline: string? hash = null; - + if (headline_end != null && is_headline_end (ref _index, headline_end, out hash)) { if (hash != null) { emit_token (Valadoc.TokenType.MARKDOWN_HEADLINE_HASH, hash); @@ -275,7 +275,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { _iter = _iter.offset (1); _skip++; } - + if (_iter[0].tolower () == 'f' || _iter[0].tolower () == 'l') { _iter = _iter.offset (1); _skip++; @@ -540,7 +540,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { headline_end = "#"; } else { emit_token (Valadoc.TokenType.MARKDOWN_HEADLINE_2); - _iter = _iter.offset (2); + _iter = _iter.offset (2); headline_end = "##"; } @@ -599,7 +599,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { unowned string id_start = _iter; int hash_len = 0; - + while (_iter[0] != '}' && _iter[0] != '\n' && _iter[0] != '\0') { _iter = _iter.offset (1); hash_len++; diff --git a/libvaladoc/filehelper.vala b/libvaladoc/filehelper.vala index c9ff9c137..46823bb04 100644 --- a/libvaladoc/filehelper.vala +++ b/libvaladoc/filehelper.vala @@ -26,7 +26,7 @@ namespace Valadoc { public extern const string icons_dir; /** - * Makes a copy of the file src to dest. + * Makes a copy of the file src to dest. * * @param src the file to copy * @param dest the destination path @@ -50,7 +50,7 @@ namespace Valadoc { } /** - * Makes a copy of the directory src to dest. + * Makes a copy of the directory src to dest. * * @param src the directory to copy * @param dest the destination path diff --git a/libvaladoc/gtkdocrenderer.vala b/libvaladoc/gtkdocrenderer.vala index 45211ff1d..6ffc80141 100644 --- a/libvaladoc/gtkdocrenderer.vala +++ b/libvaladoc/gtkdocrenderer.vala @@ -245,7 +245,7 @@ public class Valadoc.GtkdocRenderer : ContentRenderer { } element.accept_children (this); - + writer.end_tag (tag); } diff --git a/libvaladoc/highlighter/xmlscanner.vala b/libvaladoc/highlighter/xmlscanner.vala index 38b87c5ee..8c048b9b4 100644 --- a/libvaladoc/highlighter/xmlscanner.vala +++ b/libvaladoc/highlighter/xmlscanner.vala @@ -270,7 +270,7 @@ public class Valadoc.Highlighter.XmlScanner : Object, Scanner { pos = pos.offset (1); skipped = true; } - + return skipped; } @@ -306,7 +306,7 @@ public class Valadoc.Highlighter.XmlScanner : Object, Scanner { if (pos.has_prefix ("