mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 11:56:12 +03:00
Apply [1120] to D2 as well (untested).
This commit is contained in:
parent
bc9fae17a8
commit
d6bb243ff5
1 changed files with 13 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue