Mercurial > projects > ddmd
diff dmd/TemplateDeclaration.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/TemplateDeclaration.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TemplateDeclaration.d Tue Aug 31 23:57:32 2010 +0100 @@ -87,7 +87,7 @@ { if (i) buf.writeByte(','); - Object o = cast(Object)args.data[i]; + Object o = args[i]; ObjectToCBuffer(buf, hgs, o); } } @@ -537,10 +537,10 @@ */ for (int i = 0; i < dedtypes_dim; i++) { - if (!dedtypes.data[i]) + if (!dedtypes[i]) { assert(i < ti.tiargs.dim); - dedtypes.data[i] = ti.tiargs.data[i]; + dedtypes[i] = ti.tiargs[i]; } } } @@ -766,12 +766,12 @@ else n = nargsi; - memcpy(dedargs.data, targsi.data, n * (*dedargs.data).sizeof); + memcpy(dedargs.ptr, targsi.ptr, n * (*dedargs.ptr).sizeof); for (size_t i = 0; i < n; i++) { assert(i < parameters.dim); - TemplateParameter tp2 = cast(TemplateParameter)parameters.data[i]; + auto tp2 = cast(TemplateParameter)parameters.data[i]; MATCH m; Declaration sparam = null; @@ -1059,13 +1059,13 @@ */ for (size_t i = nargsi; i < dedargs.dim; i++) { - TemplateParameter tp2 = cast(TemplateParameter)parameters.data[i]; + auto tp2 = cast(TemplateParameter)parameters.data[i]; //printf("tp2[%d] = %s\n", i, tp2.ident.toChars()); /* For T:T*, the dedargs is the T*, dedtypes is the T * But for function templates, we really need them to match */ - Object oarg = cast(Object)dedargs.data[i]; - Object oded = cast(Object)dedtypes.data[i]; + Object oarg = dedargs[i]; + Object oded = dedtypes[i]; //printf("1dedargs[%d] = %p, dedtypes[%d] = %p\n", i, oarg, i, oded); //if (oarg) printf("oarg: %s\n", oarg.toChars()); //if (oded) printf("oded: %s\n", oded.toChars()); @@ -1233,7 +1233,7 @@ td_best = td; m_best = m; tdargs.setDim(dedargs.dim); - memcpy(tdargs.data, dedargs.data, tdargs.dim * (void*).sizeof); + memcpy(tdargs.ptr, dedargs.ptr, tdargs.dim * (void*).sizeof); continue; } if (!td_best) @@ -1274,7 +1274,7 @@ { if (i) bufa.writeByte(','); - Object oarg = cast(Object)args.data[i]; + Object oarg = args[i]; ObjectToCBuffer(bufa, &hgs, oarg); } }