Mercurial > projects > ddmd
diff dmd/StructDeclaration.d @ 88:23280d154c5b
Merge
author | korDen |
---|---|
date | Mon, 30 Aug 2010 19:58:14 +0400 |
parents | b17640f0e4e8 8e69d041a99d |
children | 37b95c347975 |
line wrap: on
line diff
--- a/dmd/StructDeclaration.d Mon Aug 30 19:56:27 2010 +0400 +++ b/dmd/StructDeclaration.d Mon Aug 30 19:58:14 2010 +0400 @@ -263,8 +263,8 @@ FuncDeclaration fdptr = new FuncDeclaration(loc, loc, fdx.ident, STC.STCundefined, tfeqptr); Expression e = new IdentifierExp(loc, Id.p); e = new PtrExp(loc, e); - Expressions args = new Expressions(); - args.push(cast(void*)e); + auto args = new Expressions(); + args.push(e); e = new IdentifierExp(loc, id); e = new CallExp(loc, e, args); fdptr.fbody = new ReturnStatement(loc, e); @@ -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;