Mercurial > projects > ddmd
diff dmd/IsExp.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | adf6f7f216ea |
children | 3a0b150c9841 ceda59b4d255 |
line wrap: on
line diff
--- a/dmd/IsExp.d Sat Aug 28 16:14:07 2010 +0200 +++ b/dmd/IsExp.d Sat Aug 28 16:19:48 2010 +0200 @@ -1,13 +1,13 @@ -module dmd.IsExp; - -import dmd.Expression; -import dmd.Identifier; -import dmd.ArrayTypes; -import dmd.Type; -import dmd.TOK; -import dmd.OutBuffer; -import dmd.Loc; -import dmd.Scope; +module dmd.IsExp; + +import dmd.Expression; +import dmd.Identifier; +import dmd.ArrayTypes; +import dmd.Type; +import dmd.TOK; +import dmd.OutBuffer; +import dmd.Loc; +import dmd.Scope; import dmd.HdrGenState; import dmd.TY; import dmd.TypeEnum; @@ -27,9 +27,9 @@ import dmd.TypeFunction; import dmd.MATCH; import dmd.TypePointer; -import dmd.Argument; -import dmd.Token; - +import dmd.Argument; +import dmd.Token; + class IsExp : Expression { /* is(targ id tok tspec) @@ -54,31 +54,31 @@ this.parameters = parameters; } - Expression syntaxCopy() + override Expression syntaxCopy() { - // This section is identical to that in TemplateDeclaration.syntaxCopy() - TemplateParameters p = null; - if (parameters) - { - p = new TemplateParameters(); - p.setDim(parameters.dim); - for (int i = 0; i < p.dim; i++) - { - TemplateParameter tp = cast(TemplateParameter)parameters.data[i]; - p.data[i] = cast(void*)tp.syntaxCopy(); - } - } - - return new IsExp(loc, - targ.syntaxCopy(), - id, - tok, - tspec ? tspec.syntaxCopy() : null, - tok2, + // This section is identical to that in TemplateDeclaration.syntaxCopy() + TemplateParameters p = null; + if (parameters) + { + p = new TemplateParameters(); + p.setDim(parameters.dim); + for (int i = 0; i < p.dim; i++) + { + TemplateParameter tp = cast(TemplateParameter)parameters.data[i]; + p.data[i] = cast(void*)tp.syntaxCopy(); + } + } + + return new IsExp(loc, + targ.syntaxCopy(), + id, + tok, + tspec ? tspec.syntaxCopy() : null, + tok2, p); } - Expression semantic(Scope sc) + override Expression semantic(Scope sc) { Type tded; @@ -335,34 +335,34 @@ return new IntegerExp(loc, 0, Type.tbool); } - void toCBuffer(OutBuffer buf, HdrGenState* hgs) + override void toCBuffer(OutBuffer buf, HdrGenState* hgs) { - buf.writestring("is("); - targ.toCBuffer(buf, id, hgs); - if (tok2 != TOKreserved) - { - buf.printf(" %s %s", Token.toChars(tok), Token.toChars(tok2)); - } - else if (tspec) - { - if (tok == TOKcolon) - buf.writestring(" : "); - else - buf.writestring(" == "); - tspec.toCBuffer(buf, null, hgs); - } -version (DMDV2) { - if (parameters) - { - // First parameter is already output, so start with second - for (int i = 1; i < parameters.dim; i++) - { - buf.writeByte(','); - TemplateParameter tp = cast(TemplateParameter)parameters.data[i]; - tp.toCBuffer(buf, hgs); - } - } -} + buf.writestring("is("); + targ.toCBuffer(buf, id, hgs); + if (tok2 != TOKreserved) + { + buf.printf(" %s %s", Token.toChars(tok), Token.toChars(tok2)); + } + else if (tspec) + { + if (tok == TOKcolon) + buf.writestring(" : "); + else + buf.writestring(" == "); + tspec.toCBuffer(buf, null, hgs); + } +version (DMDV2) { + if (parameters) + { + // First parameter is already output, so start with second + for (int i = 1; i < parameters.dim; i++) + { + buf.writeByte(','); + TemplateParameter tp = cast(TemplateParameter)parameters.data[i]; + tp.toCBuffer(buf, hgs); + } + } +} buf.writeByte(')'); } }