Mercurial > projects > ddmd
diff dmd/TypeStruct.d @ 79:43073c7c7769
updated to 2.035
also implemented a few missing functions
still crashes in Import.importAll though
author | Trass3r |
---|---|
date | Mon, 30 Aug 2010 03:57:51 +0200 |
parents | ef02e2e203c2 |
children | be2ab491772e |
line wrap: on
line diff
--- a/dmd/TypeStruct.d Sun Aug 29 14:39:08 2010 +0100 +++ b/dmd/TypeStruct.d Mon Aug 30 03:57:51 2010 +0200 @@ -185,7 +185,7 @@ exps.reserve(sym.fields.dim); for (size_t i = 0; i < sym.fields.dim; i++) { - VarDeclaration v2 = cast(VarDeclaration)sym.fields.data[i]; + VarDeclaration v2 = cast(VarDeclaration)sym.fields[i]; Expression fe = new DotVarExp(e.loc, e, v2); exps.push(cast(void*)fe); } @@ -435,7 +435,7 @@ */ for (size_t i = 0; i < sym.fields.dim; i++) { - VarDeclaration v = cast(VarDeclaration)sym.fields.data[i]; + VarDeclaration v = cast(VarDeclaration)sym.fields[i]; if (v.isConst() || v.isInvariant()) return false; } @@ -516,9 +516,8 @@ StructDeclaration s = sym; sym.size(Loc(0)); // give error for forward references - for (size_t i = 0; i < s.fields.dim; i++) + foreach (Dsymbol sm; s.fields) { - Dsymbol sm = cast(Dsymbol)s.fields.data[i]; Declaration d = sm.isDeclaration(); if (d.storage_class & STC.STCref || d.hasPointers()) return true; @@ -543,9 +542,8 @@ { /* Check all the fields. If they can all be converted, * allow the conversion. */ - for (int i = 0; i < sym.fields.dim; i++) + foreach (Dsymbol s; sym.fields) { - Dsymbol s = cast(Dsymbol)sym.fields.data[i]; VarDeclaration v = s.isVarDeclaration(); assert(v && v.storage_class & STCfield); @@ -633,7 +631,7 @@ if (global.params.symdebug) { for (int i = 0; i < sym.fields.dim; i++) { - VarDeclaration v = cast(VarDeclaration)sym.fields.data[i]; + VarDeclaration v = cast(VarDeclaration)sym.fields[i]; Symbol* s2 = symbol_name(toStringz(v.ident.toChars()), SC.SCmember, v.type.toCtype()); s2.Smemoff = v.offset;