diff dmd/TemplateInstance.d @ 113:3482c73a991b

More cleanup for arrays
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Tue, 31 Aug 2010 23:57:32 +0100
parents 12c0c84d13fd
children e28b18c23469
line wrap: on
line diff
--- a/dmd/TemplateInstance.d	Wed Sep 01 00:14:27 2010 +0200
+++ b/dmd/TemplateInstance.d	Tue Aug 31 23:57:32 2010 +0100
@@ -144,7 +144,7 @@
 
 		for (size_t i = 0; i < v1.objects.dim; i++)
 		{
-			if (!match(cast(Object)v1.objects.data[i], cast(Object)v2.objects.data[i], tempdecl, sc))
+			if (!match(v1.objects[i], v2.objects[i], tempdecl, sc))
 				goto Lnomatch;
 		}
     }
@@ -356,8 +356,8 @@
 		}
 			for (size_t j = 0; j < tdtypes.dim; j++)
 			{   
-				Object o1 = cast(Object)tdtypes.data[j];
-				Object o2 = cast(Object)ti.tdtypes.data[j];
+				Object o1 = tdtypes[j];
+				Object o2 = ti.tdtypes[j];
 				if (!match(o1, o2, tempdecl, sc))
 				{
 					goto L1;
@@ -708,7 +708,7 @@
 			{
 				if (i)
 					buf.writeByte(',');
-				Object oarg = cast(Object)args.data[i];
+				Object oarg = args[i];
 				ObjectToCBuffer(buf, hgs, oarg);
 			}
 			nest--;
@@ -825,7 +825,7 @@
 			return;
 		for (size_t j = 0; j < tiargs.dim; j++)
 		{
-			Object o = cast(Object)tiargs.data[j];
+			Object o = tiargs[j];
 			Type ta = isType(o);
 			Expression ea = isExpression(o);
 			Dsymbol sa = isDsymbol(o);
@@ -1153,7 +1153,7 @@
 			td_best = td;
 			m_best = m;
 			tdtypes.setDim(dedtypes.dim);
-			memcpy(tdtypes.data, dedtypes.data, tdtypes.dim * (void*).sizeof);
+			memcpy(tdtypes.ptr, dedtypes.ptr, tdtypes.dim * (void*).sizeof);
 			continue;
 		}
 
@@ -1214,7 +1214,7 @@
 		{
 			TemplateParameter tp = cast(TemplateParameter)tempdecl.parameters.data[i];
 			//Object o = cast(Object)tiargs.data[i];
-			Object o = cast(Object)tdtypes.data[i];		// initializer for tp
+			Object o = tdtypes[i];		// initializer for tp
 
 			//printf("\ttdtypes[%d] = %p\n", i, o);
 			tempdecl.declareParameter(sc, tp, o);
@@ -1235,7 +1235,7 @@
 		 */
 		for (size_t i = 0; i < args.dim; i++)
 		{   
-			Object o = cast(Object)args.data[i];
+			Object o = args[i];
 			Expression ea = isExpression(o);
 			Dsymbol sa = isDsymbol(o);
 			Tuple va = isTuple(o);
@@ -1325,7 +1325,7 @@
 		Objects args = tiargs;
 		for (int i = 0; i < args.dim; i++)
 		{   
-			Object o = cast(Object)args.data[i];
+			Object o = args[i];
 			Type ta = isType(o);
 			Expression ea = isExpression(o);
 			Dsymbol sa = isDsymbol(o);