changeset 85:8e69d041a99d

Previous commit didn't compile. Fixed.
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Mon, 30 Aug 2010 16:16:30 +0100
parents be2ab491772e
children 50ebb404ddd9
files dmd/Cast.d dmd/StructDeclaration.d dmd/StructLiteralExp.d dmd/TypeStruct.d
diffstat 4 files changed, 9 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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;
--- 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())
--- 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