comparison dmd2/expression.c @ 1121:3d46f7ee466e

Apply [1120] to D2 as well (untested).
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 15 Mar 2009 16:57:44 +0100
parents 39cf8fa483fd
children 638d16625da2
comparison
equal deleted inserted replaced
1120:0d38fa5a0b46 1121:3d46f7ee466e
1317 case Tuns8: value = (d_uns8) value; break; 1317 case Tuns8: value = (d_uns8) value; break;
1318 case Tint16: value = (d_int16) value; break; 1318 case Tint16: value = (d_int16) value; break;
1319 case Twchar: 1319 case Twchar:
1320 case Tuns16: value = (d_uns16) value; break; 1320 case Tuns16: value = (d_uns16) value; break;
1321 case Tint32: value = (d_int32) value; break; 1321 case Tint32: value = (d_int32) value; break;
1322 case Tpointer:
1323 case Tdchar: 1322 case Tdchar:
1324 case Tuns32: value = (d_uns32) value; break; 1323 case Tuns32: value = (d_uns32) value; break;
1325 case Tint64: value = (d_int64) value; break; 1324 case Tint64: value = (d_int64) value; break;
1326 case Tuns64: value = (d_uns64) value; break; 1325 case Tuns64: value = (d_uns64) value; break;
1326 case Tpointer:
1327 // FIXME: Other pointer widths than 32 and 64?
1328 if (PTRSIZE == 4)
1329 value = (d_uns32) value;
1330 else
1331 value = (d_uns64) value;
1332 break;
1327 1333
1328 case Tenum: 1334 case Tenum:
1329 { 1335 {
1330 TypeEnum *te = (TypeEnum *)t; 1336 TypeEnum *te = (TypeEnum *)t;
1331 t = te->sym->memtype; 1337 t = te->sym->memtype;
1481 case Tint64: 1487 case Tint64:
1482 buf->printf("%lldL", v); 1488 buf->printf("%lldL", v);
1483 break; 1489 break;
1484 1490
1485 case Tuns64: 1491 case Tuns64:
1492 L4:
1486 buf->printf("%lluLU", v); 1493 buf->printf("%lluLU", v);
1487 break; 1494 break;
1488 1495
1489 case Tbit: 1496 case Tbit:
1490 case Tbool: 1497 case Tbool:
1493 1500
1494 case Tpointer: 1501 case Tpointer:
1495 buf->writestring("cast("); 1502 buf->writestring("cast(");
1496 buf->writestring(t->toChars()); 1503 buf->writestring(t->toChars());
1497 buf->writeByte(')'); 1504 buf->writeByte(')');
1498 goto L3; 1505 // FIXME: Other pointer widths than 32 and 64?
1506 if (PTRSIZE == 4)
1507 goto L3;
1508 else
1509 goto L4;
1499 1510
1500 default: 1511 default:
1501 /* This can happen if errors, such as 1512 /* This can happen if errors, such as
1502 * the type is painted on like in fromConstInitializer(). 1513 * the type is painted on like in fromConstInitializer().
1503 */ 1514 */