# HG changeset patch # User Eldar Insafutdinov # Date 1283181390 -3600 # Node ID 8e69d041a99d25b090582c737c6cd5f3669d49a5 # Parent be2ab491772ed4193e6b0b95deabfb0b8927f8cb Previous commit didn't compile. Fixed. diff -r be2ab491772e -r 8e69d041a99d dmd/Cast.d --- a/dmd/Cast.d Mon Aug 30 16:12:19 2010 +0100 +++ b/dmd/Cast.d Mon Aug 30 16:16:30 2010 +0100 @@ -119,9 +119,8 @@ StructDeclaration sd = tb.toDsymbol(null).isStructDeclaration(); assert(sd); Expressions elements = new Expressions; - foreach (Dsymbol s; sd.fields) + foreach (VarDeclaration v; sd.fields) { - VarDeclaration v = s.isVarDeclaration(); assert(v); Expression exp = new IntegerExp(0); diff -r be2ab491772e -r 8e69d041a99d dmd/StructDeclaration.d --- a/dmd/StructDeclaration.d Mon Aug 30 16:12:19 2010 +0100 +++ b/dmd/StructDeclaration.d Mon Aug 30 16:16:30 2010 +0100 @@ -322,9 +322,8 @@ // Determine if struct is all zeros or not zeroInit = true; - foreach (Dsymbol s; fields) + foreach (VarDeclaration vd; fields) { - VarDeclaration vd = s.isVarDeclaration(); if (vd && !vd.isDataseg()) { if (vd.init) @@ -395,9 +394,8 @@ /* If any of the fields need an opAssign, then we * need it too. */ - foreach (Dsymbol s; fields) + foreach (VarDeclaration v; fields) { - VarDeclaration v = s.isVarDeclaration(); assert(v && v.storage_class & STC.STCfield); if (v.storage_class & STC.STCref) continue; @@ -498,9 +496,8 @@ { /* Do memberwise copy */ //printf("\tmemberwise copy\n"); - foreach (Dsymbol s; fields) + foreach (VarDeclaration v; fields) { - VarDeclaration v = s.isVarDeclaration(); assert(v && v.storage_class & STC.STCfield); // this.v = s.v; AssignExp ec = new AssignExp(Loc(0), new DotVarExp(Loc(0), new ThisExp(Loc(0)), v, 0), new DotVarExp(Loc(0), new IdentifierExp(Loc(0), Id.p), v, 0)); @@ -548,9 +545,8 @@ //printf("StructDeclaration.buildPostBlit() %s\n", toChars()); Expression e = null; - foreach (Dsymbol s; fields) + foreach (VarDeclaration v; fields) { - VarDeclaration v = s.isVarDeclaration(); assert(v && v.storage_class & STC.STCfield); if (v.storage_class & STC.STCref) continue; diff -r be2ab491772e -r 8e69d041a99d dmd/StructLiteralExp.d --- a/dmd/StructLiteralExp.d Mon Aug 30 16:12:19 2010 +0100 +++ b/dmd/StructLiteralExp.d Mon Aug 30 16:16:30 2010 +0100 @@ -180,7 +180,7 @@ Expressions z = new Expressions; z.setDim(length); for (int q = 0; q < length; ++q) - z.data[q] = cast(void*) e.copy(); + z.data[q] = e.copy(); e = new ArrayLiteralExp(loc, z); e.type = type; } @@ -200,9 +200,8 @@ */ if (elements.dim) { - foreach (size_t i, Dsymbol s; sd.fields) + foreach (size_t i, VarDeclaration v; sd.fields) { - VarDeclaration v = s.isVarDeclaration(); assert(v); if (offset == v.offset && type.size() == v.type.size()) diff -r be2ab491772e -r 8e69d041a99d dmd/TypeStruct.d --- a/dmd/TypeStruct.d Mon Aug 30 16:12:19 2010 +0100 +++ b/dmd/TypeStruct.d Mon Aug 30 16:16:30 2010 +0100 @@ -516,7 +516,7 @@ StructDeclaration s = sym; sym.size(Loc(0)); // give error for forward references - foreach (Dsymbol sm; s.fields) + foreach (VarDeclaration sm; s.fields) { Declaration d = sm.isDeclaration(); if (d.storage_class & STC.STCref || d.hasPointers()) @@ -542,9 +542,8 @@ { /* Check all the fields. If they can all be converted, * allow the conversion. */ - foreach (Dsymbol s; sym.fields) + foreach (VarDeclaration v; sym.fields) { - VarDeclaration v = s.isVarDeclaration(); assert(v && v.storage_class & STCfield); // 'from' type