diff dmd/FuncDeclaration.d @ 126:1765f3ef917d

ClassDeclarations, Arguments -> Vector
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Fri, 03 Sep 2010 23:25:55 +0100
parents c77e9f4f1793
children 60bb0fe4563e
line wrap: on
line diff
--- a/dmd/FuncDeclaration.d	Fri Sep 03 22:17:54 2010 +0100
+++ b/dmd/FuncDeclaration.d	Fri Sep 03 23:25:55 2010 +0100
@@ -822,7 +822,7 @@
 				if (outId)
 				{	
 					a = new Argument(STCref, f.nextOf(), outId, null);
-					arguments.push(cast(void*)a);
+					arguments.push(a);
 				}
 				TypeFunction tf = new TypeFunction(arguments, Type.tvoid, 0, LINKd);
 				FuncDeclaration fd = new FuncDeclaration(loc, loc, Id.ensure, STCundefined, tf);
@@ -1055,12 +1055,11 @@
 		// Propagate storage class from tuple parameters to their element-parameters.
 		if (f.parameters)
 		{
-			for (size_t i = 0; i < f.parameters.dim; i++)
-			{	Argument arg = cast(Argument)f.parameters.data[i];
-
+			foreach (arg; f.parameters)
+			{
 			//printf("[%d] arg.type.ty = %d %s\n", i, arg.type.ty, arg.type.toChars());
 			if (arg.type.ty == TY.Ttuple)
-			{   TypeTuple t = cast(TypeTuple)arg.type;
+			{   auto t = cast(TypeTuple)arg.type;
 				size_t dim = Argument.dim(t.arguments);
 				for (size_t j = 0; j < dim; j++)
 				{	Argument narg = Argument.getNth(t.arguments, j);
@@ -1114,13 +1113,12 @@
 		// but not in parameters[].
 		if (f.parameters)
 		{
-			for (size_t i = 0; i < f.parameters.dim; i++)
-			{	Argument arg = cast(Argument)f.parameters.data[i];
-
+			foreach (arg; f.parameters)
+			{
 			if (!arg.ident)
 				continue;			// never used, so ignore
 			if (arg.type.ty == TY.Ttuple)
-			{   TypeTuple t = cast(TypeTuple)arg.type;
+			{   auto t = cast(TypeTuple)arg.type;
 				size_t dim = Argument.dim(t.arguments);
 				Objects exps = new Objects();
 				exps.setDim(dim);