Mercurial > projects > ldc
diff dmd/mtype.c @ 1626:8fa4ab3dcc88
Merge DMD r320: refactor
---
dmd/expression.c | 7 +++----
dmd/expression.h | 2 +-
dmd/mtype.c | 34 ++++++++--------------------------
3 files changed, 12 insertions(+), 31 deletions(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:23 -0300 |
parents | 1d48eced441f |
children | e83f0778c260 |
line wrap: on
line diff
--- a/dmd/mtype.c Wed Jan 06 15:18:22 2010 -0300 +++ b/dmd/mtype.c Wed Jan 06 15:18:23 2010 -0300 @@ -2239,10 +2239,7 @@ #if LOGDEFAULTINIT printf("TypeDArray::defaultInit() '%s'\n", toChars()); #endif - Expression *e; - e = new NullExp(loc); - e->type = this; - return e; + return new NullExp(loc, this); } int TypeDArray::isZeroInit(Loc loc) @@ -2512,10 +2509,7 @@ #if LOGDEFAULTINIT printf("TypeAArray::defaultInit() '%s'\n", toChars()); #endif - Expression *e; - e = new NullExp(loc); - e->type = this; - return e; + return new NullExp(loc, this); } int TypeAArray::isZeroInit(Loc loc) @@ -2628,10 +2622,7 @@ #if LOGDEFAULTINIT printf("TypePointer::defaultInit() '%s'\n", toChars()); #endif - Expression *e; - e = new NullExp(loc); - e->type = this; - return e; + return new NullExp(loc, this); } int TypePointer::isZeroInit(Loc loc) @@ -2695,9 +2686,7 @@ #if LOGDEFAULTINIT printf("TypeReference::defaultInit() '%s'\n", toChars()); #endif - Expression *e = new NullExp(loc); - e->type = this; - return e; + return new NullExp(loc, this); } int TypeReference::isZeroInit(Loc loc) @@ -3288,10 +3277,7 @@ #if LOGDEFAULTINIT printf("TypeDelegate::defaultInit() '%s'\n", toChars()); #endif - Expression *e; - e = new NullExp(loc); - e->type = this; - return e; + return new NullExp(loc, this); } int TypeDelegate::isZeroInit(Loc loc) @@ -4711,12 +4697,11 @@ } Expression *TypeStruct::defaultInit(Loc loc) -{ Declaration *d; - +{ #if LOGDEFAULTINIT printf("TypeStruct::defaultInit() '%s'\n", toChars()); #endif - d = new StaticStructInitDeclaration(sym->loc, sym); + Declaration *d = new StaticStructInitDeclaration(sym->loc, sym); assert(d); d->type = this; return new VarExp(sym->loc, d); @@ -5180,10 +5165,7 @@ #if LOGDEFAULTINIT printf("TypeClass::defaultInit() '%s'\n", toChars()); #endif - Expression *e; - e = new NullExp(loc); - e->type = this; - return e; + return new NullExp(loc, this); } int TypeClass::isZeroInit(Loc loc)