mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-29 11:03:17 +01:00
Apply [1120] to D2 as well (untested).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user