mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-15 15:11:32 +00:00
Mark unsigned constants in AST dumps.
- Add the u suffix to unsigned integer constants printed in AST dumps.
This commit is contained in:
parent
1b4851224e
commit
52d5e74e7e
1 changed files with 12 additions and 4 deletions
|
@ -140,10 +140,18 @@ public:
|
||||||
{
|
{
|
||||||
Add(&c, 1);
|
Add(&c, 1);
|
||||||
}
|
}
|
||||||
void AddInt(int i)
|
void AddInt(int i, bool un=false)
|
||||||
{
|
{
|
||||||
char buf[16];
|
char buf[16];
|
||||||
size_t len = mysnprintf(buf, countof(buf), "%d", i);
|
size_t len;
|
||||||
|
if (!un)
|
||||||
|
{
|
||||||
|
len = mysnprintf(buf, countof(buf), "%d", i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
len = mysnprintf(buf, countof(buf), "%uu", i);
|
||||||
|
}
|
||||||
Add(buf, len);
|
Add(buf, len);
|
||||||
}
|
}
|
||||||
void AddHex(unsigned x)
|
void AddHex(unsigned x)
|
||||||
|
@ -528,9 +536,9 @@ static void PrintExprConstant(FLispString &out, ZCC_TreeNode *node)
|
||||||
{
|
{
|
||||||
out.AddFloat(enode->DoubleVal);
|
out.AddFloat(enode->DoubleVal);
|
||||||
}
|
}
|
||||||
else
|
else if (enode->Type->IsKindOf(RUNTIME_CLASS(PInt)))
|
||||||
{
|
{
|
||||||
out.AddInt(enode->IntVal);
|
out.AddInt(enode->IntVal, static_cast<PInt *>(enode->Type)->Unsigned);
|
||||||
}
|
}
|
||||||
out.Close();
|
out.Close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue