mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
This should fix integers below 64 bit on big-endian systems.
This commit is contained in:
@@ -118,22 +118,14 @@ const char *Token::toChars()
|
||||
switch (value)
|
||||
{
|
||||
case TOKint32v:
|
||||
#if IN_GCC
|
||||
sprintf(buffer,"%d",(d_int32)int64value);
|
||||
#else
|
||||
sprintf(buffer,"%d",int32value);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case TOKuns32v:
|
||||
case TOKcharv:
|
||||
case TOKwcharv:
|
||||
case TOKdcharv:
|
||||
#if IN_GCC
|
||||
sprintf(buffer,"%uU",(d_uns32)uns64value);
|
||||
#else
|
||||
sprintf(buffer,"%uU",uns32value);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case TOKint64v:
|
||||
|
||||
@@ -217,8 +217,6 @@ struct Token
|
||||
union
|
||||
{
|
||||
// Integers
|
||||
d_int32 int32value;
|
||||
d_uns32 uns32value;
|
||||
d_int64 int64value;
|
||||
d_uns64 uns64value;
|
||||
|
||||
|
||||
10
dmd/parse.c
10
dmd/parse.c
@@ -3985,12 +3985,12 @@ Expression *Parser::parsePrimaryExp()
|
||||
break;
|
||||
|
||||
case TOKint32v:
|
||||
e = new IntegerExp(loc, token.int32value, Type::tint32);
|
||||
e = new IntegerExp(loc, (d_int32)token.int64value, Type::tint32);
|
||||
nextToken();
|
||||
break;
|
||||
|
||||
case TOKuns32v:
|
||||
e = new IntegerExp(loc, token.uns32value, Type::tuns32);
|
||||
e = new IntegerExp(loc, (d_uns32)token.uns64value, Type::tuns32);
|
||||
nextToken();
|
||||
break;
|
||||
|
||||
@@ -4064,17 +4064,17 @@ Expression *Parser::parsePrimaryExp()
|
||||
break;
|
||||
|
||||
case TOKcharv:
|
||||
e = new IntegerExp(loc, token.uns32value, Type::tchar);
|
||||
e = new IntegerExp(loc, (d_uns8)token.uns64value, Type::tchar);
|
||||
nextToken();
|
||||
break;
|
||||
|
||||
case TOKwcharv:
|
||||
e = new IntegerExp(loc, token.uns32value, Type::twchar);
|
||||
e = new IntegerExp(loc, (d_uns16)token.uns64value, Type::twchar);
|
||||
nextToken();
|
||||
break;
|
||||
|
||||
case TOKdcharv:
|
||||
e = new IntegerExp(loc, token.uns32value, Type::tdchar);
|
||||
e = new IntegerExp(loc, (d_uns32)token.uns64value, Type::tdchar);
|
||||
nextToken();
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user