Apply [1120] to D2 as well (untested).

This commit is contained in:
Frits van Bommel 2009-03-15 16:57:44 +01:00
parent bc9fae17a8
commit d6bb243ff5

View file

@ -1319,11 +1319,17 @@ integer_t IntegerExp::toInteger()
case Twchar:
case Tuns16: value = (d_uns16) value; break;
case Tint32: value = (d_int32) value; break;
case Tpointer:
case Tdchar:
case Tuns32: value = (d_uns32) value; break;
case Tint64: value = (d_int64) value; break;
case Tuns64: value = (d_uns64) value; break;
case Tpointer:
// FIXME: Other pointer widths than 32 and 64?
if (PTRSIZE == 4)
value = (d_uns32) value;
else
value = (d_uns64) value;
break;
case Tenum:
{
@ -1483,6 +1489,7 @@ void IntegerExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
break;
case Tuns64:
L4:
buf->printf("%lluLU", v);
break;
@ -1495,7 +1502,11 @@ void IntegerExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
buf->writestring("cast(");
buf->writestring(t->toChars());
buf->writeByte(')');
goto L3;
// FIXME: Other pointer widths than 32 and 64?
if (PTRSIZE == 4)
goto L3;
else
goto L4;
default:
/* This can happen if errors, such as