compiler/libec; ide/debugger: 64 bit fixes; ecere/com: Added strtoul() and strtoull()
authorJerome St-Louis <jerome@ecere.com>
Fri, 7 Feb 2014 19:20:12 +0000 (02:20 +0700)
committerJerome St-Louis <jerome@ecere.com>
Fri, 7 Feb 2014 20:14:26 +0000 (03:14 +0700)
compiler/bootstrap/ecere/bootstrap/instance.c
compiler/bootstrap/libec/bootstrap/pass15.c
compiler/libec/src/pass15.ec
documentor/src/Documentor.ec
ecere/src/com/instance.ec
ecere/src/gui/controls/EditBox.ec
ide/src/debugger/debugTools.ec

index a62fcef..7cfc9be 100644 (file)
@@ -5389,6 +5389,8 @@ __ecereNameSpace__ecere__com__eSystem_RegisterFunction("islower", "int islower(i
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("isupper", "int isupper(int c)", isupper, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("isprint", "int isprint(int c)", isprint, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("strtoul", "unsigned long strtoul(const char * nptr, char ** endptr, int base)", strtoul, module, 4);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("strtoll", "int64 strtoll(const char * nptr, char ** endptr, int base)", strtoul, module, 4);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("strtoull", "uint64 strtoull(const char * nptr, char ** endptr, int base)", strtoul, module, 4);
 }
 
 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com____ecere_COM_Initialize(unsigned int guiApp, int argc, char * argv[])
index 539f7db..3fa1191 100644 (file)
@@ -5666,6 +5666,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i + value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui + value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -5786,6 +5816,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i - value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui - value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -5906,6 +5966,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i * value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui * value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -6026,6 +6116,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(value2 ? (op1->i / value2) : 0);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(value2 ? (op1->ui / value2) : 0);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -6146,6 +6266,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(value2 ? (op1->i % value2) : 0);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(value2 ? (op1->ui % value2) : 0);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -6232,6 +6382,32 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintInt64((-op1->i));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintUInt64((unsigned int)(-op1->ui));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
@@ -6336,6 +6512,32 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintInt64((++op1->i));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintUInt64((++op1->ui));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
@@ -6440,6 +6642,32 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintInt64((--op1->i));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintUInt64((--op1->ui));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
@@ -6548,6 +6776,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i = value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui = value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -6668,6 +6926,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i += value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui += value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -6788,12 +7076,12 @@ op1->type->refCount++;
 return 0x1;
 }
 
-static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
-short value2 = op2->s;
+int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s -= value2);
+exp->string = PrintInt64(op1->i -= value2);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6803,12 +7091,42 @@ op1->type->refCount++;
 return 0x1;
 }
 
-static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
-unsigned short value2 = op2->us;
+unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us -= value2);
+exp->string = PrintUInt64(op1->ui -= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+short value2 = op2->s;
+
+exp->type = 2;
+exp->string = PrintShort(op1->s -= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned short value2 = op2->us;
+
+exp->type = 2;
+exp->string = PrintUShort(op1->us -= value2);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6908,6 +7226,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i *= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui *= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7028,6 +7376,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(value2 ? (op1->i /= value2) : 0);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(value2 ? (op1->ui /= value2) : 0);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7148,6 +7526,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(value2 ? (op1->i %= value2) : 0);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(value2 ? (op1->ui %= value2) : 0);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7238,6 +7646,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i & value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui & value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7328,6 +7766,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i | value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui | value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7418,6 +7886,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i ^ value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui ^ value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7508,6 +8006,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i << value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui << value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7598,6 +8126,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i >> value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui >> value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7684,6 +8242,32 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintInt64((~op1->i));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintUInt64((unsigned int)(~op1->ui));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
@@ -7766,6 +8350,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i &= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui &= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7856,6 +8470,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i |= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui |= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -7946,6 +8590,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i ^= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui ^= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -8036,6 +8710,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i <<= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui <<= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -8126,6 +8830,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i >>= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui >>= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -8212,6 +8946,32 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintInt64((int)(!op1->i));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintUInt64((unsigned int)(!op1->ui));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
@@ -8238,10 +8998,38 @@ op1->type->refCount++;
 return 0x1;
 }
 
-static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
+static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintChar((char)(!op1->c));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
+{
+exp->type = 2;
+exp->string = PrintUChar((unsigned char)(!op1->uc));
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
+int value2 = op2->i;
+
 exp->type = 2;
-exp->string = PrintChar((char)(!op1->c));
+exp->string = PrintInt(op1->i == value2);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8251,10 +9039,12 @@ op1->type->refCount++;
 return 0x1;
 }
 
-static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
+static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
+unsigned int value2 = op2->ui;
+
 exp->type = 2;
-exp->string = PrintUChar((unsigned char)(!op1->uc));
+exp->string = PrintUInt(op1->ui == value2);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8264,12 +9054,12 @@ op1->type->refCount++;
 return 0x1;
 }
 
-static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i == value2);
+exp->string = PrintInt64(op1->i == value2);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8279,12 +9069,12 @@ op1->type->refCount++;
 return 0x1;
 }
 
-static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui == value2);
+exp->string = PrintUInt64(op1->ui == value2);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8414,6 +9204,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i != value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui != value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -8534,6 +9354,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i && value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui && value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -8654,6 +9504,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i || value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui || value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -8774,6 +9654,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i > value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui > value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -8894,6 +9804,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i < value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui < value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -9014,6 +9954,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i >= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui >= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -9134,6 +10104,36 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+int value2 = op2->i;
+
+exp->type = 2;
+exp->string = PrintInt64(op1->i <= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
+{
+unsigned int value2 = op2->ui;
+
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui <= value2);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
 {
 short value2 = op2->s;
@@ -9250,6 +10250,32 @@ op1->type->refCount++;
 return 0x1;
 }
 
+static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
+{
+exp->type = 2;
+exp->string = PrintInt64(op1->i ? op2->i : op3->i);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
+static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
+{
+exp->type = 2;
+exp->string = PrintUInt64(op1->ui ? op2->ui : op3->ui);
+if(!exp->expType)
+{
+exp->expType = op1->type;
+if(op1->type)
+op1->type->refCount++;
+}
+return 0x1;
+}
+
 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
 {
 exp->type = 2;
@@ -9338,6 +10364,16 @@ struct OpTable uintOps =
 UIntAdd, UIntSub, UIntMul, UIntDiv, UIntMod, UIntNeg, UIntInc, UIntDec, UIntAsign, UIntAddAsign, UIntSubAsign, UIntMulAsign, UIntDivAsign, UIntModAsign, UIntBitAnd, UIntBitOr, UIntBitXor, UIntLShift, UIntRShift, UIntBitNot, UIntAndAsign, UIntOrAsign, UIntXorAsign, UIntLShiftAsign, UIntRShiftAsign, UIntNot, UIntEqu, UIntNqu, UIntAnd, UIntOr, UIntGrt, UIntSma, UIntGrtEqu, UIntSmaEqu, UIntCond
 };
 
+struct OpTable int64Ops = 
+{
+Int64Add, Int64Sub, Int64Mul, Int64Div, Int64Mod, Int64Neg, Int64Inc, Int64Dec, Int64Asign, Int64AddAsign, Int64SubAsign, Int64MulAsign, Int64DivAsign, Int64ModAsign, Int64BitAnd, Int64BitOr, Int64BitXor, Int64LShift, Int64RShift, Int64BitNot, Int64AndAsign, Int64OrAsign, Int64XorAsign, Int64LShiftAsign, Int64RShiftAsign, Int64Not, Int64Equ, Int64Nqu, Int64And, Int64Or, Int64Grt, Int64Sma, Int64GrtEqu, Int64SmaEqu, Int64Cond
+};
+
+struct OpTable uint64Ops = 
+{
+UInt64Add, UInt64Sub, UInt64Mul, UInt64Div, UInt64Mod, UInt64Neg, UInt64Inc, UInt64Dec, UInt64Asign, UInt64AddAsign, UInt64SubAsign, UInt64MulAsign, UInt64DivAsign, UInt64ModAsign, UInt64BitAnd, UInt64BitOr, UInt64BitXor, UInt64LShift, UInt64RShift, UInt64BitNot, UInt64AndAsign, UInt64OrAsign, UInt64XorAsign, UInt64LShiftAsign, UInt64RShiftAsign, UInt64Not, UInt64Equ, UInt64Nqu, UInt64And, UInt64Or, UInt64Grt, UInt64Sma, UInt64GrtEqu, UInt64SmaEqu, UInt64Cond
+};
+
 struct OpTable shortOps = 
 {
 ShortAdd, ShortSub, ShortMul, ShortDiv, ShortMod, ShortNeg, ShortInc, ShortDec, ShortAsign, ShortAddAsign, ShortSubAsign, ShortMulAsign, ShortDivAsign, ShortModAsign, ShortBitAnd, ShortBitOr, ShortBitXor, ShortLShift, ShortRShift, ShortBitNot, ShortAndAsign, ShortOrAsign, ShortXorAsign, ShortLShiftAsign, ShortRShiftAsign, ShortNot, ShortEqu, ShortNqu, ShortAnd, ShortOr, ShortGrt, ShortSma, ShortGrtEqu, ShortSmaEqu, ShortCond
@@ -9517,33 +10553,33 @@ else
 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
 op.ops = uintOps;
 }
-op.kind = 3;
+op.kind = 4;
 break;
 case 22:
 if(type->isSigned)
 {
 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
-op.ops = intOps;
+op.ops = int64Ops;
 }
 else
 {
 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
-op.ops = uintOps;
+op.ops = uint64Ops;
 }
-op.kind = 3;
+op.kind = 4;
 break;
 case 23:
 if(type->isSigned)
 {
 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
-op.ops = intOps;
+op.ops = int64Ops;
 }
 else
 {
 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
-op.ops = uintOps;
+op.ops = uint64Ops;
 }
-op.kind = 3;
+op.kind = 4;
 break;
 case 6:
 op.f = (float)strtod(exp->constant, (((void *)0)));
@@ -12657,19 +13693,20 @@ case 2:
 {
 if(!exp->expType)
 {
+char * constant = exp->constant;
 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
 
 exp->expType = type;
-if(exp->constant[0] == '\'')
+if(constant[0] == '\'')
 {
-if((int)((unsigned char *)exp->constant)[1] > 127)
+if((int)((unsigned char *)constant)[1] > 127)
 {
 int nb;
-unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
+unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
 
 if(nb < 2)
-ch = exp->constant[1];
-(__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
+ch = constant[1];
+(__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
 exp->constant = PrintUInt(ch);
 type->kind = 8;
 type->_class = FindClass("unichar");
@@ -12681,11 +13718,27 @@ type->kind = 1;
 type->isSigned = 0x1;
 }
 }
-else if(strchr(exp->constant, '.'))
+else
 {
-char ch = exp->constant[strlen(exp->constant) - 1];
+char * dot = strchr(constant, '.');
+unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
+char * exponent;
 
-if(ch == 'f')
+if(isHex)
+{
+exponent = strchr(constant, 'p');
+if(!exponent)
+exponent = strchr(constant, 'P');
+}
+else
+{
+exponent = strchr(constant, 'e');
+if(!exponent)
+exponent = strchr(constant, 'E');
+}
+if(dot || exponent)
+{
+if(strchr(constant, 'f') || strchr(constant, 'F'))
 type->kind = 6;
 else
 type->kind = 7;
@@ -12693,15 +13746,33 @@ type->isSigned = 0x1;
 }
 else
 {
-if(exp->constant[0] == '0' && exp->constant[1])
-type->isSigned = 0x0;
-else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
-type->isSigned = 0x0;
-else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
-type->isSigned = 0x0;
+unsigned int isSigned = constant[0] == '-';
+long long i64 = strtoll(constant, (((void *)0)), 0);
+uint64 ui64 = strtoull(constant, (((void *)0)), 0);
+unsigned int is64Bit = 0x0;
+
+if(isSigned)
+{
+if(i64 < (((int)0x80000000)))
+is64Bit = 0x1;
+}
 else
-type->isSigned = 0x1;
-type->kind = 3;
+{
+if(ui64 > (((int)0x7fffffff)))
+{
+if(ui64 > (0xffffffff))
+{
+is64Bit = 0x1;
+if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
+isSigned = 0x1;
+}
+}
+else if(constant[0] != '0' || !constant[1])
+isSigned = 0x1;
+}
+type->kind = is64Bit ? 4 : 3;
+type->isSigned = isSigned;
+}
 }
 exp->isConstant = 0x1;
 if(exp->destType && exp->destType->kind == 7)
index 934fcc7..c4a6466 100644 (file)
@@ -4004,6 +4004,8 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
 #define OPERATOR_ALL(macro, o, name) \
    macro(o, Int##name, i, int, PrintInt) \
    macro(o, UInt##name, ui, unsigned int, PrintUInt) \
+   macro(o, Int64##name, i, int, PrintInt64) \
+   macro(o, UInt64##name, ui, unsigned int, PrintUInt64) \
    macro(o, Short##name, s, short, PrintShort) \
    macro(o, UShort##name, us, unsigned short, PrintUShort) \
    macro(o, Char##name, c, char, PrintChar) \
@@ -4014,6 +4016,8 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
 #define OPERATOR_INTTYPES(macro, o, name) \
    macro(o, Int##name, i, int, PrintInt) \
    macro(o, UInt##name, ui, unsigned int, PrintUInt) \
+   macro(o, Int64##name, i, int, PrintInt64) \
+   macro(o, UInt64##name, ui, unsigned int, PrintUInt64) \
    macro(o, Short##name, s, short, PrintShort) \
    macro(o, UShort##name, us, unsigned short, PrintUShort) \
    macro(o, Char##name, c, char, PrintChar) \
@@ -4110,6 +4114,8 @@ OPERATOR_ALL(TERTIARY, ?, Cond)
 
 OPERATOR_TABLE_ALL(int, Int)
 OPERATOR_TABLE_ALL(uint, UInt)
+OPERATOR_TABLE_ALL(int64, Int64)
+OPERATOR_TABLE_ALL(uint64, UInt64)
 OPERATOR_TABLE_ALL(short, Short)
 OPERATOR_TABLE_ALL(ushort, UShort)
 OPERATOR_TABLE_INTTYPES(float, Float)
@@ -4243,33 +4249,33 @@ public Operand GetOperand(Expression exp)
                   op.ui64 = (uint64)_strtoui64(exp.constant, null, 0);
                   op.ops = uintOps;
                }
-               op.kind = intType;
+               op.kind = int64Type;
                break;
             case intPtrType:
                if(type.isSigned)
                {
                   op.i64 = (int64)_strtoi64(exp.constant, null, 0);
-                  op.ops = intOps;
+                  op.ops = int64Ops;
                }
                else
                {
                   op.ui64 = (uint64)_strtoui64(exp.constant, null, 0);
-                  op.ops = uintOps;
+                  op.ops = uint64Ops;
                }
-               op.kind = intType;
+               op.kind = int64Type;
                break;
             case intSizeType:
                if(type.isSigned)
                {
                   op.i64 = (int64)_strtoi64(exp.constant, null, 0);
-                  op.ops = intOps;
+                  op.ops = int64Ops;
                }
                else
                {
                   op.ui64 = (uint64)_strtoui64(exp.constant, null, 0);
-                  op.ops = uintOps;
+                  op.ops = uint64Ops;
                }
-               op.kind = intType;
+               op.kind = int64Type;
                break;
             case floatType:
                op.f = (float)strtod(exp.constant, null);
@@ -7556,6 +7562,7 @@ void ProcessExpressionType(Expression exp)
       {
          if(!exp.expType)
          {
+            char * constant = exp.constant;
             Type type
             {
                refCount = 1;
@@ -7563,14 +7570,14 @@ void ProcessExpressionType(Expression exp)
             };
             exp.expType = type;
 
-            if(exp.constant[0] == '\'')
+            if(constant[0] == '\'')
             {
-               if((int)((byte *)exp.constant)[1] > 127)
+               if((int)((byte *)constant)[1] > 127)
                {
                   int nb;
-                  unichar ch = UTF8GetChar(exp.constant + 1, &nb);
-                  if(nb < 2) ch = exp.constant[1];
-                  delete exp.constant;
+                  unichar ch = UTF8GetChar(constant + 1, &nb);
+                  if(nb < 2) ch = constant[1];
+                  delete constant;
                   exp.constant = PrintUInt(ch);
                   // type.kind = (ch > 0xFFFF) ? intType : shortType;
                   type.kind = classType; //(ch > 0xFFFF) ? intType : shortType;
@@ -7584,26 +7591,58 @@ void ProcessExpressionType(Expression exp)
                   type.isSigned = true;
                }
             }
-            else if(strchr(exp.constant, '.'))
-            {
-               char ch = exp.constant[strlen(exp.constant)-1];
-               if(ch == 'f')
-                  type.kind = floatType;
-               else
-                  type.kind = doubleType;
-               type.isSigned = true;
-            }
             else
             {
-               if(exp.constant[0] == '0' && exp.constant[1])
-                  type.isSigned = false;
-               else if(strchr(exp.constant, 'L') || strchr(exp.constant, 'l'))
-                  type.isSigned = false;
-               else if(strtoll(exp.constant, null, 0) > MAXINT)
-                  type.isSigned = false;
+               char * dot = strchr(constant, '.');
+               bool isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
+               char * exponent;
+               if(isHex)
+               {
+                  exponent = strchr(constant, 'p');
+                  if(!exponent) exponent = strchr(constant, 'P');
+               }
                else
+               {
+                  exponent = strchr(constant, 'e');
+                  if(!exponent) exponent = strchr(constant, 'E');
+               }
+
+               if(dot || exponent)
+               {
+                  if(strchr(constant, 'f') || strchr(constant, 'F'))
+                     type.kind = floatType;
+                  else
+                     type.kind = doubleType;
                   type.isSigned = true;
-               type.kind = intType;
+               }
+               else
+               {
+                  bool isSigned = constant[0] == '-';
+                  int64 i64 = strtoll(constant, null, 0);
+                  uint64 ui64 = strtoull(constant, null, 0);
+                  bool is64Bit = false;
+                  if(isSigned)
+                  {
+                     if(i64 < MININT)
+                        is64Bit = true;
+                  }
+                  else
+                  {
+                     if(ui64 > MAXINT)
+                     {
+                        if(ui64 > MAXDWORD)
+                        {
+                           is64Bit = true;
+                           if(ui64 <= MAXINT64 && (constant[0] != '0' || !constant[1]))
+                              isSigned = true;
+                        }
+                     }
+                     else if(constant[0] != '0' || !constant[1])
+                        isSigned = true;
+                  }
+                  type.kind = is64Bit ? int64Type : intType;
+                  type.isSigned = isSigned;
+               }
             }
             exp.isConstant = true;
             if(exp.destType && exp.destType.kind == doubleType)
index cc942cc..bcbbe14 100644 (file)
@@ -4,8 +4,6 @@ import "HTMLView"
 import "IDESettings"
 import "SettingsDialog"
 
-uint64 strtoull(const char * nptr, char ** endptr, int base);
-
 static Context globalContext { };
 static OldList defines { };
 static OldList imports { };
index 37f2f87..2e2b9c3 100644 (file)
@@ -6210,6 +6210,8 @@ static void LoadCOM(Module module)
    eSystem_RegisterFunction("isupper", "int isupper(int c)", isupper, module, baseSystemAccess);
    eSystem_RegisterFunction("isprint", "int isprint(int c)", isprint, module, baseSystemAccess);
    eSystem_RegisterFunction("strtoul", "unsigned long strtoul(const char * nptr, char ** endptr, int base)", strtoul, module, baseSystemAccess);
+   eSystem_RegisterFunction("strtoll", "int64 strtoll(const char * nptr, char ** endptr, int base)", strtoul, module, baseSystemAccess);
+   eSystem_RegisterFunction("strtoull", "uint64 strtoull(const char * nptr, char ** endptr, int base)", strtoul, module, baseSystemAccess);
 
 }
 
index 3747439..ebc386f 100644 (file)
@@ -1735,13 +1735,24 @@ private:
                         else if(!inQuotes && !inString && !inMultiLineComment && !inSingleLineComment && (isdigit(word[0]) || (word[0] == '.' && isdigit(word[1]))))
                         {
                            char * dot = strchr(word, '.');
-                           char * exponent = strchr(word, 'E');
+                           bool isHex = (word[0] == '0' && (word[1] == 'x' || word[1] == 'X'));
+                           char * exponent;
                            bool isReal;
                            char * s = null;
+                           if(isHex)
+                           {
+                              exponent = strchr(word, 'p');
+                              if(!exponent) exponent = strchr(word, 'P');
+                           }
+                           else
+                           {
+                              exponent = strchr(word, 'e');
+                              if(!exponent) exponent = strchr(word, 'E');
+                           }
                            if(dot && dot > word + wordLen) dot = null;
                            isReal = dot || exponent;
                            if(isReal)
-                              strtod(word, &s);
+                              strtod(word, &s);      // strtod() seems to break on hex floats (e.g. 0x23e3p12, 0x1.fp3)
                            else
                               strtol(word, &s, 0);
                            if(s && s != word)
index 503ad5f..89fa885 100644 (file)
@@ -130,6 +130,7 @@ void DebugComputeExpression(Expression exp)
          temp[0] = '\0';
          switch(kind)
          {
+            case intPtrType: case intSizeType: case _BoolType:
             case charType: case shortType: case intType: case int64Type: case longType: case floatType: case doubleType:
             case enumType:
             case arrayType:
@@ -197,6 +198,9 @@ void DebugComputeExpression(Expression exp)
             case shortType:
             case intType:
             case longType:
+            case intPtrType:
+            case intSizeType:
+            case _BoolType:
             case int64Type:
             case floatType:
             case doubleType: