compiler/bootstrap: Updated
authorJerome St-Louis <jerome@ecere.com>
Fri, 29 Apr 2016 15:50:31 +0000 (11:50 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 29 Apr 2016 16:27:18 +0000 (12:27 -0400)
compiler/bootstrap/ecere/bootstrap/Array.c
compiler/bootstrap/ecere/bootstrap/CustomAVLTree.c
compiler/bootstrap/ecere/bootstrap/List.c
compiler/bootstrap/ecere/bootstrap/dataTypes.c
compiler/bootstrap/ecere/bootstrap/instance.c
compiler/bootstrap/ecp/bootstrap/ecp.c
compiler/bootstrap/ecs/bootstrap/ecs.c

index ea6f2ab..9fd1dd4 100644 (file)
@@ -58,8 +58,6 @@ unsigned int count;
 unsigned int minAllocSize;
 } ecere_gcc_struct;
 
-extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__Class_char__PTR_;
-
 struct __ecereNameSpace__ecere__sys__BTNode;
 
 struct __ecereNameSpace__ecere__sys__OldList
@@ -384,10 +382,6 @@ struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Array;
 
-const char *  __ecereProp___ecereNameSpace__ecere__com__Class_Get_char__PTR_(struct __ecereNameSpace__ecere__com__Class * this);
-
-struct __ecereNameSpace__ecere__com__Class * __ecereProp___ecereNameSpace__ecere__com__Class_Set_char__PTR_(const char *  value);
-
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_uint;
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
@@ -461,7 +455,7 @@ return __ecerePointer___ecereNameSpace__ecere__com__Array->minAllocSize;
 void __ecereMethod___ecereNameSpace__ecere__com__Array_OnUnserialize(struct __ecereNameSpace__ecere__com__Class * class, struct __ecereNameSpace__ecere__com__Instance ** this, struct __ecereNameSpace__ecere__com__Instance * channel)
 {
 __attribute__((unused)) struct __ecereNameSpace__ecere__com__Array * __ecerePointer___ecereNameSpace__ecere__com__Array = (struct __ecereNameSpace__ecere__com__Array *)(this ? (((char *)this) + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance)) : 0);
-struct __ecereNameSpace__ecere__com__Instance * array = __ecereNameSpace__ecere__com__eInstance_New(__ecereProp___ecereNameSpace__ecere__com__Class_Set_char__PTR_(class->fullName));
+struct __ecereNameSpace__ecere__com__Instance * array = __ecereNameSpace__ecere__com__eInstance_New(class);
 unsigned int count, c;
 struct __ecereNameSpace__ecere__com__Class * Dclass = class->templateArgs[2].__anon1.__anon1.dataTypeClass;
 
index 3ae5f6e..b07bbaf 100644 (file)
@@ -112,6 +112,8 @@ struct __ecereNameSpace__ecere__com__IteratorPointer;
 
 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
 
+int __ecereVMethodID_class_OnCompare;
+
 int __ecereVMethodID_class_OnFree;
 
 struct __ecereNameSpace__ecere__com__AVLNode
@@ -757,6 +759,8 @@ extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpac
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_uint64;
 
+extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int64;
+
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_uint;
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
@@ -921,6 +925,7 @@ unsigned int reference = 0;
 unsigned int offset = 0;
 int t = Tclass->type;
 int (* onCompare)(void *, void *, void *) = (void *)Tclass->_vTbl[__ecereVMethodID_class_OnCompare];
+unsigned int isInt64 = onCompare == (void *)__ecereClass_int64->_vTbl[__ecereVMethodID_class_OnCompare];
 
 reference = (t == 1000 && !Tclass->byValueSystemClass) || t == 2 || t == 4 || t == 3;
 offset = __ENDIAN_PAD(Tclass->typeSize);
@@ -958,11 +963,28 @@ break;
 }
 else
 {
+long long a64;
+
+if(isInt64)
+a64 = *(long long *)a;
 while(this)
 {
 unsigned char * b = reference ? ((unsigned char *)&this->key) + offset : (unsigned char *)(uintptr_t)(uint64)(this->key);
-int result = onCompare(Tclass, a, b);
+int result;
+
+if(isInt64)
+{
+long long b64 = *(long long *)b;
 
+if(a64 > b64)
+result = 1;
+else if(a64 < b64)
+result = -1;
+else
+result = 0;
+}
+else
+result = onCompare(Tclass, a, b);
 if(result)
 {
 struct __ecereNameSpace__ecere__com__AVLNode * node = result < 0 ? this->left : this->right;
@@ -1058,11 +1080,12 @@ if(!((struct __ecereNameSpace__ecere__com__AVLNode *)((uintptr_t)(__ecerePointer
 __ecerePointer___ecereNameSpace__ecere__com__CustomAVLTree->root = ((struct __ecereNameSpace__ecere__com__AVLNode *)((uintptr_t)(node)));
 else
 {
-struct __ecereNameSpace__ecere__com__Class * Tclass = ((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[3].__anon1.__anon1.dataTypeClass->templateArgs[0].__anon1.__anon1.dataTypeClass;
+struct __ecereNameSpace__ecere__com__Class * btClass = ((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[3].__anon1.__anon1.dataTypeClass;
+struct __ecereNameSpace__ecere__com__Class * Tclass = btClass->templateArgs[0].__anon1.__anon1.dataTypeClass;
 
 if(!Tclass)
 {
-Tclass = ((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[3].__anon1.__anon1.dataTypeClass->templateArgs[0].__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application, ((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[3].__anon1.__anon1.dataTypeClass->templateArgs[0].__anon1.__anon1.dataTypeString);
+Tclass = btClass->templateArgs[0].__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application, btClass->templateArgs[0].__anon1.__anon1.dataTypeString);
 }
 if(__ecereMethod___ecereNameSpace__ecere__com__AVLNode_Add(((struct __ecereNameSpace__ecere__com__AVLNode *)((uintptr_t)(__ecerePointer___ecereNameSpace__ecere__com__CustomAVLTree->root))), Tclass, ((struct __ecereNameSpace__ecere__com__AVLNode *)((uintptr_t)(node))), (int)0))
 __ecerePointer___ecereNameSpace__ecere__com__CustomAVLTree->root = __ecereMethod___ecereNameSpace__ecere__com__AVLNode_Rebalance(((struct __ecereNameSpace__ecere__com__AVLNode *)((uintptr_t)(node))));
index d82b61f..ba152f7 100644 (file)
@@ -465,18 +465,15 @@ struct __ecereNameSpace__ecere__com__Link * link;
 
 if(((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[6].__anon1.__anon1.dataTypeClass && ((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[6].__anon1.__anon1.dataTypeClass->type == 1)
 {
-unsigned int a = sizeof(struct __ecereNameSpace__ecere__com__ListItem);
-unsigned int b = ((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[6].__anon1.__anon1.dataTypeClass->structSize;
-unsigned int c = a + b;
-
-link = (struct __ecereNameSpace__ecere__com__Link *)__ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (c));
-memcpy((void *)&link->data, (void *)(uintptr_t)value, b);
+link = (struct __ecereNameSpace__ecere__com__Link *)__ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (sizeof(struct __ecereNameSpace__ecere__com__ListItem) + ((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[6].__anon1.__anon1.dataTypeClass->structSize));
+memcpy((void *)&link->data, (void *)(uintptr_t)value, ((struct __ecereNameSpace__ecere__com__Instance *)(char *)this)->_class->templateArgs[6].__anon1.__anon1.dataTypeClass->structSize);
 }
 else
-{
-link = (struct __ecereNameSpace__ecere__com__Link *)__ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (sizeof(struct __ecereNameSpace__ecere__com__ListItem) + sizeof(uint64)));
-link->data = ((uint64)(value));
-}
+link = __extension__ ({
+struct __ecereNameSpace__ecere__com__Link * __ecereInstance1 = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(struct __ecereNameSpace__ecere__com__Link) + sizeof(struct __ecereNameSpace__ecere__com__ListItem));
+
+__ecereInstance1->data = ((uint64)(value)), __ecereInstance1;
+});
 (__extension__ ({
 struct __ecereNameSpace__ecere__com__IteratorPointer * (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * after, uint64 value);
 
index 99d5238..2fc3080 100644 (file)
@@ -2657,7 +2657,7 @@ if(!atMember || !strcmp(memberType->name, "bool"))
 strcat(tempString, name);
 strcat(tempString, " = ");
 }
-if(!strcmp(memberType->name, "char *"))
+if(needClass && *needClass && !strcmp(memberType->name, "char *"))
 {
 int len = strlen(tempString);
 int c;
index 3f83f41..fbc49b2 100644 (file)
@@ -967,23 +967,17 @@ ch -= ('a' - 10);
 else if(ch >= 'A' && ch <= 'Z')
 ch -= ('A' - 10);
 else
-{
-if(endString)
-*endString = string + c;
 break;
-}
 if(ch < base)
 {
 value *= base;
 value += ch;
 }
 else
-{
-if(endString)
-*endString = string + c;
 break;
 }
-}
+if(endString)
+*endString = string + c;
 return sign * value;
 }
 
@@ -1028,23 +1022,17 @@ ch -= ('a' - 10);
 else if(ch >= 'A' && ch <= 'Z')
 ch -= ('A' - 10);
 else
-{
-if(endString)
-*endString = string + c;
 break;
-}
 if(ch < base)
 {
 value *= base;
 value += ch;
 }
 else
-{
-if(endString)
-*endString = string + c;
 break;
 }
-}
+if(endString)
+*endString = string + c;
 return sign * value;
 }
 
@@ -1355,9 +1343,7 @@ struct __ecereNameSpace__ecere__com__MemPart * part = block->part;
 struct __ecereNameSpace__ecere__com__BlockPool * pool = part ? part->pool : (((void *)0));
 
 if(pool)
-{
 __ecereMethod___ecereNameSpace__ecere__com__BlockPool_Remove((&*pool), block);
-}
 else
 {
 __ecereNameSpace__ecere__com__TOTAL_MEM -= sizeof(struct __ecereNameSpace__ecere__com__MemBlock) + block->size;
@@ -5436,7 +5422,7 @@ else
 _class->offset = 0;
 if(crossBits)
 {
-if(!strcmp(name, "GNOSISSystem") || !strcmp(name, "LineStyle") || !strcmp(name, "FillStyle") || !strcmp(name, "FontObject") || !strcmp(name, "FontObject") || !strcmp(name, "ecere::sys::Thread"))
+if(!strcmp(name, "GNOSISSystem") || !strcmp(name, "LineStyle") || !strcmp(name, "FillStyle") || !strcmp(name, "FontObject") || !strcmp(name, "SymbolStyle"))
 {
 _class->offset = force32Bits ? 24 : 12;
 }
index 5d46c79..09271d2 100644 (file)
@@ -1273,7 +1273,6 @@ unsigned int casted : 1;
 unsigned int pointerAlignment : 1;
 unsigned int isLong : 1;
 unsigned int signedBeforePromotion : 1;
-unsigned int isVector : 1;
 } ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
index da77cfe..550a9f9 100644 (file)
@@ -686,7 +686,6 @@ unsigned int casted : 1;
 unsigned int pointerAlignment : 1;
 unsigned int isLong : 1;
 unsigned int signedBeforePromotion : 1;
-unsigned int isVector : 1;
 } ecere_gcc_struct;
 
 extern void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char *  name);
@@ -1444,7 +1443,7 @@ else
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, " = 0");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ";\n\n");
 }
-__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      safeIncRef();\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      incref this;\n");
 for(param = method->dataType->__anon1.__anon2.params.first; param; param = param->next)
 {
 char type[1024] = "";
@@ -1498,7 +1497,7 @@ __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereBuff
 }
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      }\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereBuffer.Free();\n");
-__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      safeDecRef();\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      delete this;\n");
 if(method->dataType->__anon1.__anon2.returnType->kind != 0)
 {
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      return __ecereResult;\n");