mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-02 18:43:14 +01:00
[svn r39] * Updated to DMD 1.022 with the exception of:
Bugzilla 278: dmd.conf search path doesn't work This fix was causing crashes for me :/ So for it's the old behaviour
This commit is contained in:
@@ -2354,26 +2354,36 @@ int StringExp::isBool(int result)
|
||||
return result ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
unsigned StringExp::charAt(size_t i)
|
||||
{ unsigned value;
|
||||
|
||||
switch (sz)
|
||||
{
|
||||
case 1:
|
||||
value = ((unsigned char *)string)[i];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
value = ((unsigned short *)string)[i];
|
||||
break;
|
||||
|
||||
case 4:
|
||||
value = ((unsigned int *)string)[i];
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
void StringExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
||||
{
|
||||
buf->writeByte('"');
|
||||
for (size_t i = 0; i < len; i++)
|
||||
{ unsigned c;
|
||||
{ unsigned c = charAt(i);
|
||||
|
||||
switch (sz)
|
||||
{
|
||||
case 1:
|
||||
c = ((unsigned char *)string)[i];
|
||||
break;
|
||||
case 2:
|
||||
c = ((unsigned short *)string)[i];
|
||||
break;
|
||||
case 4:
|
||||
c = ((unsigned *)string)[i];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
switch (c)
|
||||
{
|
||||
case '"':
|
||||
@@ -4933,7 +4943,7 @@ Expression *DotVarExp::semantic(Scope *sc)
|
||||
{
|
||||
AggregateDeclaration *ad = var->toParent()->isAggregateDeclaration();
|
||||
L1:
|
||||
Type *t = e1->type;
|
||||
Type *t = e1->type->toBasetype();
|
||||
|
||||
if (ad &&
|
||||
!(t->ty == Tpointer && t->next->ty == Tstruct &&
|
||||
@@ -5467,6 +5477,7 @@ Lagain:
|
||||
*/
|
||||
Expression *e = new StructLiteralExp(loc, (StructDeclaration *)ad, arguments);
|
||||
e = e->semantic(sc);
|
||||
e->type = e1->type; // in case e1->type was a typedef
|
||||
return e;
|
||||
}
|
||||
else if (t1->ty == Tclass)
|
||||
@@ -6087,8 +6098,11 @@ Expression *DeleteExp::semantic(Scope *sc)
|
||||
{ TypeClass *tc = (TypeClass *)tb;
|
||||
ClassDeclaration *cd = tc->sym;
|
||||
|
||||
if (cd->isInterfaceDeclaration() && cd->isCOMclass())
|
||||
if (cd->isCOMinterface())
|
||||
{ /* Because COM classes are deleted by IUnknown.Release()
|
||||
*/
|
||||
error("cannot delete instance of COM interface %s", cd->toChars());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Tpointer:
|
||||
|
||||
Reference in New Issue
Block a user