wip II
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
index f262763..451d813 100644 (file)
@@ -1,3 +1,4 @@
+/* Code generated from eC source file: pass15.ec */
 #if defined(__GNUC__)
 typedef long long int64;
 typedef unsigned long long uint64;
@@ -30,7 +31,7 @@ typedef unsigned __int64 uint64;
 #include <stdint.h>
 #include <sys/types.h>
 
-#if defined(_W64) || (defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
+#if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
 #define _64BIT 1
 #else
 #define _64BIT 0
@@ -128,7 +129,7 @@ struct CodePosition
 int line;
 int charPos;
 int pos;
-unsigned int included;
+int included;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
@@ -781,25 +782,28 @@ struct Symbol * enumClass;
 struct Type * type;
 struct TemplateParameter * templateParameter;
 } __attribute__ ((gcc_struct));
-unsigned int isSigned;
 int kind;
-unsigned int constant;
 unsigned int size;
 char *  name;
 char *  typeName;
-unsigned int count;
-unsigned int truth;
 int classObjectType;
-unsigned int byReference;
-unsigned int extraParam;
 int alignment;
-unsigned int directClassAccess;
-unsigned int computing;
-unsigned int dllExport;
 unsigned int offset;
-unsigned int keepCast;
-unsigned int passAsTemplate;
 int bitFieldCount;
+int count;
+unsigned int isSigned : 1;
+unsigned int constant : 1;
+unsigned int truth : 1;
+unsigned int byReference : 1;
+unsigned int extraParam : 1;
+unsigned int directClassAccess : 1;
+unsigned int computing : 1;
+unsigned int keepCast : 1;
+unsigned int passAsTemplate : 1;
+unsigned int dllExport : 1;
+unsigned int attrStdcall : 1;
+unsigned int declaredWithStruct : 1;
+unsigned int typedByReference : 1;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
@@ -858,6 +862,8 @@ struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
 struct __ecereNameSpace__ecere__com__Class * templateClass;
 struct __ecereNameSpace__ecere__sys__OldList templatized;
 int numParams;
+unsigned int isInstanceClass;
+unsigned int byValueSystemClass;
 } __attribute__ ((gcc_struct));
 
 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
@@ -1526,7 +1532,7 @@ char temp[100];
 if(result > (unsigned short)32767)
 sprintf(temp, "0x%X", (int)result);
 else
-sprintf(temp, "%d", result);
+sprintf(temp, "%d", (int)result);
 return __ecereNameSpace__ecere__sys__CopyString(temp);
 }
 
@@ -1539,7 +1545,7 @@ char temp[100];
 if(result > (char)0 && isprint(result))
 sprintf(temp, "'%c'", result);
 else if(result < (char)0)
-sprintf(temp, "%d", result);
+sprintf(temp, "%d", (int)result);
 else
 sprintf(temp, "0x%X", (unsigned char)result);
 return __ecereNameSpace__ecere__sys__CopyString(temp);
@@ -2656,6 +2662,7 @@ else
 type->arraySize = 0;
 }
 size = ComputeTypeSize(type->type) * type->arraySize;
+if(type->type)
 type->alignment = type->type->alignment;
 break;
 case 9:
@@ -2776,7 +2783,14 @@ maxSize = _class->structSize;
 if(_class->type == 1 || _class->type == 5)
 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
 else
-maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
+{
+unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
+
+if(maxSize > baseSize)
+maxSize -= baseSize;
+else
+maxSize = 0;
+}
 }
 }
 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
@@ -2910,7 +2924,7 @@ extern char *  strchr(const char * , int);
 
 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
 
-extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
+extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
 
 extern void FreeClassDef(struct ClassDef * def);
 
@@ -3077,7 +3091,6 @@ void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameS
 
 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
 {
-void * __ecereTemp1;
 struct Symbol * symbol = prop->symbol;
 char propName[1024];
 
@@ -3120,11 +3133,19 @@ if(prop->_class->module)
 module = FindModule(prop->_class->module);
 else
 module = mainModule;
-classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = prop->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
+classSym->_import = __extension__ ({
+struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
+
+__ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
 }
 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
-symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport), ((struct PropertyImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), ((struct PropertyImport *)__ecereTemp1)->isVirtual = 0x0, ((struct PropertyImport *)__ecereTemp1)->hasSet = prop->Set ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1)->hasGet = prop->Get ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1));
+symbol->_import = (struct ClassImport *)__extension__ ({
+struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
+
+__ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
+});
 if(classSym)
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
 }
@@ -3318,7 +3339,6 @@ symbol->id = curExternal->symbol->idCode;
 
 struct Type * Dereference(struct Type * source)
 {
-void * __ecereTemp1;
 struct Type * type = (((void *)0));
 
 if(source)
@@ -3330,7 +3350,11 @@ source->type->refCount++;
 }
 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
 {
-type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
+type = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
+});
 }
 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
 {
@@ -3345,12 +3369,15 @@ return type;
 
 static struct Type * Reference(struct Type * source)
 {
-void * __ecereTemp1;
 struct Type * type = (((void *)0));
 
 if(source)
 {
-type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = source, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
+type = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
+});
 source->refCount++;
 }
 return type;
@@ -3410,7 +3437,7 @@ if(curMember && thisMember->memberAccess == 1)
 {
 *curMember = thisMember;
 *curClass = thisMember->_class;
-memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
+memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
 *subMemberStackPos = _subMemberStackPos;
 }
 found = 0x1;
@@ -3720,7 +3747,7 @@ extern void FreeSpecifier(struct Specifier * spec);
 
 static void ProcessFunction(struct FunctionDefinition * function);
 
-extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (* )(void * ));
+extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
 
 extern struct Specifier * CopySpecifier(struct Specifier * spec);
 
@@ -3979,7 +4006,6 @@ unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct _
 
 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
 {
-void * __ecereTemp1;
 struct Context * context = PushContext();
 
 context->templateTypesOnly = 0x1;
@@ -4014,9 +4040,17 @@ struct TemplatedType * type;
 
 if(!param)
 {
-p->param = param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter), ((struct TemplateParameter *)__ecereTemp1)->identifier = MkIdentifier(p->name), ((struct TemplateParameter *)__ecereTemp1)->type = p->type, ((struct TemplateParameter *)__ecereTemp1)->dataTypeString = p->dataTypeString, ((struct TemplateParameter *)__ecereTemp1));
+p->param = param = __extension__ ({
+struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
+
+__ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
+});
 }
-type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (uintptr_t)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
+type = __extension__ ({
+struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
+
+__ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
 }
 }
@@ -4089,7 +4123,6 @@ void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNa
 
 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
 {
-void * __ecereTemp1;
 struct Symbol * symbol = method->symbol;
 
 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
@@ -4116,7 +4149,11 @@ if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((
 module = FindModule(method->_class->module);
 else
 module = mainModule;
-classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = method->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
+classSym->_import = __extension__ ({
+struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
+
+__ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
 }
 if(!symbol)
@@ -4125,7 +4162,11 @@ symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereCla
 }
 if(!symbol->_import)
 {
-symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport), ((struct MethodImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->name), ((struct MethodImport *)__ecereTemp1)->isVirtual = method->type == 1, ((struct MethodImport *)__ecereTemp1));
+symbol->_import = (struct ClassImport *)__extension__ ({
+struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
+
+__ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
 }
 if(!symbol)
@@ -4378,7 +4419,6 @@ char *  name;
 
 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
 {
-void * __ecereTemp1;
 struct Symbol * symbol = function->symbol;
 
 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
@@ -4403,7 +4443,11 @@ if(module->name)
 {
 if(!function->dataType->dllExport)
 {
-symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport), ((struct FunctionImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(function->name), ((struct FunctionImport *)__ecereTemp1));
+symbol->_import = (struct ClassImport *)__extension__ ({
+struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
+
+__ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
 }
 }
@@ -4585,12 +4629,23 @@ struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
 if(type)
 dest = type;
 }
-if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
+if(dest->classObjectType == 2)
 {
+if(source->classObjectType != 3)
 return 0x1;
+else
+{
+if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
+{
+return 0x1;
+}
+}
 }
-if(source->classObjectType == 3 && dest->classObjectType != 2)
+else
 {
+if(source->classObjectType == 3)
+return 0x1;
+if(dest->classObjectType == 3 && source->classObjectType != 2)
 return 0x1;
 }
 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
@@ -4629,7 +4684,7 @@ else if(source->_class && dest->_class && (dest->classObjectType == source->clas
 return 0x1;
 else
 {
-if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
+if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && ((source->_class && source->_class->registered && source->_class->registered->type != 4) || source->kind == 8))
 {
 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
 {
@@ -5057,9 +5112,9 @@ char constant[256];
 
 sourceExp->type = 2;
 if(!strcmp(baseClass->dataTypeString, "int"))
-sprintf(constant, "%d", value->data);
+sprintf(constant, "%d", (int)value->data);
 else
-sprintf(constant, "0x%X", value->data);
+sprintf(constant, "0x%X", (int)value->data);
 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
 }
 while(converts.first)
@@ -5156,7 +5211,6 @@ extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__Ol
 
 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
 {
-void * __ecereTemp1;
 struct Type * source = sourceExp->expType;
 struct Type * realDest = dest;
 struct Type * backupSourceExpType = (((void *)0));
@@ -5202,7 +5256,11 @@ value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
 {
 FreeType(source);
-source = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->isSigned = 0x0, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
+source = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
+});
 }
 if(dest->kind == 8)
 {
@@ -5543,9 +5601,9 @@ char constant[256];
 
 sourceExp->type = 2;
 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
-sprintf(constant, "%d", value->data);
+sprintf(constant, "%d", (int)value->data);
 else
-sprintf(constant, "0x%X", value->data);
+sprintf(constant, "0x%X", (int)value->data);
 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
 }
 return 0x1;
@@ -6016,7 +6074,7 @@ static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
+exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6031,7 +6089,7 @@ static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
+exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6134,7 +6192,7 @@ return 0x1;
 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintInt(-op1->i);
+exp->string = PrintInt((-op1->i));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6147,7 +6205,7 @@ return 0x1;
 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUInt(-op1->ui);
+exp->string = PrintUInt((unsigned int)(-op1->ui));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6160,7 +6218,7 @@ return 0x1;
 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintShort(-op1->s);
+exp->string = PrintShort((-op1->s));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6173,7 +6231,7 @@ return 0x1;
 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUShort(-op1->us);
+exp->string = PrintUShort((unsigned short)(-op1->us));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6186,7 +6244,7 @@ return 0x1;
 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintChar(-op1->c);
+exp->string = PrintChar((-op1->c));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6199,7 +6257,7 @@ return 0x1;
 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUChar(-op1->uc);
+exp->string = PrintUChar((unsigned char)(-op1->uc));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6212,7 +6270,7 @@ return 0x1;
 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintFloat(-op1->f);
+exp->string = PrintFloat((float)(-op1->f));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6225,7 +6283,7 @@ return 0x1;
 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintDouble(-op1->d);
+exp->string = PrintDouble((double)(-op1->d));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6238,7 +6296,7 @@ return 0x1;
 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintInt(++op1->i);
+exp->string = PrintInt((++op1->i));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6251,7 +6309,7 @@ return 0x1;
 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUInt(++op1->ui);
+exp->string = PrintUInt((++op1->ui));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6264,7 +6322,7 @@ return 0x1;
 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintShort(++op1->s);
+exp->string = PrintShort((++op1->s));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6277,7 +6335,7 @@ return 0x1;
 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUShort(++op1->us);
+exp->string = PrintUShort((++op1->us));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6290,7 +6348,7 @@ return 0x1;
 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintChar(++op1->c);
+exp->string = PrintChar((++op1->c));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6303,7 +6361,7 @@ return 0x1;
 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUChar(++op1->uc);
+exp->string = PrintUChar((++op1->uc));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6316,7 +6374,7 @@ return 0x1;
 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintFloat(++op1->f);
+exp->string = PrintFloat((float)(++op1->f));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6329,7 +6387,7 @@ return 0x1;
 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintDouble(++op1->d);
+exp->string = PrintDouble((double)(++op1->d));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6342,7 +6400,7 @@ return 0x1;
 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintInt(--op1->i);
+exp->string = PrintInt((--op1->i));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6355,7 +6413,7 @@ return 0x1;
 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUInt(--op1->ui);
+exp->string = PrintUInt((--op1->ui));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6368,7 +6426,7 @@ return 0x1;
 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintShort(--op1->s);
+exp->string = PrintShort((--op1->s));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6381,7 +6439,7 @@ return 0x1;
 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUShort(--op1->us);
+exp->string = PrintUShort((--op1->us));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6394,7 +6452,7 @@ return 0x1;
 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintChar(--op1->c);
+exp->string = PrintChar((--op1->c));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6407,7 +6465,7 @@ return 0x1;
 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUChar(--op1->uc);
+exp->string = PrintUChar((--op1->uc));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6420,7 +6478,7 @@ return 0x1;
 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintFloat(--op1->f);
+exp->string = PrintFloat((float)(--op1->f));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6433,7 +6491,7 @@ return 0x1;
 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintDouble(--op1->d);
+exp->string = PrintDouble((double)(--op1->d));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7018,7 +7076,7 @@ static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1,
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
+exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7033,7 +7091,7 @@ static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
+exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7586,7 +7644,7 @@ return 0x1;
 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintInt(~op1->i);
+exp->string = PrintInt((~op1->i));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7599,7 +7657,7 @@ return 0x1;
 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUInt(~op1->ui);
+exp->string = PrintUInt((unsigned int)(~op1->ui));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7612,7 +7670,7 @@ return 0x1;
 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintShort(~op1->s);
+exp->string = PrintShort((short)(~op1->s));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7625,7 +7683,7 @@ return 0x1;
 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUShort(~op1->us);
+exp->string = PrintUShort((unsigned short)(~op1->us));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7638,7 +7696,7 @@ return 0x1;
 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintChar(~op1->c);
+exp->string = PrintChar((char)(~op1->c));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7651,7 +7709,7 @@ return 0x1;
 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUChar(~op1->uc);
+exp->string = PrintUChar((unsigned char)(~op1->uc));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8114,7 +8172,7 @@ return 0x1;
 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintInt(!op1->i);
+exp->string = PrintInt((int)(!op1->i));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8127,7 +8185,7 @@ return 0x1;
 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUInt(!op1->ui);
+exp->string = PrintUInt((unsigned int)(!op1->ui));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8140,7 +8198,7 @@ return 0x1;
 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintShort(!op1->s);
+exp->string = PrintShort((short)(!op1->s));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8153,7 +8211,7 @@ return 0x1;
 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUShort(!op1->us);
+exp->string = PrintUShort((unsigned short)(!op1->us));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8166,7 +8224,7 @@ return 0x1;
 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintChar(!op1->c);
+exp->string = PrintChar((char)(!op1->c));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8179,7 +8237,7 @@ return 0x1;
 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
 {
 exp->type = 2;
-exp->string = PrintUChar(!op1->uc);
+exp->string = PrintUChar((unsigned char)(!op1->uc));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9627,7 +9685,10 @@ struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
 
+if(!inst->members)
 inst->members = MkListOne(MkMembersInitList(memberList));
+else
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
 {
 if(!dataMember->isProperty)
@@ -9785,6 +9846,8 @@ else
 {
 dataMember = curMember;
 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
+if(_class->type == 0)
+dataMemberOffset += _class->base->structSize;
 }
 found = 0x1;
 }
@@ -9814,7 +9877,7 @@ if(dataMember->memberAccess == 1)
 {
 curMember = dataMember;
 curClass = dataMember->_class;
-memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
+memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
 subMemberStackPos = _subMemberStackPos;
 }
 }
@@ -9824,6 +9887,7 @@ if(found && member->initializer && member->initializer->type == 0)
 {
 struct Expression * value = member->initializer->exp;
 struct Type * type = (((void *)0));
+unsigned int deepMember = 0x0;
 
 if(prop)
 {
@@ -9837,6 +9901,7 @@ type = dataMember->dataType;
 }
 if(ident && ident->next)
 {
+deepMember = 0x1;
 for(ident = ident->next; ident && type; ident = ident->next)
 {
 if(type->kind == 8)
@@ -9874,7 +9939,7 @@ if(type)
 type->refCount++;
 ComputeExpression(value);
 }
-if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
+if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
 {
 if(type->kind == 8)
 {
@@ -9946,11 +10011,19 @@ else if(prop)
 {
 if(value->type == 1 && value->instance->data)
 {
+if(type->kind == 8)
+{
+struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
+
+if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->instance->data))->_class, _class)))
+{
 void (* Set)(void *, void *) = (void *)prop->Set;
 
 Set(inst->data, value->instance->data);
 PopulateInstance(inst);
 }
+}
+}
 else if(value->type == 2)
 {
 switch(type->kind)
@@ -10008,7 +10081,7 @@ ReadString(temp, value->string);
 }
 }
 }
-else if(_class->type == 3)
+else if(!deepMember && type && _class->type == 3)
 {
 if(prop)
 {
@@ -10051,7 +10124,7 @@ break;
 }
 }
 }
-else if(_class->type == 2)
+else if(!deepMember && type && _class->type == 2)
 {
 if(prop)
 {
@@ -10348,6 +10421,8 @@ break;
 }
 }
 
+void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
+
 extern struct Expression * MkExpIdentifier(struct Identifier * id);
 
 void ComputeExpression(struct Expression * exp)
@@ -10460,7 +10535,7 @@ char string[256];
 struct Symbol * classSym;
 
 string[0] = '\0';
-PrintType(type, string, 0x0, 0x1);
+PrintTypeNoConst(type, string, 0x0, 0x1);
 classSym = FindClass(string);
 _class = classSym ? classSym->registered : (((void *)0));
 }
@@ -10780,6 +10855,7 @@ char className[1024];
 strcpy(className, "__ecereClass_");
 FullClassNameCat(className, classSym->string, 0x1);
 MangleClassName(className);
+DeclareClass(classSym, className);
 FreeExpContents(exp);
 exp->type = 9;
 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
@@ -11460,36 +11536,43 @@ break;
 }
 }
 
-extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
+static void PrintArraySize(struct Type * arrayType, char * string)
+{
+char size[256];
 
-static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
+size[0] = '\0';
+strcat(size, "[");
+if(arrayType->enumClass)
+strcat(size, arrayType->enumClass->string);
+else if(arrayType->arraySizeExp)
+PrintExpression(arrayType->arraySizeExp, size);
+strcat(size, "]");
+strcat(string, size);
+}
+
+static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
 {
 if(type)
 {
+if(printConst && type->constant)
+strcat(string, "const ");
 switch(type->kind)
 {
 case 8:
-if(type->_class && type->_class->string)
 {
+struct Symbol * c = type->_class;
+
 if(type->classObjectType == 2)
 strcat(string, "typed_object");
-else if(fullName)
-strcat(string, type->_class->string);
+else if(type->classObjectType == 3)
+strcat(string, "any_object");
 else
 {
-if(type->_class->registered)
-strcat(string, type->_class->registered->name);
-else
-strcat(string, type->_class->string);
-}
-}
-break;
-case 13:
-{
-{
-_PrintType(type->type, string, 0x0, printFunction, fullName);
-strcat(string, " *");
+if(c && c->string)
+strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
 }
+if(type->byReference)
+strcat(string, " &");
 break;
 }
 case 0:
@@ -11526,14 +11609,12 @@ strcat(string, "struct ");
 strcat(string, type->enumName);
 }
 else if(type->typeName)
-{
 strcat(string, type->typeName);
-}
 else
 {
 struct Type * member;
 
-strcat(string, "struct {");
+strcat(string, "struct { ");
 for(member = type->members.first; member; member = member->next)
 {
 PrintType(member, string, 0x1, fullName);
@@ -11549,9 +11630,7 @@ strcat(string, "union ");
 strcat(string, type->enumName);
 }
 else if(type->typeName)
-{
 strcat(string, type->typeName);
-}
 else
 {
 strcat(string, "union ");
@@ -11565,24 +11644,36 @@ strcat(string, "enum ");
 strcat(string, type->enumName);
 }
 else if(type->typeName)
-{
 strcat(string, type->typeName);
-}
 else
-strcat(string, "enum");
+strcat(string, "int");
 break;
-case 11:
-{
-if(printFunction)
-{
-if(type->dllExport)
-strcat(string, "dllexport ");
-PrintType(type->returnType, string, 0x0, fullName);
-strcat(string, " ");
+case 14:
+strcat(string, "...");
+break;
+case 19:
+strcat(string, "subclass(");
+strcat(string, type->_class ? type->_class->string : "int");
+strcat(string, ")");
+break;
+case 20:
+strcat(string, type->templateParameter->identifier->string);
+break;
+case 21:
+strcat(string, "thisclass");
+break;
+case 17:
+strcat(string, "__builtin_va_list");
+break;
+}
 }
-if(printName)
+}
+
+extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
+
+static void PrintName(struct Type * type, char * string, unsigned int fullName)
 {
-if(type->name)
+if(type->name && type->name[0])
 {
 if(fullName)
 strcat(string, type->name);
@@ -11598,92 +11689,62 @@ strcat(string, name);
 }
 }
 }
-if(printFunction)
-{
-struct Type * param;
 
-strcat(string, "(");
-for(param = type->params.first; param; param = param->next)
+static void PrintAttribs(struct Type * type, char * string)
 {
-PrintType(param, string, 0x1, fullName);
-if(param->next)
-strcat(string, ", ");
-}
-strcat(string, ")");
+if(type)
+{
+if(type->dllExport)
+strcat(string, "dllexport ");
+if(type->attrStdcall)
+strcat(string, "stdcall ");
 }
-break;
 }
-case 12:
+
+static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
 {
+if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
 {
-char baseType[1024], size[256];
-struct Type * arrayType = type;
+struct Type * attrType = (((void *)0));
 
-baseType[0] = '\0';
-size[0] = '\0';
-while(arrayType->kind == 12)
+if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
+PrintAttribs(type, string);
+if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
+strcat(string, " const");
+PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
+if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
+strcat(string, " (");
+if(type->kind == 13)
 {
-strcat(size, "[");
-if(arrayType->enumClass)
-strcat(size, arrayType->enumClass->string);
-else if(arrayType->arraySizeExp)
-PrintExpression(arrayType->arraySizeExp, size);
-strcat(size, "]");
-arrayType = arrayType->arrayType;
+if(type->type->kind == 11 || type->type->kind == 16)
+PrintAttribs(type->type, string);
 }
-_PrintType(arrayType, baseType, printName, printFunction, fullName);
-strcat(string, baseType);
-strcat(string, size);
-}
-printName = 0x0;
-break;
-}
-case 14:
-strcat(string, "...");
-break;
-case 16:
-_PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
-break;
-case 19:
-strcat(string, "subclass(");
-strcat(string, type->_class ? type->_class->string : "int");
-strcat(string, ")");
-break;
-case 20:
-strcat(string, type->templateParameter->identifier->string);
-break;
-case 21:
-strcat(string, "thisclass");
-break;
-case 17:
-strcat(string, "__builtin_va_list");
-break;
-}
-if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
+if(type->kind == 13)
 {
-strcat(string, " ");
-strcat(string, type->name);
+if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
+strcat(string, "*");
+else
+strcat(string, " *");
 }
+if(printConst && type->constant && type->kind == 13)
+strcat(string, " const");
 }
+else
+PrintTypeSpecs(type, string, fullName, printConst);
 }
 
-void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
+static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
 {
-struct Type * funcType;
-
-for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
-;
-if(funcType && funcType->kind == 11 && type != funcType)
+if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
+strcat(string, ")");
+if(type->kind == 12)
+PrintArraySize(type, string);
+else if(type->kind == 11)
 {
-char typeString[1024];
 struct Type * param;
 
-PrintType(funcType->returnType, string, 0x0, fullName);
-strcat(string, "(");
-_PrintType(type, string, printName, 0x0, fullName);
-strcat(string, ")");
 strcat(string, "(");
-for(param = funcType->params.first; param; param = param->next)
+for(param = type->params.first; param; param = param->next)
 {
 PrintType(param, string, 0x1, fullName);
 if(param->next)
@@ -11691,8 +11752,48 @@ strcat(string, ", ");
 }
 strcat(string, ")");
 }
+if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
+PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
+}
+
+static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
+{
+PrePrintType(type, string, fullName, (((void *)0)), printConst);
+if(type->thisClass || (printName && type->name && type->name[0]))
+strcat(string, " ");
+if((type->thisClass || type->staticMethod))
+{
+struct Symbol * _class = type->thisClass;
+
+if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
+{
+if(type->classObjectType == 1)
+strcat(string, "class");
+else
+strcat(string, type->byReference ? "typed_object&" : "typed_object");
+}
+else if(_class && _class->string)
+{
+char * s = _class->string;
+
+if(fullName)
+strcat(string, s);
+else
+{
+char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
+
+if(name)
+name += 2;
 else
-_PrintType(type, string, printName, 0x1, fullName);
+name = s;
+strcat(string, name);
+}
+}
+strcat(string, "::");
+}
+if(printName && type->name)
+PrintName(type, string, fullName);
+PostPrintType(type, string, fullName);
 if(type->bitFieldCount)
 {
 char count[100];
@@ -11702,6 +11803,16 @@ strcat(string, count);
 }
 }
 
+void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
+{
+_PrintType(type, string, printName, fullName, 0x1);
+}
+
+void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
+{
+_PrintType(type, string, printName, fullName, 0x0);
+}
+
 static struct Type * FindMember(struct Type * type, char * string)
 {
 struct Type * memberType;
@@ -11767,7 +11878,6 @@ extern char *  QMkString(char *  source);
 
 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
 {
-void * __ecereTemp1;
 struct Identifier * id = exp->identifier;
 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
@@ -11800,9 +11910,9 @@ FreeExpContents(exp);
 exp->type = 2;
 exp->isConstant = 0x1;
 if(!strcmp(baseClass->dataTypeString, "int"))
-sprintf(constant, "%d", value->data);
+sprintf(constant, "%d", (int)value->data);
 else
-sprintf(constant, "0x%X", value->data);
+sprintf(constant, "0x%X", (int)value->data);
 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
 exp->expType = MkClassType(baseClass->fullName);
 break;
@@ -11815,7 +11925,11 @@ return 0x1;
 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
 {
 ProcessMethodType(method);
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1)->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
+});
 return 0x1;
 }
 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
@@ -11970,12 +12084,12 @@ else
 char string[1024] = "";
 struct Symbol * classSym;
 
-PrintType(type, string, 0x0, 0x1);
+PrintTypeNoConst(type, string, 0x0, 0x1);
 classSym = FindClass(string);
 if(classSym)
 _class = classSym->registered;
 }
-if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "ecere::com::Class")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
+if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "uintptr") && strcmp(_class->fullName, "intptr")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 22 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
 {
 if(!_class || strcmp(_class->fullName, "char *"))
 {
@@ -12031,16 +12145,16 @@ typeString[0] = '\0';
 newExp->prev = (((void *)0));
 newExp->next = (((void *)0));
 newExp->expType = (((void *)0));
-PrintType(e->expType, typeString, 0x0, 0x1);
+PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
 newExp->destType = ProcessType(specs, decl);
 curContext = context;
-e->type = 25;
 if(curCompound)
 {
 char name[100];
 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
 
+e->type = 25;
 sprintf(name, "__internalValue%03X", internalValueCounter++);
 if(!curCompound->compound.declarations)
 curCompound->compound.declarations = MkList();
@@ -12101,7 +12215,7 @@ checkedExp->op.exp2 = operand;
 }
 if((!destType || destType->kind == 14 || destType->kind == 0) && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && (e->expType->byReference || (e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))))
 {
-if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
+if(e->expType->classObjectType && destType && destType->classObjectType)
 {
 return ;
 }
@@ -12114,7 +12228,7 @@ thisExp->prev = (((void *)0));
 thisExp->next = (((void *)0));
 __ecereMethod_Expression_Clear(e);
 e->type = 5;
-e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
+e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
 ((struct Expression *)(*e->list).first)->byReference = 0x1;
 {
@@ -12144,27 +12258,35 @@ struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
 char typeString[1024];
 struct Type * type;
 int backupClassObjectType;
+unsigned int backupByReference;
 
 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
 type = e->expType;
 else
 type = destType;
 backupClassObjectType = type->classObjectType;
+backupByReference = type->byReference;
 type->classObjectType = 0;
+type->byReference = 0x0;
 typeString[0] = '\0';
 PrintType(type, typeString, 0x0, 0x1);
 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
 type->classObjectType = backupClassObjectType;
+type->byReference = backupByReference;
 *thisExp = *e;
 thisExp->prev = (((void *)0));
 thisExp->next = (((void *)0));
 __ecereMethod_Expression_Clear(e);
-if((type->kind == 8 && type->_class && type->_class->registered && strcmp(type->_class->registered->fullName, "ecere::com::Instance") && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
+if((type->kind == 8 && type->_class && type->_class->registered && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
 {
 e->type = 4;
 e->op.op = '*';
 e->op.exp1 = (((void *)0));
 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
+e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+CopyTypeInto(e->expType, type);
+e->expType->byReference = 0x0;
+e->expType->refCount = 1;
 }
 else
 {
@@ -12172,10 +12294,10 @@ e->type = 11;
 e->cast.typeName = MkTypeName(specs, decl);
 e->cast.exp = thisExp;
 e->byReference = 0x1;
-}
 e->expType = type;
-e->destType = destType;
 type->refCount++;
+}
+e->destType = destType;
 destType->refCount++;
 }
 }
@@ -12224,8 +12346,6 @@ void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNam
 
 void ProcessExpressionType(struct Expression * exp)
 {
-void * __ecereTemp2;
-void * __ecereTemp1;
 unsigned int unresolved = 0x0;
 struct Location oldyylloc = yylloc;
 unsigned int notByReference = 0x0;
@@ -12314,7 +12434,7 @@ if(type && (type->kind == 15 || (_class && _class->type == 4)))
 exp->isConstant = 0x1;
 if(symbol->isParam || !strcmp(id->string, "this"))
 {
-if(_class && _class->type == 1)
+if(_class && _class->type == 1 && !type->declaredWithStruct)
 exp->byReference = 0x1;
 }
 if(symbol->isIterator)
@@ -12536,26 +12656,48 @@ type->isSigned = 0x1;
 type->kind = 3;
 }
 exp->isConstant = 0x1;
+if(exp->destType && exp->destType->kind == 7)
+type->kind = 7;
+else if(exp->destType && exp->destType->kind == 6)
+type->kind = 6;
+else if(exp->destType && exp->destType->kind == 4)
+type->kind = 4;
 }
 break;
 }
 case 3:
 {
 exp->isConstant = 0x1;
-exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->constant = 0x1, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1;
+}), __ecereInstance2;
+});
 break;
 }
 case 13:
 case 28:
 ProcessExpressionType(exp->_new.size);
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
+});
 DeclareType(exp->expType->type, 0x0, 0x0);
 break;
 case 14:
 case 29:
 ProcessExpressionType(exp->_renew.size);
 ProcessExpressionType(exp->_renew.exp);
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
+});
 DeclareType(exp->expType->type, 0x0, 0x0);
 break;
 case 4:
@@ -12565,7 +12707,7 @@ struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
 unsigned int useDestType = 0x0, useSideType = 0x0;
 struct Location oldyylloc = yylloc;
 unsigned int useSideUnit = 0x0;
-struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
+struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
 
 switch(exp->op.op)
 {
@@ -12782,12 +12924,34 @@ if(exp->op.exp2->destType == dummy)
 FreeType(dummy);
 exp->op.exp2->destType = (((void *)0));
 }
+if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
+{
+type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+type2->refCount = 1;
+CopyTypeInto(type2, exp->op.exp2->expType);
+type2->isSigned = 0x1;
+}
+else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
+{
+type2 = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->kind = 3, __ecereInstance1;
+});
+type2->refCount = 1;
+type2->isSigned = 0x1;
+}
+else
 type2 = exp->op.exp2->expType;
 }
 dummy->kind = 0;
 if(exp->op.op == SIZEOF)
 {
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
+});
 exp->isConstant = 0x1;
 }
 else if(exp->op.op == '*' && !exp->op.exp1)
@@ -12897,7 +13061,11 @@ else if(exp->op.op == '-')
 {
 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
 {
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
+});
 success = 0x1;
 if(type1->type->kind == 20)
 {
@@ -13284,10 +13452,13 @@ if(exp->index.exp->expType)
 {
 struct Type * source = exp->index.exp->expType;
 
-if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass) && source->_class->registered->templateArgs)
+if(source->kind == 8 && source->_class && source->_class->registered)
 {
 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
+struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
 
+if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
+{
 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
 if(exp->index.index && (*exp->index.index).last)
 {
@@ -13295,6 +13466,7 @@ if(exp->index.index && (*exp->index.index).last)
 }
 }
 }
+}
 for(e = (*exp->index.index).first; e; e = e->next)
 {
 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
@@ -13448,7 +13620,7 @@ break;
 }
 }
 {
-struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
+struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
 
 if(!exp->call.exp->destType)
 {
@@ -13473,7 +13645,13 @@ if(exp->call.exp->expType->usedClass)
 char typeString[1024];
 
 typeString[0] = '\0';
+{
+struct Symbol * back = functionType->thisClass;
+
+functionType->thisClass = (((void *)0));
 PrintType(functionType, typeString, 0x1, 0x1);
+functionType->thisClass = back;
+}
 if(strstr(typeString, "thisclass"))
 {
 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
@@ -13534,7 +13712,7 @@ if(functionType->extraParam && e && functionType->thisClass)
 e->destType = MkClassType(functionType->thisClass->string);
 e = e->next;
 }
-if(!functionType->staticMethod)
+if(!functionType->staticMethod && !functionType->extraParam)
 {
 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
 {
@@ -13551,8 +13729,12 @@ type->refCount = 0;
 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
 {
 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
+type->byReference = functionType->byReference;
+type->typedByReference = functionType->typedByReference;
 if(e)
 {
+if(type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
+e = e->next;
 e->destType = type;
 e = e->next;
 type = functionType->params.first;
@@ -13674,7 +13856,11 @@ FreeType(type);
 }
 else
 {
-functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
+functionType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
+});
 if(exp->call.exp->type == 0)
 {
 char * string = exp->call.exp->identifier->string;
@@ -13686,10 +13872,20 @@ struct Location oldyylloc = yylloc;
 
 yylloc = exp->call.exp->identifier->loc;
 if(strstr(string, "__builtin_") == string)
-;
+{
+if(exp->destType)
+{
+functionType->returnType = exp->destType;
+exp->destType->refCount++;
+}
+}
 else
 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
-symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString(string), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("int()", 0x1), ((struct Symbol *)__ecereTemp1));
+symbol = __extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
 if(strstr(symbol->string, "::"))
 globalContext->hasNameSpace = 0x1;
@@ -13703,7 +13899,11 @@ else
 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
 if(!functionType->returnType)
 {
-functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
+functionType->returnType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
+});
 }
 }
 if(functionType && functionType->kind == 11)
@@ -13729,8 +13929,19 @@ case 8:
 {
 struct Type * type;
 struct Location oldyylloc = yylloc;
-unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
+unsigned int thisPtr;
+struct Expression * checkExp = exp->member.exp;
 
+while(checkExp)
+{
+if(checkExp->type == 11)
+checkExp = checkExp->cast.exp;
+else if(checkExp->type == 5)
+checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
+else
+break;
+}
+thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
 exp->thisPtr = thisPtr;
 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
 {
@@ -13916,7 +14127,7 @@ type = ProcessTemplateParameterType(type->templateParameter);
 }
 if(type && (type->kind == 20))
 ;
-else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
+else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15 || type->kind == 4 || type->kind == 2 || type->kind == 5 || type->kind == 1 || type->kind == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7 || (type->kind == 13 && type->type->kind == 1)))
 {
 struct Identifier * id = exp->member.member;
 int typeKind = type->kind;
@@ -13927,8 +14138,39 @@ if(typeKind == 19 && exp->member.exp->type == 26)
 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
 typeKind = 8;
 }
-if(id && (typeKind == 3 || typeKind == 15))
+if(id)
+{
+if(typeKind == 3 || typeKind == 15)
 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
+else if(!_class)
+{
+if(type->kind == 8 && type->_class && type->_class->registered)
+{
+_class = type->_class->registered;
+}
+else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
+{
+_class = FindClass("char *")->registered;
+}
+else if(type->kind == 13)
+{
+_class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
+FreeType(exp->expType);
+exp->expType = ProcessTypeString("uintptr", 0x0);
+exp->byReference = 0x1;
+}
+else
+{
+char string[1024] = "";
+struct Symbol * classSym;
+
+PrintTypeNoConst(type, string, 0x0, 0x1);
+classSym = FindClass(string);
+if(classSym)
+_class = classSym->registered;
+}
+}
+}
 if(_class && id)
 {
 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
@@ -13984,7 +14226,7 @@ member = (((void *)0));
 }
 }
 }
-if(!prop && !member)
+if(!prop && !member && !method)
 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
 if(!prop && !member && !method)
 {
@@ -14067,13 +14309,16 @@ exp->expType = MkClassType(revConvert->_class->fullName);
 }
 else if(method)
 {
-if(inCompiler)
 {
 exp->member.memberType = 2;
 }
 if(!method->dataType)
 ProcessMethodType(method);
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
+});
 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
 exp->expType->usedClass = _class;
 }
@@ -14191,7 +14436,11 @@ FreeType(basicType);
 basicType = ReplaceThisClassType(_class);
 }
 FreeType(exp->expType);
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = basicType, ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
+});
 if(!exp->destType)
 {
 exp->destType = exp->expType;
@@ -14437,14 +14686,22 @@ exp->member.member = MkIdentifier("structSize");
 }
 }
 }
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
+});
 break;
 }
 case 10:
 {
 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
 
-exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
+});
 exp->isConstant = 0x1;
 DeclareType(type, 0x0, 0x0);
 FreeType(type);
@@ -14454,12 +14711,12 @@ case 11:
 {
 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
 
-type->count = (unsigned int)1;
+type->count = 1;
 FreeType(exp->cast.exp->destType);
 exp->cast.exp->destType = type;
 type->refCount++;
 ProcessExpressionType(exp->cast.exp);
-type->count = (unsigned int)0;
+type->count = 0;
 exp->expType = type;
 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
 {
@@ -14491,7 +14748,6 @@ case 35:
 {
 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
 
-type->refCount++;
 exp->expType = type;
 break;
 }
@@ -14500,7 +14756,6 @@ case 36:
 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
 
 ProcessExpressionType(exp->vaArg.exp);
-type->refCount++;
 exp->expType = type;
 break;
 }
@@ -14556,8 +14811,8 @@ if(exp->destType)
 exp->destType->refCount++;
 }
 ProcessStatement(exp->compound);
-exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
-if(((struct Expression *)(*last->expressions).last)->expType)
+exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
+if(exp->expType)
 exp->expType->refCount++;
 }
 break;
@@ -14661,7 +14916,7 @@ e->expType = (((void *)0));
 if(type)
 {
 typeStringBuf[0] = '\0';
-PrintType(type, typeStringBuf, 0x0, 0x1);
+PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
 typeString = typeStringBuf;
 FreeType(type);
 type = (((void *)0));
@@ -14702,7 +14957,11 @@ ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
-ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), ((struct Expression *)__ecereTemp1))));
+ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
+struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
+
+__ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
+})));
 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
@@ -14880,8 +15139,9 @@ __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
 }
 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
 }
+if(inCompiler)
 ApplyAnyObjectLogic(exp);
-if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
+if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5 && (!exp->destType || (exp->destType->kind != 3 && exp->destType->kind != 4 && exp->destType->kind != 22 && exp->destType->kind != 23 && exp->destType->kind != 5 && exp->destType->kind != 2 && exp->destType->kind != 1)))
 {
 exp->byReference = 0x1;
 }
@@ -15684,7 +15944,7 @@ FreeType(type);
 }
 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
-ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
+ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
 FreeList(exp, FreeExpression);
 }
 else
@@ -16109,8 +16369,6 @@ extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct
 
 static void ProcessFunction(struct FunctionDefinition * function)
 {
-void * __ecereTemp2;
-void * __ecereTemp1;
 struct Identifier * id = GetDeclId(function->declarator);
 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
 struct Type * type = symbol ? symbol->type : (((void *)0));
@@ -16192,7 +16450,11 @@ if(type->classObjectType != 1)
 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
 }
-thisParam = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), ((struct TypeName *)__ecereTemp1)->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), ((struct TypeName *)__ecereTemp1)->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), ((struct TypeName *)__ecereTemp1));
+thisParam = __extension__ ({
+struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
+
+__ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
 }
 }
@@ -16232,12 +16494,17 @@ if(function->body)
 {
 if(type->classObjectType != 1)
 {
-thisSymbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("this"), ((struct Symbol *)__ecereTemp1)->type = classSym ? MkClassType(classSym->string) : (((void *)0)), ((struct Symbol *)__ecereTemp1));
+thisSymbol = __extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
 if(typedObject && thisSymbol->type)
 {
 thisSymbol->type->classObjectType = 2;
 thisSymbol->type->byReference = type->byReference;
+thisSymbol->type->typedByReference = type->byReference;
 }
 }
 }
@@ -16290,7 +16557,15 @@ else
 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
 }
 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
-exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 0, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
+exp->expType = __extension__ ({
+struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
+struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
+}), __ecereInstance2;
+});
 if(function->body)
 {
 yylloc = function->body->loc;
@@ -16489,7 +16764,6 @@ extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
 
 void ComputeDataTypes()
 {
-void * __ecereTemp1;
 struct External * external;
 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
 struct External * after = (((void *)0));
@@ -16532,7 +16806,11 @@ after = external;
 }
 }
 }
-temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
+temp->symbol = __extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
 curExternal = temp;
 DeclareFunctionUtil("eSystem_New");
@@ -16589,7 +16867,7 @@ thisNameSpace = (((void *)0));
 
 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(char *  name, char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
 
-extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
+extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
 
 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
 {
@@ -16664,6 +16942,7 @@ __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "voi
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);