compiler/libec: (#341, #351, #644, #771) Improved enum type matching and type handlin...
authorJerome St-Louis <jerome@ecere.com>
Mon, 26 May 2014 18:15:49 +0000 (14:15 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 27 May 2014 01:10:55 +0000 (21:10 -0400)
ecere, ide, eda, samples: Fixed related warnings
- Solved enum types popping up in auto-complete when they shouldn't, e.g. when there are available conversions through base types (#341, #351)
- Fixed issues encountered in samples/games/CornerBlocks (#644)
- An eC enum type minus an eC enum type will give an int rather than en enum
- Validating constant expressions assigned to an enum based on max value, otherwise warning as incompatible (affects bool as well)
- Not applying unit destination type to operands of an operator expression if the unit type is the base unit class (e.g. Angle rather than Radians) (#771)
- Added a conversion property from MinMaxValue to AnchorValue, as it is common to use size values to specify anchors values and it would
  no longer go through the 'int' conversion property

95 files changed:
compiler/bootstrap/ecc/bootstrap/ecc.c
compiler/bootstrap/ecc/bootstrap/ecc.main.c
compiler/bootstrap/ecere/bootstrap/AVLTree.c
compiler/bootstrap/ecere/bootstrap/Array.c
compiler/bootstrap/ecere/bootstrap/BTNode.c
compiler/bootstrap/ecere/bootstrap/BinaryTree.c
compiler/bootstrap/ecere/bootstrap/BufferedFile.c
compiler/bootstrap/ecere/bootstrap/BuiltInContainer.c
compiler/bootstrap/ecere/bootstrap/Container.c
compiler/bootstrap/ecere/bootstrap/CustomAVLTree.c
compiler/bootstrap/ecere/bootstrap/DualPipe.c
compiler/bootstrap/ecere/bootstrap/File.c
compiler/bootstrap/ecere/bootstrap/LinkList.c
compiler/bootstrap/ecere/bootstrap/List.c
compiler/bootstrap/ecere/bootstrap/Map.c
compiler/bootstrap/ecere/bootstrap/OldList.c
compiler/bootstrap/ecere/bootstrap/String.c
compiler/bootstrap/ecere/bootstrap/System.c
compiler/bootstrap/ecere/bootstrap/TempFile.c
compiler/bootstrap/ecere/bootstrap/dataTypes.c
compiler/bootstrap/ecere/bootstrap/ecere.main.c
compiler/bootstrap/ecere/bootstrap/i18n.c
compiler/bootstrap/ecere/bootstrap/instance.c
compiler/bootstrap/ecere/bootstrap/memory.c
compiler/bootstrap/ecp/bootstrap/ecp.c
compiler/bootstrap/ecp/bootstrap/ecp.main.c
compiler/bootstrap/ecs/bootstrap/ecs.c
compiler/bootstrap/ecs/bootstrap/ecs.main.c
compiler/bootstrap/libec/bootstrap/ast.c
compiler/bootstrap/libec/bootstrap/copy.c
compiler/bootstrap/libec/bootstrap/dbpass.c
compiler/bootstrap/libec/bootstrap/ec.main.c
compiler/bootstrap/libec/bootstrap/ecdefs.c
compiler/bootstrap/libec/bootstrap/expression.c
compiler/bootstrap/libec/bootstrap/firstPass.c
compiler/bootstrap/libec/bootstrap/freeAst.c
compiler/bootstrap/libec/bootstrap/grammar.c
compiler/bootstrap/libec/bootstrap/lexer.c
compiler/bootstrap/libec/bootstrap/loadSymbols.c
compiler/bootstrap/libec/bootstrap/output.c
compiler/bootstrap/libec/bootstrap/pass0.c
compiler/bootstrap/libec/bootstrap/pass1.c
compiler/bootstrap/libec/bootstrap/pass15.c
compiler/bootstrap/libec/bootstrap/pass16.c
compiler/bootstrap/libec/bootstrap/pass2.c
compiler/bootstrap/libec/bootstrap/pass3.c
compiler/bootstrap/libec/bootstrap/shortcuts.c
compiler/bootstrap/libec/bootstrap/type.c
compiler/ecp/ecp.ec
compiler/ecs/ecs.ec
compiler/libec/precompiled/expression.c
compiler/libec/precompiled/grammar.c
compiler/libec/precompiled/type.c
compiler/libec/src/copy.ec
compiler/libec/src/ecdefs.ec
compiler/libec/src/pass15.ec
compiler/libec/src/pass16.ec
compiler/libec/src/pass3.ec
ecere/src/com/instance.ec
ecere/src/gfx/3D/models/Object3DSFormat.ec
ecere/src/gfx/Color.ec
ecere/src/gfx/drivers/Direct3D9DisplayDriver.ec
ecere/src/gfx/drivers/LFBDisplayDriver.ec
ecere/src/gfx/drivers/OpenGLDisplayDriver.ec
ecere/src/gui/Anchor.ec
ecere/src/gui/controls/EditBox.ec
ecere/src/gui/drivers/Win32ConsoleInterface.ec
ecere/src/gui/drivers/XInterface.ec
ecere/src/net/HTTPFile.ec
ecere/src/net/dcom.ec
ecere/src/sys/DualPipe.ec
ecere/src/sys/EARArchive.ec
ecere/src/sys/File.ec
ecere/src/sys/TempFile.ec
eda/drivers/sqlite/EDASQLite.ec
extras/Regex.ec
extras/gui/skins/SimSkin.ec
extras/html/htmlParser.ec
ide/src/IDESettings.ec
ide/src/project/Project.ec
samples/db/MedDB/mainForm.ec
samples/eC/neural/neural.ec
samples/games/cards/poker/pokerUtils.ec
samples/games/chess/src/about.ec
samples/games/chess/src/ai.ec
samples/games/chess/src/chess2D.ec
samples/games/chess/src/chess3D.ec
samples/games/chess/src/chessutils.ec
samples/games/chess/src/promotion.ec
samples/games/cornerBlocks/cornerBlocks.ec
samples/games/crosswords/CrossWordsServer.ec
samples/games/othello/Othello.epj
samples/games/othello/othello.ec
samples/guiAndGfx/fractals/fractals.ec
samples/net/XMLSample/xmlSample.ec

index 6c17904..f7f1237 100644 (file)
@@ -273,7 +273,7 @@ char *  name;
 struct __ecereNameSpace__ecere__sys__OldList methods;
 struct __ecereNameSpace__ecere__sys__OldList properties;
 unsigned int itself;
-unsigned int isRemote;
+int isRemote;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
@@ -385,7 +385,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -1051,7 +1051,7 @@ printf(__ecereNameSpace__ecere__GetTranslatedString("ecc", "Syntax:\n   ecc [-t
 else
 {
 struct __ecereNameSpace__ecere__com__Instance * cppOutput;
-char command[3075LL];
+char command[3075];
 
 SetGlobalData(&globalData);
 SetExcludedSymbols(&_excludedSymbols);
@@ -1064,7 +1064,7 @@ SetInCompiler(0x1);
 SetTargetPlatform(targetPlatform);
 SetTargetBits(targetBits);
 SetEchoOn(0x0);
-privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize(0x1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? (unsigned int)2 : targetBits == 32 ? (unsigned int)4 : (unsigned int)0) | (unsigned int)8, 1, (((void *)0)));
+privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize((unsigned int)(0x1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? 2 : targetBits == 32 ? 4 : (unsigned int)0) | 8), 1, (((void *)0)));
 SetPrivateModule(privateModule);
 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
@@ -1120,8 +1120,8 @@ struct GlobalData * data = (data = __ecereNameSpace__ecere__com__eInstance_New(_
 data->key = (uintptr_t)data->fullName;
 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalData.functions, (struct __ecereNameSpace__ecere__sys__BTNode *)data);
 }
-snprintf(command, sizeof command, "%s%s -x c -E %s\"%s\"", cppCommand, cppOptions ? cppOptions : "", buildingBootStrap ? "" : "-include stdint.h -include sys/types.h ", GetSourceFile());
-command[sizeof command - 1] = (char)0;
+snprintf(command, sizeof (command), "%s%s -x c -E %s\"%s\"", cppCommand, cppOptions ? cppOptions : "", buildingBootStrap ? "" : "-include stdint.h -include sys/types.h ", GetSourceFile());
+command[sizeof (command) - 1] = (char)0;
 if((cppOutput = __ecereNameSpace__ecere__sys__DualPipeOpen((((unsigned int)(0x1))), command)))
 {
 char impFile[797];
index 3b021a5..88e547f 100644 (file)
@@ -292,7 +292,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 2a8c996..aa2334e 100644 (file)
@@ -115,7 +115,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index d4cb0d0..714aa58 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 1089aa8..69a864e 100644 (file)
@@ -119,7 +119,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 4764af7..79efc04 100644 (file)
@@ -121,7 +121,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 90516c3..4532f9a 100644 (file)
@@ -115,7 +115,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 3098c86..62ddb19 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 72ae8e1..aba1b74 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index bcd3c0b..5b9e239 100644 (file)
@@ -117,7 +117,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index e26a7da..0732084 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -437,7 +437,7 @@ unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetSize(struct
 {
 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
 
-return (__ecereProp___ecereNameSpace__ecere__sys__File_Get_input(this) || __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this)) ? (unsigned int)((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_GetSize])(this) : DualPipe_GetSize(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
+return (__ecereProp___ecereNameSpace__ecere__sys__File_Get_input(this) || __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this)) ? ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_GetSize])(this) : DualPipe_GetSize(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
 }
 
 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Peek(struct __ecereNameSpace__ecere__com__Instance * this)
index c07dcd8..ac2ce84 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -672,7 +672,7 @@ unsigned int __ecereMethod___ecereNameSpace__ecere__sys__File_Eof(struct __ecere
 {
 struct __ecereNameSpace__ecere__sys__File * __ecerePointer___ecereNameSpace__ecere__sys__File = (struct __ecereNameSpace__ecere__sys__File *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__File->offset) : 0);
 
-return __ecerePointer___ecereNameSpace__ecere__sys__File->input ? (unsigned int)feof(__ecerePointer___ecereNameSpace__ecere__sys__File->input) : 0x1;
+return __ecerePointer___ecereNameSpace__ecere__sys__File->input ? feof(__ecerePointer___ecereNameSpace__ecere__sys__File->input) != 0 : 0x1;
 }
 
 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__File_Truncate(struct __ecereNameSpace__ecere__com__Instance * this, unsigned int size)
index 1c55b04..f9e2185 100644 (file)
@@ -115,7 +115,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 2741269..223849a 100644 (file)
@@ -115,7 +115,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index cea7a99..3ae7c6b 100644 (file)
@@ -115,7 +115,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index f24122f..b4160d3 100644 (file)
@@ -113,7 +113,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 781a33e..733ef01 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -561,7 +561,7 @@ c = 1;
 }
 for(; addedPath[c]; )
 {
-char directory[4384LL];
+char directory[4384];
 int len = 0;
 char ch;
 int count;
@@ -770,7 +770,7 @@ c = 1;
 }
 for(; addedPath[c]; )
 {
-char directory[4384LL];
+char directory[4384];
 int len = 0;
 char ch;
 int count;
@@ -901,8 +901,8 @@ if(!path[0])
 memmove(destination, path, strlen(path) + 1);
 else
 {
-char pathPart[4384LL], pathRest[797];
-char toPart[4384LL], toRest[797];
+char pathPart[4384], pathRest[797];
+char toPart[4384], toRest[797];
 unsigned int different = 0x0;
 
 strcpy(pathRest, path);
index 11eb6bf..d7ff5f9 100644 (file)
@@ -115,7 +115,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index ce9b0cc..0545509 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -497,7 +497,7 @@ unsigned int __ecereMethod___ecereNameSpace__ecere__sys__TempFile_GetSize(struct
 {
 struct __ecereNameSpace__ecere__sys__TempFile * __ecerePointer___ecereNameSpace__ecere__sys__TempFile = (struct __ecereNameSpace__ecere__sys__TempFile *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__TempFile->offset) : 0);
 
-return (unsigned int)__ecerePointer___ecereNameSpace__ecere__sys__TempFile->size;
+return __ecerePointer___ecereNameSpace__ecere__sys__TempFile->size;
 }
 
 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__TempFile_Truncate(struct __ecereNameSpace__ecere__com__Instance * this, unsigned int size)
@@ -507,7 +507,7 @@ struct __ecereNameSpace__ecere__sys__TempFile * __ecerePointer___ecereNameSpace_
 __ecerePointer___ecereNameSpace__ecere__sys__TempFile->buffer = __ecereNameSpace__ecere__com__eSystem_Renew(__ecerePointer___ecereNameSpace__ecere__sys__TempFile->buffer, sizeof(unsigned char) * (size));
 __ecerePointer___ecereNameSpace__ecere__sys__TempFile->size = (unsigned int)size;
 __ecerePointer___ecereNameSpace__ecere__sys__TempFile->allocated = (unsigned int)size;
-if(__ecerePointer___ecereNameSpace__ecere__sys__TempFile->position > (unsigned int)size)
+if(__ecerePointer___ecereNameSpace__ecere__sys__TempFile->position > size)
 __ecerePointer___ecereNameSpace__ecere__sys__TempFile->position = (unsigned int)size;
 return 0x1;
 }
index 42b3354..dcd25a1 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index f8dc0ee..3639962 100644 (file)
@@ -104,7 +104,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 3b773ba..298995a 100644 (file)
@@ -114,7 +114,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 0bc50c6..6b06537 100644 (file)
@@ -123,7 +123,7 @@ unsigned int noExpansion;
 char * defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void * data;
 unsigned int computeSize;
@@ -1470,9 +1470,9 @@ struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSyst
 {
 int start = 0, c;
 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace = (((void *)0));
-unsigned int force64Bits = ((unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 2) ? 0x1 : 0x0;
-unsigned int force32Bits = ((unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 4) ? 0x1 : 0x0;
-unsigned int inCompiler = ((unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 8) ? 0x1 : 0x0;
+unsigned int force64Bits = (((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 2) ? 0x1 : 0x0;
+unsigned int force32Bits = (((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 4) ? 0x1 : 0x0;
+unsigned int inCompiler = (((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 8) ? 0x1 : 0x0;
 unsigned int crossBits = force32Bits || force64Bits;
 unsigned int fixed = 0x0;
 
@@ -3617,7 +3617,7 @@ if(_class)
 {
 {
 int size = _class->structSize;
-int flags = (unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)_class->module + structSize_Instance)))->application + structSize_Module)))->isGUIApp;
+int flags = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)_class->module + structSize_Instance)))->application + structSize_Module)))->isGUIApp;
 unsigned int inCompiler = (flags & 8) ? 0x1 : 0x0;
 unsigned int force32Bits = (flags & 4) ? 0x1 : 0x0;
 
@@ -5032,7 +5032,7 @@ if(instance && _property && _property->isWatchable)
 {
 struct __ecereNameSpace__ecere__com__Instance * module = ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class ? ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class->module : (((void *)0));
 struct __ecereNameSpace__ecere__com__Instance * application = module ? ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application : (((void *)0));
-int flags = application ? (unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)application + structSize_Module)))->isGUIApp : 0;
+int flags = application ? ((struct __ecereNameSpace__ecere__com__Application *)(((char *)application + structSize_Module)))->isGUIApp : 0;
 unsigned int inCompiler = (flags & 8) ? 0x1 : 0x0;
 unsigned int force32Bits = (flags & 4) ? 0x1 : 0x0;
 
@@ -5292,9 +5292,9 @@ extern int isprint(int c);
 
 static void __ecereNameSpace__ecere__com__LoadCOM(struct __ecereNameSpace__ecere__com__Instance * module)
 {
-unsigned int force64Bits = ((unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 2) ? 0x1 : 0x0;
-unsigned int force32Bits = ((unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 4) ? 0x1 : 0x0;
-unsigned int inCompiler = ((unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 8) ? 0x1 : 0x0;
+unsigned int force64Bits = (((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 2) ? 0x1 : 0x0;
+unsigned int force32Bits = (((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 4) ? 0x1 : 0x0;
+unsigned int inCompiler = (((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application + structSize_Module)))->isGUIApp & 8) ? 0x1 : 0x0;
 int pointerSize = force64Bits ? 8 : force32Bits ? 4 : sizeof(void *);
 struct __ecereNameSpace__ecere__com__Class * applicationClass;
 struct __ecereNameSpace__ecere__com__Class * enumClass, * structClass, * boolClass;
@@ -5334,8 +5334,8 @@ structClass->structSize = 0;
 structClass->typeSize = 0;
 __ecereNameSpace__ecere__com__InitializeDataTypes(module);
 boolClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(4, "bool", "uint", 0, 0, (((void *)0)), (((void *)0)), module, 4, 1);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(boolClass, "true", (unsigned int)0x1);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(boolClass, "false", (unsigned int)0x0);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(boolClass, "true", 0x1);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(boolClass, "false", 0x0);
 moduleClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "ecere::com::Module", (((void *)0)), force64Bits ? 8 + 32 + 32 + 32 + 32 + 8 + 8 + 8 + 8 + 8 + 4 + 4 + (32 + 8 + 8 + 4 * 32) + (32 + 8 + 8 + 4 * 32) : sizeof(struct __ecereNameSpace__ecere__com__Module), 0, (void *)__ecereNameSpace__ecere__com__Module_Constructor, (void *)__ecereNameSpace__ecere__com__Module_Destructor, module, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(moduleClass, "OnLoad", "bool()", (((void *)0)), 1);
 __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(moduleClass, "OnUnload", "void()", (((void *)0)), 1);
@@ -6363,7 +6363,7 @@ __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "noExpansion", "bool",
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "defaultProperty", "char *", arch_PointerSize, arch_PointerSize, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "comRedefinition", "bool", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "count", "int", 4, 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "isRemote", "bool", 4, 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "isRemote", "int", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "internalDecl", "bool", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "data", "void *", arch_PointerSize, arch_PointerSize, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "computeSize", "bool", 4, 4, 1);
index 5a3136e..93d0452 100644 (file)
@@ -104,7 +104,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index d590bc8..19db101 100644 (file)
@@ -377,6 +377,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -731,7 +732,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -2813,7 +2814,7 @@ printf(__ecereNameSpace__ecere__GetTranslatedString("ecp", "Syntax:\n   ecp [-t
 else
 {
 struct __ecereNameSpace__ecere__com__Instance * cppOutput;
-char command[3075LL];
+char command[3075];
 
 SetGlobalData(&globalData);
 SetExcludedSymbols(&_excludedSymbols);
@@ -2827,7 +2828,7 @@ SetPrecompDefines(&precompDefines);
 SetTargetPlatform(targetPlatform);
 SetTargetBits(targetBits);
 SetEchoOn(0x0);
-privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize(0x1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? (unsigned int)2 : targetBits == 32 ? (unsigned int)4 : (unsigned int)0) | (unsigned int)8, 1, (((void *)0)));
+privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize((unsigned int)(0x1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? 2 : targetBits == 32 ? 4 : (unsigned int)0) | 8), 1, (((void *)0)));
 SetPrivateModule(privateModule);
 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
@@ -2880,8 +2881,8 @@ char * outputFilePath = GetOutputFile();
 if(__ecereNameSpace__ecere__sys__FileExists(outputFilePath))
 __ecereNameSpace__ecere__sys__DeleteFile(outputFilePath);
 }
-snprintf(command, sizeof command, "%s%s -x c -E \"%s\"", cppCommand, cppOptions ? cppOptions : "", GetSourceFile());
-command[sizeof command - 1] = (char)0;
+snprintf(command, sizeof (command), "%s%s -x c -E \"%s\"", cppCommand, cppOptions ? cppOptions : "", GetSourceFile());
+command[sizeof (command) - 1] = (char)0;
 if((cppOutput = __ecereNameSpace__ecere__sys__DualPipeOpen((((unsigned int)(0x1))), command)))
 {
 int exitCode;
index 6bd176b..bfea083 100644 (file)
@@ -292,7 +292,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index e002072..ff7d303 100644 (file)
@@ -260,7 +260,7 @@ char *  name;
 struct __ecereNameSpace__ecere__sys__OldList methods;
 struct __ecereNameSpace__ecere__sys__OldList properties;
 unsigned int itself;
-unsigned int isRemote;
+int isRemote;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
@@ -432,7 +432,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -718,7 +718,7 @@ _class->itself = 0x1;
 }
 else if(!strcmp(line, "[Remote]"))
 {
-_class->isRemote = (unsigned int)1;
+_class->isRemote = 1;
 }
 else if(!strcmp(line, "[Imported Methods]"))
 {
@@ -2083,7 +2083,7 @@ struct __ecereNameSpace__ecere__com__Class * _class;
 
 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)privateModule + structSize_Instance)))->classes.first; _class; _class = _class->next)
 {
-if(_class->isRemote == (unsigned int)3)
+if(_class->isRemote == 3)
 break;
 }
 if(_class)
@@ -2096,7 +2096,7 @@ f = dcomSymbols;
 DeclareClass(FindClass("ecere::net::DCOMServerObject"), "__ecereClass___ecereNameSpace__ecere__net__DCOMServerObject");
 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)privateModule + structSize_Instance)))->classes.first; _class; _class = _class->next)
 {
-if(_class->isRemote == (unsigned int)3)
+if(_class->isRemote == 3)
 {
 struct __ecereNameSpace__ecere__com__Method * method;
 int id = 0;
@@ -2675,7 +2675,7 @@ SetCurrentContext(theGlobalContext);
 SetTargetPlatform(targetPlatform);
 SetTargetBits(targetBits);
 SetInSymbolGen(0x1);
-privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize(0x1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? (unsigned int)2 : targetBits == 32 ? (unsigned int)4 : (unsigned int)0) | (unsigned int)8, 1, (((void *)0)));
+privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize((unsigned int)(0x1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? 2 : targetBits == 32 ? 4 : (unsigned int)0) | 8), 1, (((void *)0)));
 SetPrivateModule(privateModule);
 mainModule = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleImport);
 SetMainModule(mainModule);
index 0fd8638..aefaac3 100644 (file)
@@ -292,7 +292,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 878d90c..03390d5 100644 (file)
@@ -493,6 +493,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -873,7 +874,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -3120,7 +3121,7 @@ return spec;
 else
 symbol = FindClass(name);
 }
-if(symbol && symbol->registered && symbol->registered->isRemote == (unsigned int)1)
+if(symbol && symbol->registered && symbol->registered->isRemote == 1)
 {
 char className[1024];
 
index 7afeaa5..3a7f410 100644 (file)
@@ -454,6 +454,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -754,7 +755,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -1161,6 +1162,7 @@ exp->destType->refCount++;
 result->loc = exp->loc;
 result->isConstant = exp->isConstant;
 result->byReference = exp->byReference;
+result->opDestType = exp->opDestType;
 }
 return result;
 }
index a6d25e2..0799e55 100644 (file)
@@ -467,6 +467,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -764,7 +765,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index ada73dd..a509287 100644 (file)
@@ -285,7 +285,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 808ecf7..088008c 100644 (file)
@@ -483,6 +483,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
@@ -690,7 +691,7 @@ char * name;
 struct __ecereNameSpace__ecere__sys__OldList methods;
 struct __ecereNameSpace__ecere__sys__OldList properties;
 unsigned int itself;
-unsigned int isRemote;
+int isRemote;
 } __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
@@ -855,7 +856,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -1608,6 +1609,7 @@ this->isConstant = 0x0;
 this->addedThis = 0x0;
 this->needCast = 0x0;
 this->thisPtr = 0x0;
+this->opDestType = 0x0;
 }
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_DeclaratorType;
@@ -2477,6 +2479,7 @@ __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "isConstant", "bool",
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "addedThis", "bool", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "needCast", "bool", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "thisPtr", "bool", 4, 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "opDestType", "bool", 4, 4, 1);
 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Enumerator", 0, sizeof(struct Enumerator), 0, 0, 0, module, 1, 1);
 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
 __ecereClass_Enumerator = class;
@@ -2953,7 +2956,7 @@ __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "name", "char *", arch
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "methods", "ecere::sys::OldList", structSize_OldList, arch_PointerSize, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "properties", "ecere::sys::OldList", structSize_OldList, arch_PointerSize, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "itself", "bool", 4, 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "isRemote", "bool", 4, 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "isRemote", "int", 4, 4, 1);
 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "FunctionImport", 0, sizeof(struct FunctionImport), 0, 0, 0, module, 1, 1);
 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
 __ecereClass_FunctionImport = class;
index 9ab737b..e9ccd12 100644 (file)
@@ -449,6 +449,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -620,7 +621,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index c025b2c..63edbc4 100644 (file)
@@ -365,6 +365,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -707,7 +708,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index e35315d..4320a24 100644 (file)
@@ -492,6 +492,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -709,7 +710,7 @@ char *  name;
 struct __ecereNameSpace__ecere__sys__OldList methods;
 struct __ecereNameSpace__ecere__sys__OldList properties;
 unsigned int itself;
-unsigned int isRemote;
+int isRemote;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
@@ -881,7 +882,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index f2430d1..35c3a2c 100644 (file)
@@ -463,6 +463,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -748,7 +749,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index f83b3f6..97f0444 100644 (file)
@@ -295,7 +295,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 4a614fc..867eee2 100644 (file)
@@ -310,6 +310,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -469,7 +470,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -1088,7 +1089,7 @@ if(!isRemote || (importType != 2) || (!sourceFile || !strstr(sourceFile, ".main.
 if(!regClass || regClass->internalDecl)
 regClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(classType, name, isRemote ? (((void *)0)) : baseName, 0, 0, (((void *)0)), (((void *)0)), privateModule, ecereCOMModule ? 4 : 1, inheritanceAccess);
 if(regClass && isRemote)
-regClass->isRemote = (importType == 2) ? (unsigned int)1 : (unsigned int)2;
+regClass->isRemote = (importType == 2) ? 1 : 2;
 if(isRemote)
 {
 if(importType == 2)
@@ -1101,7 +1102,7 @@ existingClass = DeclClass(0, name);
 regClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(classType, className, baseName, 0, 0, (((void *)0)), (((void *)0)), privateModule, ecereCOMModule ? 4 : 1, inheritanceAccess);
 }
 if(regClass)
-regClass->isRemote = (importType == 2) ? (unsigned int)1 : (unsigned int)3;
+regClass->isRemote = (importType == 2) ? 1 : 3;
 }
 if(existingClass)
 {
@@ -1241,7 +1242,7 @@ __ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof (line))
 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
 if(regClass)
 {
-struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, conversion ? (((void *)0)) : name, line[0] ? line : 0, (void *)(unsigned int)setStmt, (void *)(unsigned int)getStmt, memberAccess);
+struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, conversion ? (((void *)0)) : name, line[0] ? line : 0, (void *)setStmt, (void *)getStmt, memberAccess);
 
 if(prop)
 {
@@ -1298,7 +1299,7 @@ __ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof (line))
 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
 if(regClass)
 {
-__ecereNameSpace__ecere__com__eClass_AddClassProperty(regClass, name, line, (void *)(unsigned int)setStmt, (void *)(unsigned int)getStmt);
+__ecereNameSpace__ecere__com__eClass_AddClassProperty(regClass, name, line, (void *)setStmt, (void *)getStmt);
 }
 }
 else if(!strcmp(line, "[Set]"))
index 8526f05..533db41 100644 (file)
@@ -468,6 +468,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -820,7 +821,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 45ee4eb..c1af7f0 100644 (file)
@@ -478,6 +478,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -804,7 +805,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index e147267..fdc05b0 100644 (file)
@@ -462,6 +462,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -820,7 +821,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 4019e83..41ec3f3 100644 (file)
@@ -488,6 +488,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -679,7 +680,7 @@ char *  name;
 struct __ecereNameSpace__ecere__sys__OldList methods;
 struct __ecereNameSpace__ecere__sys__OldList properties;
 unsigned int itself;
-unsigned int isRemote;
+int isRemote;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
@@ -851,7 +852,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -4880,7 +4881,7 @@ struct Conversion * after = (conversions != (((void *)0))) ? conversions->last :
 
 if(!convert->dataType)
 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
-if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
+if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 0x1 : 0x0, convert->dataType->kind == 8, 0x0, 0x1))
 {
 if(!conversions && !convert->Get)
 return 0x1;
@@ -4941,7 +4942,7 @@ if(!dest->_class->registered->dataType)
 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
 {
-if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
+if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, dest->_class->registered->dataType->kind == 8, 0x0, 0x0))
 {
 return 0x1;
 }
@@ -4964,7 +4965,7 @@ struct Conversion * after = (conversions != (((void *)0))) ? conversions->last :
 
 if(!convert->dataType)
 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
-if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
+if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0x0, 0x1))
 {
 if(!conversions && !convert->Get)
 return 0x1;
@@ -4988,8 +4989,11 @@ if(enumBaseType && source->_class && source->_class->registered && source->_clas
 {
 if(!source->_class->registered->dataType)
 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
-if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
+if(!isConversionExploration || source->_class->registered->dataType->kind == 8 || !strcmp(source->_class->registered->name, "String"))
 {
+if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->_class->registered->dataType->kind == 8, source->_class->registered->dataType->kind == 8, 0x0, 0x0))
+return 0x1;
+else if(MatchTypes(dest, source->_class->registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
 return 0x1;
 }
 }
@@ -5013,7 +5017,7 @@ else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->k
 return 0x1;
 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
 return 0x1;
-else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
+else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
 return 0x1;
 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->type->kind == 11) || source->kind == 16)))
 {
@@ -5366,6 +5370,8 @@ return 0x1;
 return 0x0;
 }
 
+extern struct Expression * CopyExpression(struct Expression * exp);
+
 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
 
 void ReadString(char *  output, char *  string);
@@ -5378,12 +5384,28 @@ 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)
 {
-struct Type * source = sourceExp->expType;
+struct Type * source;
 struct Type * realDest = dest;
 struct Type * backupSourceExpType = (((void *)0));
+struct Expression * computedExp = sourceExp;
 
+dest->refCount++;
+if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
+{
+computedExp = CopyExpression(sourceExp);
+ComputeExpression(computedExp);
+}
+source = sourceExp->expType;
 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
+{
+if(computedExp != sourceExp)
+{
+FreeExpression(computedExp);
+computedExp = sourceExp;
+}
+FreeType(dest);
 return 0x1;
+}
 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
 {
 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
@@ -5395,9 +5417,17 @@ for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && s
 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
 ;
 if(sourceBase == destBase)
+{
+if(computedExp != sourceExp)
+{
+FreeExpression(computedExp);
+computedExp = sourceExp;
+}
+FreeType(dest);
 return 0x1;
 }
 }
+}
 if(source)
 {
 struct __ecereNameSpace__ecere__sys__OldList * specs;
@@ -5405,20 +5435,24 @@ unsigned int flag = 0x0;
 long long value = (((int)0x7fffffff));
 
 source->refCount++;
-dest->refCount++;
-if(sourceExp->type == 2)
+if(computedExp->type == 2)
 {
 if(source->isSigned)
-value = strtoll(sourceExp->constant, (((void *)0)), 0);
+value = strtoll(computedExp->constant, (((void *)0)), 0);
 else
-value = strtoull(sourceExp->constant, (((void *)0)), 0);
+value = strtoull(computedExp->constant, (((void *)0)), 0);
 }
-else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
+else if(computedExp->type == 4 && sourceExp->op.op == '-' && !computedExp->op.exp1 && computedExp->op.exp2 && computedExp->op.exp2->type == 2)
 {
 if(source->isSigned)
-value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
+value = -strtoll(computedExp->op.exp2->constant, (((void *)0)), 0);
 else
-value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
+value = -strtoull(computedExp->op.exp2->constant, (((void *)0)), 0);
+}
+if(computedExp != sourceExp)
+{
+FreeExpression(computedExp);
+computedExp = sourceExp;
 }
 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
 {
@@ -5496,7 +5530,7 @@ else if(source->kind == 8)
 {
 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
 
-if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
+if(_class && (_class->type == 3 || _class->type == 2))
 {
 if(dest->kind != 8)
 {
@@ -5556,8 +5590,17 @@ return 0x1;
 if(dest->kind == 8)
 {
 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
+unsigned int fittingValue = 0x0;
 
-if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
+if(_class && _class->type == 4)
+{
+struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
+struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
+
+if(c && value >= 0 && value <= c->largest)
+fittingValue = 0x1;
+}
+if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
 {
 if(_class->type == 0 || _class->type == 5)
 {
@@ -5698,7 +5741,7 @@ sourceExp->expType = backupSourceExpType;
 }
 return 0x0;
 }
-if(!flag)
+if(!flag && !sourceExp->opDestType)
 {
 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
 
@@ -5737,6 +5780,11 @@ return 0x1;
 }
 else
 {
+if(computedExp != sourceExp)
+{
+FreeExpression(computedExp);
+computedExp = sourceExp;
+}
 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
 sourceExp = (*sourceExp->list).last;
 if(sourceExp->type == 0)
@@ -5778,6 +5826,7 @@ else
 sprintf(constant, "0x%X", (int)value->data);
 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
 }
+FreeType(dest);
 return 0x1;
 }
 }
@@ -5785,9 +5834,13 @@ return 0x1;
 }
 }
 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
+{
+FreeType(dest);
 return 0x1;
 }
 }
+FreeType(dest);
+}
 return 0x0;
 }
 
@@ -5796,7 +5849,7 @@ static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i + value2);
+exp->string = PrintInt((op1->i + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5811,7 +5864,7 @@ static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struc
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui + value2);
+exp->string = PrintUInt((op1->ui + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5826,7 +5879,7 @@ static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, stru
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 + value2);
+exp->string = PrintInt64((op1->i64 + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5841,7 +5894,7 @@ static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, str
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 + value2);
+exp->string = PrintUInt64((op1->ui64 + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5856,7 +5909,7 @@ static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, stru
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s + value2);
+exp->string = PrintShort((op1->s + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5871,7 +5924,7 @@ static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, str
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us + value2);
+exp->string = PrintUShort((op1->us + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5886,7 +5939,7 @@ static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struc
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c + value2);
+exp->string = PrintChar((op1->c + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5901,7 +5954,7 @@ static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, stru
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc + value2);
+exp->string = PrintUChar((op1->uc + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5916,7 +5969,7 @@ static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f + value2);
+exp->string = PrintFloat((float)(op1->f + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5931,7 +5984,7 @@ static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d + value2);
+exp->string = PrintDouble((double)(op1->d + value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5946,7 +5999,7 @@ static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i - value2);
+exp->string = PrintInt((op1->i - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5961,7 +6014,7 @@ static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struc
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui - value2);
+exp->string = PrintUInt((op1->ui - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5976,7 +6029,7 @@ static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, stru
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 - value2);
+exp->string = PrintInt64((op1->i64 - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -5991,7 +6044,7 @@ static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, str
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 - value2);
+exp->string = PrintUInt64((op1->ui64 - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6006,7 +6059,7 @@ static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, stru
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s - value2);
+exp->string = PrintShort((op1->s - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6021,7 +6074,7 @@ static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, str
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us - value2);
+exp->string = PrintUShort((op1->us - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6036,7 +6089,7 @@ static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struc
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c - value2);
+exp->string = PrintChar((op1->c - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6051,7 +6104,7 @@ static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, stru
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc - value2);
+exp->string = PrintUChar((op1->uc - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6066,7 +6119,7 @@ static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f - value2);
+exp->string = PrintFloat((float)(op1->f - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6081,7 +6134,7 @@ static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d - value2);
+exp->string = PrintDouble((double)(op1->d - value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6096,7 +6149,7 @@ static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i * value2);
+exp->string = PrintInt((op1->i * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6111,7 +6164,7 @@ static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struc
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui * value2);
+exp->string = PrintUInt((op1->ui * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6126,7 +6179,7 @@ static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, stru
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 * value2);
+exp->string = PrintInt64((op1->i64 * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6141,7 +6194,7 @@ static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, str
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 * value2);
+exp->string = PrintUInt64((op1->ui64 * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6156,7 +6209,7 @@ static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, stru
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s * value2);
+exp->string = PrintShort((op1->s * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6171,7 +6224,7 @@ static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, str
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us * value2);
+exp->string = PrintUShort((op1->us * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6186,7 +6239,7 @@ static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struc
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c * value2);
+exp->string = PrintChar((op1->c * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6201,7 +6254,7 @@ static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, stru
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc * value2);
+exp->string = PrintUChar((op1->uc * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6216,7 +6269,7 @@ static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f * value2);
+exp->string = PrintFloat((float)(op1->f * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6231,7 +6284,7 @@ static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d * value2);
+exp->string = PrintDouble((double)(op1->d * value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6906,7 +6959,7 @@ static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, stru
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i = value2);
+exp->string = PrintInt((op1->i = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6921,7 +6974,7 @@ static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, str
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui = value2);
+exp->string = PrintUInt((op1->ui = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6936,7 +6989,7 @@ static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, st
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 = value2);
+exp->string = PrintInt64((op1->i64 = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6951,7 +7004,7 @@ static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, s
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 = value2);
+exp->string = PrintUInt64((op1->ui64 = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6966,7 +7019,7 @@ static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, st
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s = value2);
+exp->string = PrintShort((op1->s = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6981,7 +7034,7 @@ static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, s
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us = value2);
+exp->string = PrintUShort((op1->us = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -6996,7 +7049,7 @@ static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, str
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c = value2);
+exp->string = PrintChar((op1->c = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7011,7 +7064,7 @@ static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, st
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc = value2);
+exp->string = PrintUChar((op1->uc = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7026,7 +7079,7 @@ static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, st
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f = value2);
+exp->string = PrintFloat((float)(op1->f = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7041,7 +7094,7 @@ static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, s
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d = value2);
+exp->string = PrintDouble((double)(op1->d = value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7056,7 +7109,7 @@ static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, s
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i += value2);
+exp->string = PrintInt((op1->i += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7071,7 +7124,7 @@ static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1,
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui += value2);
+exp->string = PrintUInt((op1->ui += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7086,7 +7139,7 @@ static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1,
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 += value2);
+exp->string = PrintInt64((op1->i64 += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7101,7 +7154,7 @@ static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 += value2);
+exp->string = PrintUInt64((op1->ui64 += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7116,7 +7169,7 @@ static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1,
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s += value2);
+exp->string = PrintShort((op1->s += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7131,7 +7184,7 @@ static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us += value2);
+exp->string = PrintUShort((op1->us += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7146,7 +7199,7 @@ static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1,
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c += value2);
+exp->string = PrintChar((op1->c += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7161,7 +7214,7 @@ static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1,
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc += value2);
+exp->string = PrintUChar((op1->uc += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7176,7 +7229,7 @@ static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1,
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f += value2);
+exp->string = PrintFloat((float)(op1->f += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7191,7 +7244,7 @@ static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d += value2);
+exp->string = PrintDouble((double)(op1->d += value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7206,7 +7259,7 @@ static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, s
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i -= value2);
+exp->string = PrintInt((op1->i -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7221,7 +7274,7 @@ static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1,
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui -= value2);
+exp->string = PrintUInt((op1->ui -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7236,7 +7289,7 @@ static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1,
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 -= value2);
+exp->string = PrintInt64((op1->i64 -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7251,7 +7304,7 @@ static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 -= value2);
+exp->string = PrintUInt64((op1->ui64 -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7266,7 +7319,7 @@ static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1,
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s -= value2);
+exp->string = PrintShort((op1->s -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7281,7 +7334,7 @@ static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us -= value2);
+exp->string = PrintUShort((op1->us -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7296,7 +7349,7 @@ static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1,
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c -= value2);
+exp->string = PrintChar((op1->c -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7311,7 +7364,7 @@ static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1,
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc -= value2);
+exp->string = PrintUChar((op1->uc -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7326,7 +7379,7 @@ static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1,
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f -= value2);
+exp->string = PrintFloat((float)(op1->f -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7341,7 +7394,7 @@ static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d -= value2);
+exp->string = PrintDouble((double)(op1->d -= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7356,7 +7409,7 @@ static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, s
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i *= value2);
+exp->string = PrintInt((op1->i *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7371,7 +7424,7 @@ static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1,
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui *= value2);
+exp->string = PrintUInt((op1->ui *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7386,7 +7439,7 @@ static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1,
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 *= value2);
+exp->string = PrintInt64((op1->i64 *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7401,7 +7454,7 @@ static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 *= value2);
+exp->string = PrintUInt64((op1->ui64 *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7416,7 +7469,7 @@ static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1,
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s *= value2);
+exp->string = PrintShort((op1->s *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7431,7 +7484,7 @@ static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us *= value2);
+exp->string = PrintUShort((op1->us *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7446,7 +7499,7 @@ static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1,
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c *= value2);
+exp->string = PrintChar((op1->c *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7461,7 +7514,7 @@ static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1,
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc *= value2);
+exp->string = PrintUChar((op1->uc *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7476,7 +7529,7 @@ static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1,
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f *= value2);
+exp->string = PrintFloat((float)(op1->f *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7491,7 +7544,7 @@ static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d *= value2);
+exp->string = PrintDouble((double)(op1->d *= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7776,7 +7829,7 @@ static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, str
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i & value2);
+exp->string = PrintInt((op1->i & value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7791,7 +7844,7 @@ static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, st
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui & value2);
+exp->string = PrintUInt((op1->ui & value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7806,7 +7859,7 @@ static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, s
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 & value2);
+exp->string = PrintInt64((op1->i64 & value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7821,7 +7874,7 @@ static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1,
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 & value2);
+exp->string = PrintUInt64((op1->ui64 & value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7836,7 +7889,7 @@ static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, s
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s & value2);
+exp->string = PrintShort((op1->s & value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7851,7 +7904,7 @@ static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1,
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us & value2);
+exp->string = PrintUShort((op1->us & value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7866,7 +7919,7 @@ static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, st
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c & value2);
+exp->string = PrintChar((op1->c & value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7881,7 +7934,7 @@ static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, s
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc & value2);
+exp->string = PrintUChar((op1->uc & value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7896,7 +7949,7 @@ static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, stru
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i | value2);
+exp->string = PrintInt((op1->i | value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7911,7 +7964,7 @@ static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, str
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui | value2);
+exp->string = PrintUInt((op1->ui | value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7926,7 +7979,7 @@ static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, st
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 | value2);
+exp->string = PrintInt64((op1->i64 | value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7941,7 +7994,7 @@ static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, s
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 | value2);
+exp->string = PrintUInt64((op1->ui64 | value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7956,7 +8009,7 @@ static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, st
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s | value2);
+exp->string = PrintShort((op1->s | value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7971,7 +8024,7 @@ static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, s
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us | value2);
+exp->string = PrintUShort((op1->us | value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -7986,7 +8039,7 @@ static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, str
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c | value2);
+exp->string = PrintChar((op1->c | value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8001,7 +8054,7 @@ static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, st
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc | value2);
+exp->string = PrintUChar((op1->uc | value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8016,7 +8069,7 @@ static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, str
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i ^ value2);
+exp->string = PrintInt((op1->i ^ value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8031,7 +8084,7 @@ static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, st
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui ^ value2);
+exp->string = PrintUInt((op1->ui ^ value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8046,7 +8099,7 @@ static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, s
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 ^ value2);
+exp->string = PrintInt64((op1->i64 ^ value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8061,7 +8114,7 @@ static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1,
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 ^ value2);
+exp->string = PrintUInt64((op1->ui64 ^ value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8076,7 +8129,7 @@ static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, s
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s ^ value2);
+exp->string = PrintShort((op1->s ^ value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8091,7 +8144,7 @@ static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1,
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us ^ value2);
+exp->string = PrintUShort((op1->us ^ value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8106,7 +8159,7 @@ static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, st
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c ^ value2);
+exp->string = PrintChar((op1->c ^ value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8121,7 +8174,7 @@ static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, s
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc ^ value2);
+exp->string = PrintUChar((op1->uc ^ value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8136,7 +8189,7 @@ static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, str
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i << value2);
+exp->string = PrintInt((op1->i << value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8151,7 +8204,7 @@ static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, st
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui << value2);
+exp->string = PrintUInt((op1->ui << value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8166,7 +8219,7 @@ static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, s
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 << value2);
+exp->string = PrintInt64((op1->i64 << value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8181,7 +8234,7 @@ static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1,
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 << value2);
+exp->string = PrintUInt64((op1->ui64 << value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8196,7 +8249,7 @@ static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, s
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s << value2);
+exp->string = PrintShort((op1->s << value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8211,7 +8264,7 @@ static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1,
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us << value2);
+exp->string = PrintUShort((op1->us << value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8226,7 +8279,7 @@ static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, st
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c << value2);
+exp->string = PrintChar((op1->c << value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8241,7 +8294,7 @@ static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, s
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc << value2);
+exp->string = PrintUChar((op1->uc << value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8256,7 +8309,7 @@ static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, str
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i >> value2);
+exp->string = PrintInt((op1->i >> value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8271,7 +8324,7 @@ static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, st
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui >> value2);
+exp->string = PrintUInt((op1->ui >> value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8286,7 +8339,7 @@ static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, s
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 >> value2);
+exp->string = PrintInt64((op1->i64 >> value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8301,7 +8354,7 @@ static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1,
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 >> value2);
+exp->string = PrintUInt64((op1->ui64 >> value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8316,7 +8369,7 @@ static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, s
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s >> value2);
+exp->string = PrintShort((op1->s >> value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8331,7 +8384,7 @@ static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1,
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us >> value2);
+exp->string = PrintUShort((op1->us >> value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8346,7 +8399,7 @@ static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, st
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c >> value2);
+exp->string = PrintChar((op1->c >> value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8361,7 +8414,7 @@ static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, s
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc >> value2);
+exp->string = PrintUChar((op1->uc >> value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8480,7 +8533,7 @@ static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, s
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i &= value2);
+exp->string = PrintInt((op1->i &= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8495,7 +8548,7 @@ static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1,
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui &= value2);
+exp->string = PrintUInt((op1->ui &= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8510,7 +8563,7 @@ static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1,
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 &= value2);
+exp->string = PrintInt64((op1->i64 &= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8525,7 +8578,7 @@ static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 &= value2);
+exp->string = PrintUInt64((op1->ui64 &= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8540,7 +8593,7 @@ static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1,
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s &= value2);
+exp->string = PrintShort((op1->s &= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8555,7 +8608,7 @@ static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us &= value2);
+exp->string = PrintUShort((op1->us &= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8570,7 +8623,7 @@ static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1,
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c &= value2);
+exp->string = PrintChar((op1->c &= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8585,7 +8638,7 @@ static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1,
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc &= value2);
+exp->string = PrintUChar((op1->uc &= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8600,7 +8653,7 @@ static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, st
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i |= value2);
+exp->string = PrintInt((op1->i |= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8615,7 +8668,7 @@ static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, s
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui |= value2);
+exp->string = PrintUInt((op1->ui |= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8630,7 +8683,7 @@ static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1,
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 |= value2);
+exp->string = PrintInt64((op1->i64 |= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8645,7 +8698,7 @@ static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1,
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 |= value2);
+exp->string = PrintUInt64((op1->ui64 |= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8660,7 +8713,7 @@ static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1,
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s |= value2);
+exp->string = PrintShort((op1->s |= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8675,7 +8728,7 @@ static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1,
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us |= value2);
+exp->string = PrintUShort((op1->us |= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8690,7 +8743,7 @@ static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, s
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c |= value2);
+exp->string = PrintChar((op1->c |= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8705,7 +8758,7 @@ static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1,
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc |= value2);
+exp->string = PrintUChar((op1->uc |= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8720,7 +8773,7 @@ static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, s
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i ^= value2);
+exp->string = PrintInt((op1->i ^= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8735,7 +8788,7 @@ static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1,
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui ^= value2);
+exp->string = PrintUInt((op1->ui ^= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8750,7 +8803,7 @@ static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1,
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 ^= value2);
+exp->string = PrintInt64((op1->i64 ^= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8765,7 +8818,7 @@ static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 ^= value2);
+exp->string = PrintUInt64((op1->ui64 ^= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8780,7 +8833,7 @@ static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1,
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s ^= value2);
+exp->string = PrintShort((op1->s ^= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8795,7 +8848,7 @@ static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us ^= value2);
+exp->string = PrintUShort((op1->us ^= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8810,7 +8863,7 @@ static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1,
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c ^= value2);
+exp->string = PrintChar((op1->c ^= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8825,7 +8878,7 @@ static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1,
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc ^= value2);
+exp->string = PrintUChar((op1->uc ^= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8840,7 +8893,7 @@ static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i <<= value2);
+exp->string = PrintInt((op1->i <<= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8855,7 +8908,7 @@ static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui <<= value2);
+exp->string = PrintUInt((op1->ui <<= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8870,7 +8923,7 @@ static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * o
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 <<= value2);
+exp->string = PrintInt64((op1->i64 <<= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8885,7 +8938,7 @@ static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand *
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 <<= value2);
+exp->string = PrintUInt64((op1->ui64 <<= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8900,7 +8953,7 @@ static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * o
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s <<= value2);
+exp->string = PrintShort((op1->s <<= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8915,7 +8968,7 @@ static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand *
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us <<= value2);
+exp->string = PrintUShort((op1->us <<= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8930,7 +8983,7 @@ static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c <<= value2);
+exp->string = PrintChar((op1->c <<= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8945,7 +8998,7 @@ static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * o
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc <<= value2);
+exp->string = PrintUChar((op1->uc <<= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8960,7 +9013,7 @@ static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i >>= value2);
+exp->string = PrintInt((op1->i >>= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8975,7 +9028,7 @@ static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui >>= value2);
+exp->string = PrintUInt((op1->ui >>= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -8990,7 +9043,7 @@ static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * o
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 >>= value2);
+exp->string = PrintInt64((op1->i64 >>= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9005,7 +9058,7 @@ static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand *
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 >>= value2);
+exp->string = PrintUInt64((op1->ui64 >>= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9020,7 +9073,7 @@ static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * o
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s >>= value2);
+exp->string = PrintShort((op1->s >>= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9035,7 +9088,7 @@ static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand *
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us >>= value2);
+exp->string = PrintUShort((op1->us >>= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9050,7 +9103,7 @@ static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c >>= value2);
+exp->string = PrintChar((op1->c >>= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9065,7 +9118,7 @@ static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * o
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc >>= value2);
+exp->string = PrintUChar((op1->uc >>= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9184,7 +9237,7 @@ static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i == value2);
+exp->string = PrintInt((int)(op1->i == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9199,7 +9252,7 @@ static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struc
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui == value2);
+exp->string = PrintUInt((unsigned int)(op1->ui == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9214,7 +9267,7 @@ static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, stru
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 == value2);
+exp->string = PrintInt64((long long)(op1->i64 == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9229,7 +9282,7 @@ static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, str
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 == value2);
+exp->string = PrintUInt64((uint64)(op1->ui64 == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9244,7 +9297,7 @@ static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, stru
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s == value2);
+exp->string = PrintShort((short)(op1->s == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9259,7 +9312,7 @@ static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, str
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us == value2);
+exp->string = PrintUShort((unsigned short)(op1->us == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9274,7 +9327,7 @@ static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struc
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c == value2);
+exp->string = PrintChar((char)(op1->c == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9289,7 +9342,7 @@ static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, stru
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc == value2);
+exp->string = PrintUChar((unsigned char)(op1->uc == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9304,7 +9357,7 @@ static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f == value2);
+exp->string = PrintFloat((float)(op1->f == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9319,7 +9372,7 @@ static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d == value2);
+exp->string = PrintDouble((double)(op1->d == value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9334,7 +9387,7 @@ static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i != value2);
+exp->string = PrintInt((int)(op1->i != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9349,7 +9402,7 @@ static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struc
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui != value2);
+exp->string = PrintUInt((unsigned int)(op1->ui != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9364,7 +9417,7 @@ static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, stru
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 != value2);
+exp->string = PrintInt64((long long)(op1->i64 != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9379,7 +9432,7 @@ static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, str
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 != value2);
+exp->string = PrintUInt64((uint64)(op1->ui64 != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9394,7 +9447,7 @@ static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, stru
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s != value2);
+exp->string = PrintShort((short)(op1->s != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9409,7 +9462,7 @@ static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, str
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us != value2);
+exp->string = PrintUShort((unsigned short)(op1->us != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9424,7 +9477,7 @@ static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struc
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c != value2);
+exp->string = PrintChar((char)(op1->c != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9439,7 +9492,7 @@ static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, stru
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc != value2);
+exp->string = PrintUChar((unsigned char)(op1->uc != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9454,7 +9507,7 @@ static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f != value2);
+exp->string = PrintFloat((float)(op1->f != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9469,7 +9522,7 @@ static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d != value2);
+exp->string = PrintDouble((double)(op1->d != value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9484,7 +9537,7 @@ static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i && value2);
+exp->string = PrintInt((int)(op1->i && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9499,7 +9552,7 @@ static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struc
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui && value2);
+exp->string = PrintUInt((unsigned int)(op1->ui && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9514,7 +9567,7 @@ static unsigned int Int64And(struct Expression * exp, struct Operand * op1, stru
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 && value2);
+exp->string = PrintInt64((long long)(op1->i64 && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9529,7 +9582,7 @@ static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, str
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 && value2);
+exp->string = PrintUInt64((uint64)(op1->ui64 && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9544,7 +9597,7 @@ static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, stru
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s && value2);
+exp->string = PrintShort((short)(op1->s && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9559,7 +9612,7 @@ static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, str
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us && value2);
+exp->string = PrintUShort((unsigned short)(op1->us && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9574,7 +9627,7 @@ static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struc
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c && value2);
+exp->string = PrintChar((char)(op1->c && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9589,7 +9642,7 @@ static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, stru
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc && value2);
+exp->string = PrintUChar((unsigned char)(op1->uc && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9604,7 +9657,7 @@ static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f && value2);
+exp->string = PrintFloat((float)(op1->f && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9619,7 +9672,7 @@ static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d && value2);
+exp->string = PrintDouble((double)(op1->d && value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9634,7 +9687,7 @@ static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i || value2);
+exp->string = PrintInt((int)(op1->i || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9649,7 +9702,7 @@ static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui || value2);
+exp->string = PrintUInt((unsigned int)(op1->ui || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9664,7 +9717,7 @@ static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struc
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 || value2);
+exp->string = PrintInt64((long long)(op1->i64 || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9679,7 +9732,7 @@ static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, stru
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 || value2);
+exp->string = PrintUInt64((uint64)(op1->ui64 || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9694,7 +9747,7 @@ static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struc
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s || value2);
+exp->string = PrintShort((short)(op1->s || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9709,7 +9762,7 @@ static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, stru
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us || value2);
+exp->string = PrintUShort((unsigned short)(op1->us || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9724,7 +9777,7 @@ static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c || value2);
+exp->string = PrintChar((char)(op1->c || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9739,7 +9792,7 @@ static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struc
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc || value2);
+exp->string = PrintUChar((unsigned char)(op1->uc || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9754,7 +9807,7 @@ static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struc
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f || value2);
+exp->string = PrintFloat((float)(op1->f || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9769,7 +9822,7 @@ static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, stru
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d || value2);
+exp->string = PrintDouble((double)(op1->d || value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9784,7 +9837,7 @@ static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i > value2);
+exp->string = PrintInt((int)(op1->i > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9799,7 +9852,7 @@ static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struc
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui > value2);
+exp->string = PrintUInt((unsigned int)(op1->ui > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9814,7 +9867,7 @@ static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, stru
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 > value2);
+exp->string = PrintInt64((long long)(op1->i64 > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9829,7 +9882,7 @@ static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, str
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 > value2);
+exp->string = PrintUInt64((uint64)(op1->ui64 > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9844,7 +9897,7 @@ static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, stru
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s > value2);
+exp->string = PrintShort((short)(op1->s > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9859,7 +9912,7 @@ static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, str
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us > value2);
+exp->string = PrintUShort((unsigned short)(op1->us > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9874,7 +9927,7 @@ static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struc
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c > value2);
+exp->string = PrintChar((char)(op1->c > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9889,7 +9942,7 @@ static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, stru
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc > value2);
+exp->string = PrintUChar((unsigned char)(op1->uc > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9904,7 +9957,7 @@ static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f > value2);
+exp->string = PrintFloat((float)(op1->f > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9919,7 +9972,7 @@ static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d > value2);
+exp->string = PrintDouble((double)(op1->d > value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9934,7 +9987,7 @@ static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i < value2);
+exp->string = PrintInt((int)(op1->i < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9949,7 +10002,7 @@ static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struc
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui < value2);
+exp->string = PrintUInt((unsigned int)(op1->ui < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9964,7 +10017,7 @@ static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, stru
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 < value2);
+exp->string = PrintInt64((long long)(op1->i64 < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9979,7 +10032,7 @@ static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, str
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 < value2);
+exp->string = PrintUInt64((uint64)(op1->ui64 < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -9994,7 +10047,7 @@ static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, stru
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s < value2);
+exp->string = PrintShort((short)(op1->s < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10009,7 +10062,7 @@ static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, str
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us < value2);
+exp->string = PrintUShort((unsigned short)(op1->us < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10024,7 +10077,7 @@ static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struc
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c < value2);
+exp->string = PrintChar((char)(op1->c < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10039,7 +10092,7 @@ static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, stru
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc < value2);
+exp->string = PrintUChar((unsigned char)(op1->uc < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10054,7 +10107,7 @@ static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, stru
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f < value2);
+exp->string = PrintFloat((float)(op1->f < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10069,7 +10122,7 @@ static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, str
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d < value2);
+exp->string = PrintDouble((double)(op1->d < value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10084,7 +10137,7 @@ static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, str
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i >= value2);
+exp->string = PrintInt((int)(op1->i >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10099,7 +10152,7 @@ static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, st
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui >= value2);
+exp->string = PrintUInt((unsigned int)(op1->ui >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10114,7 +10167,7 @@ static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, s
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 >= value2);
+exp->string = PrintInt64((long long)(op1->i64 >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10129,7 +10182,7 @@ static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1,
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 >= value2);
+exp->string = PrintUInt64((uint64)(op1->ui64 >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10144,7 +10197,7 @@ static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, s
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s >= value2);
+exp->string = PrintShort((short)(op1->s >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10159,7 +10212,7 @@ static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1,
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us >= value2);
+exp->string = PrintUShort((unsigned short)(op1->us >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10174,7 +10227,7 @@ static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, st
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c >= value2);
+exp->string = PrintChar((char)(op1->c >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10189,7 +10242,7 @@ static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, s
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc >= value2);
+exp->string = PrintUChar((unsigned char)(op1->uc >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10204,7 +10257,7 @@ static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, s
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f >= value2);
+exp->string = PrintFloat((float)(op1->f >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10219,7 +10272,7 @@ static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1,
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d >= value2);
+exp->string = PrintDouble((double)(op1->d >= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10234,7 +10287,7 @@ static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, str
 int value2 = op2->i;
 
 exp->type = 2;
-exp->string = PrintInt(op1->i <= value2);
+exp->string = PrintInt((int)(op1->i <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10249,7 +10302,7 @@ static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, st
 unsigned int value2 = op2->ui;
 
 exp->type = 2;
-exp->string = PrintUInt(op1->ui <= value2);
+exp->string = PrintUInt((unsigned int)(op1->ui <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10264,7 +10317,7 @@ static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, s
 long long value2 = op2->i64;
 
 exp->type = 2;
-exp->string = PrintInt64(op1->i64 <= value2);
+exp->string = PrintInt64((long long)(op1->i64 <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10279,7 +10332,7 @@ static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1,
 uint64 value2 = op2->ui64;
 
 exp->type = 2;
-exp->string = PrintUInt64(op1->ui64 <= value2);
+exp->string = PrintUInt64((uint64)(op1->ui64 <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10294,7 +10347,7 @@ static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, s
 short value2 = op2->s;
 
 exp->type = 2;
-exp->string = PrintShort(op1->s <= value2);
+exp->string = PrintShort((short)(op1->s <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10309,7 +10362,7 @@ static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1,
 unsigned short value2 = op2->us;
 
 exp->type = 2;
-exp->string = PrintUShort(op1->us <= value2);
+exp->string = PrintUShort((unsigned short)(op1->us <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10324,7 +10377,7 @@ static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, st
 char value2 = op2->c;
 
 exp->type = 2;
-exp->string = PrintChar(op1->c <= value2);
+exp->string = PrintChar((char)(op1->c <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10339,7 +10392,7 @@ static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, s
 unsigned char value2 = op2->uc;
 
 exp->type = 2;
-exp->string = PrintUChar(op1->uc <= value2);
+exp->string = PrintUChar((unsigned char)(op1->uc <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10354,7 +10407,7 @@ static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, s
 float value2 = op2->f;
 
 exp->type = 2;
-exp->string = PrintFloat(op1->f <= value2);
+exp->string = PrintFloat((float)(op1->f <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -10369,7 +10422,7 @@ static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1,
 double value2 = op2->d;
 
 exp->type = 2;
-exp->string = PrintDouble(op1->d <= value2);
+exp->string = PrintDouble((double)(op1->d <= value2));
 if(!exp->expType)
 {
 exp->expType = op1->type;
@@ -13794,8 +13847,6 @@ extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, s
 
 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
 
-extern struct Expression * CopyExpression(struct Expression * exp);
-
 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
 
 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
@@ -13898,7 +13949,7 @@ id->classSym = (((void *)0));
 exp->expType = type;
 if(type)
 type->refCount++;
-if(type && (type->kind == 15 || (_class && _class->type == 4)))
+if(type && (type->kind == 15))
 exp->isConstant = 0x1;
 if(symbol->isParam || !strcmp(id->string, "this"))
 {
@@ -14222,6 +14273,7 @@ struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
 unsigned int useDestType = 0x0, useSideType = 0x0;
 struct Location oldyylloc = yylloc;
 unsigned int useSideUnit = 0x0;
+struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->_class) ? exp->destType->_class->registered : (((void *)0));
 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
 
 switch(exp->op.op)
@@ -14258,13 +14310,27 @@ break;
 case '+':
 case '-':
 useSideUnit = 0x1;
+useSideType = 0x1;
+useDestType = 0x1;
+break;
+case LEFT_OP:
+case RIGHT_OP:
+useSideType = 0x1;
+useDestType = 0x1;
+break;
 case '|':
-case '&':
 case '^':
+useSideType = 0x1;
+useDestType = 0x1;
+break;
 case '/':
 case '%':
+useSideType = 0x1;
+useDestType = 0x1;
+break;
+case '&':
 case '*':
-if(exp->op.op != '*' || exp->op.exp1)
+if(exp->op.exp1)
 {
 useSideType = 0x1;
 useDestType = 0x1;
@@ -14294,11 +14360,14 @@ break;
 }
 if(exp->op.exp1)
 {
-if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
+if(exp->op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
+useDestType = 0x0;
+if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
 {
 if(exp->op.exp1->destType)
 FreeType(exp->op.exp1->destType);
 exp->op.exp1->destType = exp->destType;
+exp->op.exp1->opDestType = 0x1;
 if(exp->destType)
 exp->destType->refCount++;
 }
@@ -14314,6 +14383,7 @@ exp->op.exp1->destType->count++;
 ProcessExpressionType(exp->op.exp1);
 if(exp->op.exp1->destType && exp->op.op != '=')
 exp->op.exp1->destType->count--;
+exp->op.exp1->opDestType = 0x0;
 if(!exp->op.exp2 && (exp->op.op == INC_OP || exp->op.op == DEC_OP) && exp->op.exp1->expType && exp->op.exp1->expType->kind == 8 && exp->op.exp1->expType->_class && exp->op.exp1->expType->_class->registered && exp->op.exp1->expType->_class->registered->type == 3)
 {
 exp->op.exp2 = MkExpConstant("1");
@@ -14343,6 +14413,8 @@ exp->op.exp1->expType->refCount++;
 else
 {
 exp->op.exp2->destType = exp->destType;
+if(!exp->op.exp1 || exp->op.op != '&')
+exp->op.exp2->opDestType = 0x1;
 if(exp->destType)
 exp->destType->refCount++;
 }
@@ -14384,11 +14456,13 @@ if(type1)
 type1->refCount++;
 exp->expType = type1;
 }
-else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
+else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
 {
 if(exp->op.exp2->destType)
 FreeType(exp->op.exp2->destType);
 exp->op.exp2->destType = exp->destType;
+if(exp->op.op != '&')
+exp->op.exp2->opDestType = 0x1;
 if(exp->destType)
 exp->destType->refCount++;
 }
@@ -14425,6 +14499,7 @@ if(e->type == 11 && e->cast.exp)
 e->cast.exp->needCast = 0x1;
 }
 ProcessExpressionType(exp->op.exp2);
+exp->op.exp2->opDestType = 0x0;
 if(exp->op.exp2->destType && exp->op.op != '=')
 exp->op.exp2->destType->count--;
 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
@@ -14541,6 +14616,25 @@ else if(exp->op.exp1 && exp->op.exp2 && ((useSideType) || ((!type1 || type1->kin
 {
 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
 {
+if(exp->op.op == '-' && ((type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 4) || (type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 4)))
+{
+struct Type * intType;
+
+if(!type1->_class->registered->dataType)
+type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
+if(!type2->_class->registered->dataType)
+type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
+intType = ProcessTypeString((type1->_class->registered->dataType->kind == 4 || type2->_class->registered->dataType->kind == 4) ? "int64" : "int", 0x0);
+if(exp->op.exp1->destType)
+FreeType(exp->op.exp1->destType);
+if(exp->op.exp2->destType)
+FreeType(exp->op.exp2->destType);
+exp->op.exp1->destType = intType;
+exp->op.exp2->destType = intType;
+intType->refCount++;
+}
+else
+{
 if(exp->op.exp2->destType)
 FreeType(exp->op.exp2->destType);
 exp->op.exp2->destType = type1;
@@ -14549,6 +14643,7 @@ if(exp->op.exp1->destType)
 FreeType(exp->op.exp1->destType);
 exp->op.exp1->destType = type2;
 type2->refCount++;
+}
 if(!boolResult && type1->kind == 8 && (!exp->destType || exp->destType->kind != 8) && type1->_class->registered && type1->_class->registered->type == 3 && type2->_class->registered && type2->_class->registered->type == 3 && type1->_class->registered != type2->_class->registered)
 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
@@ -14757,21 +14852,53 @@ type1 = exp->op.exp1->destType;
 exp->expType = type1;
 type1->refCount++;
 }
-if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
+if(!boolResult || exp->op.op == '>' || exp->op.op == '<' || exp->op.op == GE_OP || exp->op.op == LE_OP)
 {
-if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
+unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4;
+unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4;
+
+if(exp->op.op == '*' || exp->op.op == '/' || exp->op.op == '-' || exp->op.op == '|' || exp->op.op == '^')
+{
+if(op1IsEnum && exp->op.exp2->expType)
 {
 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
 {
 if(exp->expType)
 FreeType(exp->expType);
-exp->expType = exp->op.exp1->expType;
+exp->expType = exp->op.exp2->expType;
 if(exp->op.exp2->expType)
+exp->op.exp2->expType->refCount++;
+valid = 0x1;
+}
+}
+else if(op2IsEnum && exp->op.exp1->expType)
+{
+if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
+{
+if(exp->expType)
+FreeType(exp->expType);
+exp->expType = exp->op.exp1->expType;
+if(exp->op.exp1->expType)
+exp->op.exp1->expType->refCount++;
+valid = 0x1;
+}
+}
+}
+else
+{
+if(op1IsEnum && exp->op.exp2->expType)
+{
+if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
+{
+if(exp->expType)
+FreeType(exp->expType);
+exp->expType = exp->op.exp1->expType;
+if(exp->op.exp1->expType)
 exp->op.exp1->expType->refCount++;
 valid = 0x1;
 }
 }
-else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
+else if(op2IsEnum && exp->op.exp1->expType)
 {
 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
 {
@@ -14784,8 +14911,26 @@ valid = 0x1;
 }
 }
 }
+}
 if(!valid)
 {
+if(type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3 && (type1->kind != 8 || !type1->_class || !type1->_class->registered || type1->_class->registered->type != 3))
+{
+if(exp->op.exp1->destType)
+FreeType(exp->op.exp1->destType);
+exp->op.exp1->destType = type2;
+type2->refCount++;
+if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
+{
+if(exp->expType)
+FreeType(exp->expType);
+exp->expType = exp->op.exp1->destType;
+if(exp->op.exp1->destType)
+exp->op.exp1->destType->refCount++;
+}
+}
+else
+{
 if(exp->op.exp2->destType)
 FreeType(exp->op.exp2->destType);
 exp->op.exp2->destType = type1;
@@ -14834,6 +14979,7 @@ exp->op.exp2->expType->refCount++;
 }
 }
 }
+}
 else if(type2)
 {
 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
@@ -14957,6 +15103,7 @@ unsigned int inced = 0x0;
 if(!e->next)
 {
 FreeType(e->destType);
+e->opDestType = exp->opDestType;
 e->destType = exp->destType;
 if(e->destType)
 {
index 62c0ecd..f61fe44 100644 (file)
@@ -458,6 +458,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -630,7 +631,7 @@ char *  name;
 struct __ecereNameSpace__ecere__sys__OldList methods;
 struct __ecereNameSpace__ecere__sys__OldList properties;
 unsigned int itself;
-unsigned int isRemote;
+int isRemote;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
@@ -802,7 +803,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -1889,7 +1890,7 @@ return ;
 classSym->_import = __extension__ ({
 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
 
-__ecereInstance1->isRemote = classSym->registered ? classSym->registered->isRemote : 0x0, __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(classSym->string), __ecereInstance1;
+__ecereInstance1->isRemote = classSym->registered ? classSym->registered->isRemote : 0, __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(classSym->string), __ecereInstance1;
 });
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->module->classes, classSym->_import);
 }
index 6e4620f..a172dcb 100644 (file)
@@ -467,6 +467,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -793,7 +794,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 2d91d9c..92a8db6 100644 (file)
@@ -434,6 +434,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -779,7 +780,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -1043,7 +1044,7 @@ extern int strcmp(const char * , const char * );
 
 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
 
-static unsigned int ReplaceClassSpec(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Specifier * spec, unsigned int param)
+static int ReplaceClassSpec(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Specifier * spec, unsigned int param)
 {
 if(spec->type == 8)
 {
@@ -1069,7 +1070,7 @@ unsigned int isPointer = decl->type == 5;
 if(decl)
 FreeDeclarator(decl);
 if(isPointer)
-return 0x1;
+return 1;
 }
 }
 else if(!param && parameter->dataType)
@@ -1089,7 +1090,7 @@ if(decl)
 unsigned int isPointer = decl->type == 5;
 
 if(isPointer)
-return 0x1;
+return 1;
 }
 }
 else
@@ -1170,7 +1171,7 @@ else if(!_class->base)
 {
 spec->type = 0;
 spec->specifier = VOID;
-return 0x1;
+return 1;
 }
 }
 else
@@ -1184,11 +1185,11 @@ spec->ctx = (((void *)0));
 spec->addNameSpace = 0x0;
 }
 if(_class && _class->dataTypeString && !strcmp(_class->dataTypeString, "char *"))
-return 0x1;
+return 1;
 if(!_class || _class->type == 0 || _class->type == 5)
-return 0x1;
+return 1;
 else if(param && _class->type == 1)
-return (unsigned int)2;
+return 2;
 }
 }
 else if(spec->type == 0)
@@ -1196,10 +1197,10 @@ else if(spec->type == 0)
 if(spec->specifier == ANY_OBJECT)
 {
 spec->specifier = VOID;
-return 0x1;
+return 1;
 }
 }
-return 0x0;
+return 0;
 }
 
 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
@@ -1425,7 +1426,7 @@ for(spec = (*type->qualifiers).first; spec; spec = spec->next)
 {
 int result;
 
-if((result = (unsigned int)ReplaceClassSpec(type->qualifiers, spec, param)))
+if((result = ReplaceClassSpec(type->qualifiers, spec, param)))
 ReplaceByInstancePtr(spec, &type->declarator, result);
 else
 {
@@ -1632,7 +1633,7 @@ for(spec = (*decl->specifiers).first; spec; spec = spec->next)
 {
 int type;
 
-if((type = (unsigned int)ReplaceClassSpec(decl->specifiers, spec, 0x0)))
+if((type = ReplaceClassSpec(decl->specifiers, spec, 0x0)))
 {
 struct InitDeclarator * d;
 
@@ -1668,7 +1669,7 @@ for(spec = (*decl->specifiers).first; spec; spec = spec->next)
 {
 int type;
 
-if((type = (unsigned int)ReplaceClassSpec(decl->specifiers, spec, 0x0)))
+if((type = ReplaceClassSpec(decl->specifiers, spec, 0x0)))
 {
 if(decl->declarators)
 {
@@ -1883,7 +1884,7 @@ for(spec = (*func->specifiers).first; spec; spec = spec->next)
 {
 int type;
 
-if((type = (unsigned int)ReplaceClassSpec(func->specifiers, spec, 0x0)))
+if((type = ReplaceClassSpec(func->specifiers, spec, 0x0)))
 ReplaceByInstancePtr(spec, &func->declarator, type);
 InstDeclPassSpecifier(spec);
 }
index 8b57881..95a5e06 100644 (file)
@@ -329,7 +329,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index ef2ea5d..56a2379 100644 (file)
@@ -458,6 +458,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -646,7 +647,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index f135411..e1b67ab 100644 (file)
@@ -1529,7 +1529,7 @@ class PrecompApp : Application
          SetTargetBits(targetBits);
          SetEchoOn(false);
 
-         privateModule = (Module)__ecere_COM_Initialize(true | (targetBits == sizeof(uintptr)*8 ? 0 : targetBits == 64 ? 2 : targetBits==32 ? 4 : 0) | 8, 1, null);
+         privateModule = (Module)__ecere_COM_Initialize((bool)(true | (targetBits == sizeof(uintptr)*8 ? 0 : targetBits == 64 ? 2 : targetBits==32 ? 4 : 0) | 8), 1, null);
          SetPrivateModule(privateModule);
 
          globalContext.types.Add((BTNode)Symbol { string = CopyString("uint"), type = ProcessTypeString("unsigned int", false) });
index 0012ecc..9e8b620 100644 (file)
@@ -1749,7 +1749,7 @@ class SymbolgenApp : Application
          SetTargetBits(targetBits);
          SetInSymbolGen(true);
 
-         privateModule = (Module)__ecere_COM_Initialize(true | (targetBits == sizeof(uintptr)*8 ? 0 : targetBits == 64 ? 2 : targetBits==32 ? 4 : 0) | 8, 1, null);
+         privateModule = (Module)__ecere_COM_Initialize((bool)(true | (targetBits == sizeof(uintptr)*8 ? 0 : targetBits == 64 ? 2 : targetBits==32 ? 4 : 0) | 8), 1, null);
          SetPrivateModule(privateModule);
          mainModule = ModuleImport { };
          SetMainModule(mainModule);
index 8bd24c8..a85d24d 100644 (file)
@@ -449,6 +449,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -620,7 +621,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 4e6d856..3bbba1d 100644 (file)
@@ -463,6 +463,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -748,7 +749,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index 24c566e..eefee0f 100644 (file)
@@ -458,6 +458,7 @@ unsigned int isConstant;
 unsigned int addedThis;
 unsigned int needCast;
 unsigned int thisPtr;
+unsigned int opDestType;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
@@ -646,7 +647,7 @@ unsigned int noExpansion;
 char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
index e9dc1fa..1381e1e 100644 (file)
@@ -208,6 +208,7 @@ static Instantiation CopyInstantiation(Instantiation inst)
       result.loc = exp.loc;
       result.isConstant = exp.isConstant;
       result.byReference = exp.byReference;
+      result.opDestType = exp.opDestType;
    }
 
    return result;
index eb5ccf0..95685c8 100644 (file)
@@ -658,6 +658,7 @@ public:
    bool addedThis;
    bool needCast;
    bool thisPtr;
+   bool opDestType;
 
    void Clear()
    {
@@ -676,6 +677,7 @@ public:
       addedThis = false;
       needCast = false;
       thisPtr = false;
+      opDestType = false;
    }
 };
 
@@ -1192,7 +1194,7 @@ public:
    OldList methods;
    OldList properties;
    bool itself;
-   bool isRemote;
+   int isRemote;
 };
 
 public class FunctionImport : struct
index ce64df2..fda2c99 100644 (file)
@@ -3037,7 +3037,11 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
 
                      if(!convert.dataType)
                         convert.dataType = ProcessTypeString(convert.dataTypeString, false);
-                     if(MatchTypes(convert.dataType, dest, conversions, null, null, false, true, false, true))
+                     // Only go ahead with this conversion flow while processing an existing conversion if the conversion data type is a class
+                     if((!isConversionExploration || convert.dataType.kind == classType || !strcmp(_class.name, "String")) &&
+                        MatchTypes(convert.dataType, dest, conversions, null, null,
+                           (convert.dataType.kind == classType && !strcmp(convert.dataTypeString, "String")) ? true : false,
+                              convert.dataType.kind == classType, false, true))
                      {
                         if(!conversions && !convert.Get)
                            return true;
@@ -3118,7 +3122,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
                if(dest._class.registered.dataType.kind == classType || source.truth || dest.truth/* ||
                   !strcmp(dest._class.registered.name, "bool") || (source.kind == classType && !strcmp(source._class.string, "bool"))*/)
                {
-                  if(MatchTypes(source, dest._class.registered.dataType, conversions, null, null, true, true, false, false))
+                  if(MatchTypes(source, dest._class.registered.dataType, conversions, null, null, true, dest._class.registered.dataType.kind == classType, false, false))
                   {
                      return true;
                   }
@@ -3141,7 +3145,9 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
 
                      if(!convert.dataType)
                         convert.dataType = ProcessTypeString(convert.dataTypeString, false);
-                     if(convert.dataType != source && MatchTypes(convert.dataType, dest, conversions, null, null, true, true, false, true))
+                     if(convert.dataType != source &&
+                        (!isConversionExploration || convert.dataType.kind == classType || !strcmp(_class.name, "String")) &&
+                        MatchTypes(convert.dataType, dest, conversions, null, null, convert.dataType.kind == classType, convert.dataType.kind == classType, false, true))
                      {
                         if(!conversions && !convert.Get)
                            return true;
@@ -3170,9 +3176,13 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
             {
                if(!source._class.registered.dataType)
                   source._class.registered.dataType = ProcessTypeString(source._class.registered.dataTypeString, false);
-               if(MatchTypes(source._class.registered.dataType, dest, conversions, null, null, true, true, false, false))
+               if(!isConversionExploration || source._class.registered.dataType.kind == classType || !strcmp(source._class.registered.name, "String"))
                {
-                  return true;
+                  if(MatchTypes(source._class.registered.dataType, dest, conversions, null, null, source._class.registered.dataType.kind == classType, source._class.registered.dataType.kind == classType, false, false))
+                     return true;
+                  // For bool to be accepted by byte, short, etc.
+                  else if(MatchTypes(dest, source._class.registered.dataType, null, null, null, false, false, false, false))
+                     return true;
                }
             }
          }
@@ -3200,7 +3210,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
       else if(source.kind == enumType &&
          (dest.kind == intType || dest.kind == shortType || dest.kind == charType || source.kind == _BoolType || dest.kind == longType || dest.kind == int64Type || dest.kind == intPtrType || dest.kind == intSizeType))
           return true;
-      else if(dest.kind == enumType &&
+      else if(dest.kind == enumType && !isConversionExploration &&
          (source.kind == intType || source.kind == shortType || source.kind == charType || source.kind == _BoolType || source.kind == longType || source.kind == int64Type || source.kind == intPtrType || source.kind == intSizeType))
           return true;
       else if((dest.kind == functionType || (dest.kind == pointerType && dest.type.kind == functionType) || dest.kind == methodType) &&
@@ -3512,12 +3522,31 @@ bool MatchWithEnums_Module(Module mainModule, Expression sourceExp, Type dest, c
 
 bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, bool skipUnitBla)
 {
-   Type source = sourceExp.expType;
+   Type source;
    Type realDest = dest;
    Type backupSourceExpType = null;
+   Expression computedExp = sourceExp;
+   dest.refCount++;
+
+   if(sourceExp.isConstant && sourceExp.type != constantExp && sourceExp.type != identifierExp && sourceExp.type != castExp &&
+      dest.kind == classType && dest._class && dest._class.registered && dest._class.registered.type == enumClass)
+   {
+      computedExp = CopyExpression(sourceExp);        // Keep the original expression, but compute for checking enum ranges
+      ComputeExpression(computedExp /*sourceExp*/);
+   }
+
+   source = sourceExp.expType;
 
    if(dest.kind == pointerType && sourceExp.type == constantExp && !strtoul(sourceExp.constant, null, 0))
+   {
+      if(computedExp != sourceExp)
+      {
+         FreeExpression(computedExp);
+         computedExp = sourceExp;
+      }
+      FreeType(dest);
       return true;
+   }
 
    if(!skipUnitBla && source && dest && source.kind == classType && dest.kind == classType)
    {
@@ -3532,8 +3561,16 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
               destBase = destBase.base);
           //if(source._class.registered == dest._class.registered)
           if(sourceBase == destBase)
-             return true;
-       }
+          {
+            if(computedExp != sourceExp)
+            {
+               FreeExpression(computedExp);
+               computedExp = sourceExp;
+            }
+            FreeType(dest);
+            return true;
+         }
+      }
    }
 
    if(source)
@@ -3543,21 +3580,25 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
       int64 value = MAXINT;
 
       source.refCount++;
-      dest.refCount++;
 
-      if(sourceExp.type == constantExp)
+      if(computedExp.type == constantExp)
       {
          if(source.isSigned)
-            value = strtoll(sourceExp.constant, null, 0);
+            value = strtoll(computedExp.constant, null, 0);
          else
-            value = strtoull(sourceExp.constant, null, 0);
+            value = strtoull(computedExp.constant, null, 0);
       }
-      else if(sourceExp.type == opExp && sourceExp.op.op == '-' && !sourceExp.op.exp1 && sourceExp.op.exp2 && sourceExp.op.exp2.type == constantExp)
+      else if(computedExp.type == opExp && sourceExp.op.op == '-' && !computedExp.op.exp1 && computedExp.op.exp2 && computedExp.op.exp2.type == constantExp)
       {
          if(source.isSigned)
-            value = -strtoll(sourceExp.op.exp2.constant, null, 0);
+            value = -strtoll(computedExp.op.exp2.constant, null, 0);
          else
-            value = -strtoull(sourceExp.op.exp2.constant, null, 0);
+            value = -strtoull(computedExp.op.exp2.constant, null, 0);
+      }
+      if(computedExp != sourceExp)
+      {
+         FreeExpression(computedExp);
+         computedExp = sourceExp;
       }
 
       if(dest.kind != classType && source.kind == classType && source._class && source._class.registered &&
@@ -3667,7 +3708,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
       {
          Class _class = source._class ? source._class.registered : null;
 
-         if(_class && (_class.type == unitClass || !strcmp(_class.fullName, "bool") || /*_class.type == enumClass || */_class.type == bitClass ))  // TOCHECK: enumClass, bitClass is new here...
+         if(_class && (_class.type == unitClass || /*!strcmp(_class.fullName, "bool") || /*_class.type == enumClass || */_class.type == bitClass ))  // TOCHECK: enumClass, bitClass is new here...
          {
             /*
             if(dest.kind != classType)
@@ -3770,7 +3811,16 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
       if(dest.kind == classType)
       {
          Class _class = dest._class ? dest._class.registered : null;
-         if(_class && !dest.truth && (_class.type == unitClass || !strcmp(_class.fullName, "bool") ||
+         bool fittingValue = false;
+         if(_class && _class.type == enumClass)
+         {
+            Class enumClass = eSystem_FindClass(privateModule, "enum");
+            EnumClassData c = ACCESS_CLASSDATA(_class, enumClass);
+            if(c && value >= 0 && value <= c.largest)
+               fittingValue = true;
+         }
+
+         if(_class && !dest.truth && (_class.type == unitClass || fittingValue ||
             (/*_class.type == enumClass*/_class.type != structClass && !value && source.kind == intType) || _class.type == bitClass))   // TOCHECK: enumClass, bitClass is new here...
          {
             if(_class.type == normalClass || _class.type == noHeadClass)
@@ -3922,7 +3972,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
          return false;
       }
 
-      if(!flag)
+      if(!flag && !sourceExp.opDestType)
       {
          Expression newExp { };
          *newExp = *sourceExp;
@@ -3961,6 +4011,12 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
    }
    else
    {
+      if(computedExp != sourceExp)
+      {
+         FreeExpression(computedExp);
+         computedExp = sourceExp;
+      }
+
       while((sourceExp.type == bracketsExp || sourceExp.type == extensionExpressionExp) && sourceExp.list) sourceExp = sourceExp.list->last;
       if(sourceExp.type == identifierExp)
       {
@@ -4000,6 +4056,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
                            sourceExp.constant = CopyString(constant);
                            //for(;_class.base && _class.base.type != systemClass; _class = _class.base);
                         }
+                        FreeType(dest);
                         return true;
                      }
                   }
@@ -4009,8 +4066,12 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
 
          // Loop through all enum classes
          if(dest.classObjectType != typedObject && dest.kind == classType /*!= ellipsisType */&& MatchWithEnums_Module(privateModule, sourceExp, dest, id.string, conversions))
+         {
+            FreeType(dest);
             return true;
+         }
       }
+      FreeType(dest);
    }
    return false;
 }
@@ -4030,7 +4091,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
    {                                                              \
       t value2 = op2.m;                                           \
       exp.type = constantExp;                                    \
-      exp.string = p(op1.m o value2);                     \
+      exp.string = p((t)(op1.m o value2));                     \
       if(!exp.expType) \
          { exp.expType = op1.type; if(op1.type) op1.type.refCount++; } \
       return true;                                                \
@@ -7597,7 +7658,10 @@ void ProcessExpressionType(Expression exp)
                exp.expType = type;
                if(type)
                   type.refCount++;
-               if(type && (type.kind == enumType || (_class && _class.type == enumClass)))
+
+                                                // Commented this out, it was making non-constant enum parameters seen as constant
+                                                // enums should have been resolved by ResolveIdWithClass, changed to constantExp and marked as constant
+               if(type && (type.kind == enumType /*|| (_class && _class.type == enumClass)*/))
                   // Add missing cases here... enum Classes...
                   exp.isConstant = true;
 
@@ -7958,6 +8022,7 @@ void ProcessExpressionType(Expression exp)
          bool useDestType = false, useSideType = false;
          Location oldyylloc = yylloc;
          bool useSideUnit = false;
+         Class destClass = (exp.destType && exp.destType.kind == classType && exp.destType._class) ? exp.destType._class.registered : null;
 
          // Dummy type to prevent ProcessExpression of operands to say unresolved identifiers yet
          Type dummy
@@ -8008,19 +8073,32 @@ void ProcessExpressionType(Expression exp)
             case '+':
             case '-':
                useSideUnit = true;
+               useSideType = true;
+               useDestType = true;
+               break;
+
+            case LEFT_OP:
+            case RIGHT_OP:
+               useSideType = true;
+               useDestType = true;
+               break;
 
-               // Just added these... testing
             case '|':
-            case '&':
             case '^':
+               useSideType = true;
+               useDestType = true;
+               break;
 
-            // DANGER: Verify units
             case '/':
             case '%':
+               useSideType = true;
+               useDestType = true;
+               break;
+            case '&':
             case '*':
-
-               if(exp.op.op != '*' || exp.op.exp1)
+               if(exp.op.exp1)
                {
+                  // For & operator, useDestType nicely ensures the result will fit in a bool (TODO: Fix for generic enum)
                   useSideType = true;
                   useDestType = true;
                }
@@ -8056,21 +8134,22 @@ void ProcessExpressionType(Expression exp)
          }
 
          //dummy.kind = TypeDummy;
-
          if(exp.op.exp1)
          {
-            if(exp.destType && exp.destType.kind == classType &&
-               exp.destType._class && exp.destType._class.registered && useDestType &&
+            // Added this check here to use the dest type only for units derived from the base unit
+            // So that untyped units will use the side unit as opposed to the untyped destination unit
+            // This fixes (#771) sin(Degrees { 5 } + 5) to be equivalent to sin(Degrees { 10 }), since sin expects a generic Angle
+            if(exp.op.exp2 && useSideUnit && useDestType && destClass && destClass.type == unitClass && destClass.base.type != unitClass)
+               useDestType = false;
 
-              ((exp.destType._class.registered.type == unitClass && useSideUnit) ||
-               exp.destType._class.registered.type == enumClass ||
-               exp.destType._class.registered.type == bitClass
-               ))
+            if(destClass && useDestType &&
+              ((destClass.type == unitClass && useSideUnit) || destClass.type == enumClass || destClass.type == bitClass))
 
               //(exp.destType._class.registered.type == unitClass || exp.destType._class.registered.type == enumClass) && useDestType)
             {
                if(exp.op.exp1.destType) FreeType(exp.op.exp1.destType);
                exp.op.exp1.destType = exp.destType;
+               exp.op.exp1.opDestType = true;
                if(exp.destType)
                   exp.destType.refCount++;
             }
@@ -8086,6 +8165,8 @@ void ProcessExpressionType(Expression exp)
             ProcessExpressionType(exp.op.exp1);
             if(exp.op.exp1.destType && exp.op.op != '=') exp.op.exp1.destType.count--;
 
+            exp.op.exp1.opDestType = false;
+
             // Fix for unit and ++ / --
             if(!exp.op.exp2 && (exp.op.op == INC_OP || exp.op.op == DEC_OP) && exp.op.exp1.expType && exp.op.exp1.expType.kind == classType &&
                exp.op.exp1.expType._class && exp.op.exp1.expType._class.registered && exp.op.exp1.expType._class.registered.type == unitClass)
@@ -8118,6 +8199,8 @@ void ProcessExpressionType(Expression exp)
                else
                {
                   exp.op.exp2.destType = exp.destType;
+                  if(!exp.op.exp1 || exp.op.op != '&')
+                     exp.op.exp2.opDestType = true;
                   if(exp.destType)
                      exp.destType.refCount++;
                }
@@ -8159,15 +8242,14 @@ void ProcessExpressionType(Expression exp)
                if(type1) type1.refCount++;
                exp.expType = type1;
             }
-            else if(exp.destType && exp.destType.kind == classType &&
-               exp.destType._class && exp.destType._class.registered &&
-
-                  ((exp.destType._class.registered.type == unitClass && useDestType && useSideUnit) ||
-                  (exp.destType._class.registered.type == enumClass && useDestType))
-                  )
+            else if(destClass &&
+                  ((destClass.type == unitClass && useDestType && useSideUnit) ||
+                  (destClass.type == enumClass && useDestType)))
             {
                if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
                exp.op.exp2.destType = exp.destType;
+               if(exp.op.op != '&')
+                  exp.op.exp2.opDestType = true;
                if(exp.destType)
                   exp.destType.refCount++;
             }
@@ -8205,6 +8287,7 @@ void ProcessExpressionType(Expression exp)
                   e.cast.exp.needCast = true;
             }
             ProcessExpressionType(exp.op.exp2);
+            exp.op.exp2.opDestType = false;
             if(exp.op.exp2.destType && exp.op.op != '=') exp.op.exp2.destType.count--;
 
             if(assign && type1 && type1.kind == pointerType && exp.op.exp2.expType)
@@ -8332,12 +8415,36 @@ void ProcessExpressionType(Expression exp)
                   // If either both are class or both are not class
                   ((type1.kind == classType && type1._class && strcmp(type1._class.string, "String")) == (type2.kind == classType && type2._class && strcmp(type2._class.string, "String"))))
                {
-                  if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
-                  exp.op.exp2.destType = type1;
-                  type1.refCount++;
-                  if(exp.op.exp1.destType) FreeType(exp.op.exp1.destType);
-                  exp.op.exp1.destType = type2;
-                  type2.refCount++;
+                  // Added this check for enum subtraction to result in an int type:
+                  if(exp.op.op == '-' &&
+                     ((type1.kind == classType && type1._class.registered && type1._class.registered.type == enumClass) ||
+                      (type2.kind == classType && type2._class.registered && type2._class.registered.type == enumClass)) )
+                  {
+                     Type intType;
+                     if(!type1._class.registered.dataType)
+                        type1._class.registered.dataType = ProcessTypeString(type1._class.registered.dataTypeString, false);
+                     if(!type2._class.registered.dataType)
+                        type2._class.registered.dataType = ProcessTypeString(type2._class.registered.dataTypeString, false);
+
+                     intType = ProcessTypeString(
+                        (type1._class.registered.dataType.kind == int64Type || type2._class.registered.dataType.kind == int64Type) ? "int64" : "int", false);
+
+                     if(exp.op.exp1.destType) FreeType(exp.op.exp1.destType);
+                     if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
+                     exp.op.exp1.destType = intType;
+                     exp.op.exp2.destType = intType;
+                     intType.refCount++;
+                  }
+                  else
+                  {
+                     if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
+                     exp.op.exp2.destType = type1;
+                     type1.refCount++;
+                     if(exp.op.exp1.destType) FreeType(exp.op.exp1.destType);
+                     exp.op.exp1.destType = type2;
+                     type2.refCount++;
+                  }
+
                   // Warning here for adding Radians + Degrees with no destination type
                   if(!boolResult && type1.kind == classType && (!exp.destType || exp.destType.kind != classType) &&
                      type1._class.registered && type1._class.registered.type == unitClass &&
@@ -8588,36 +8695,81 @@ void ProcessExpressionType(Expression exp)
                   }
 
                   // TESTING THIS NEW CODE
-                  if(!boolResult || exp.op.op == '>' || exp.op.op == '<')
+                  if(!boolResult || exp.op.op == '>' || exp.op.op == '<' || exp.op.op == GE_OP || exp.op.op == LE_OP)
                   {
-                     if(type1.kind == classType && type1._class && type1._class.registered && type1._class.registered.type == enumClass && exp.op.exp2.expType)
+                     bool op1IsEnum = type1 && type1.kind == classType && type1._class && type1._class.registered && type1._class.registered.type == enumClass;
+                     bool op2IsEnum = type2 && type2.kind == classType && type2._class && type2._class.registered && type2._class.registered.type == enumClass;
+                     if(exp.op.op == '*' || exp.op.op == '/' || exp.op.op == '-' || exp.op.op == '|' || exp.op.op == '^')
                      {
-                        if(CheckExpressionType(exp.op.exp1, exp.op.exp2.expType, false))
+                        // Convert the enum to an int instead for these operators
+                        if(op1IsEnum && exp.op.exp2.expType)
                         {
-                           if(exp.expType) FreeType(exp.expType);
-                           exp.expType = exp.op.exp1.expType;
-                           if(exp.op.exp2.expType) exp.op.exp1.expType.refCount++;
-                           valid = true;
+                           if(CheckExpressionType(exp.op.exp1, exp.op.exp2.expType, false))
+                           {
+                              if(exp.expType) FreeType(exp.expType);
+                              exp.expType = exp.op.exp2.expType;
+                              if(exp.op.exp2.expType) exp.op.exp2.expType.refCount++;
+                              valid = true;
+                           }
+                        }
+                        else if(op2IsEnum && exp.op.exp1.expType)
+                        {
+                           if(CheckExpressionType(exp.op.exp2, exp.op.exp1.expType, false))
+                           {
+                              if(exp.expType) FreeType(exp.expType);
+                              exp.expType = exp.op.exp1.expType;
+                              if(exp.op.exp1.expType) exp.op.exp1.expType.refCount++;
+                              valid = true;
+                           }
                         }
                      }
-
-                     else if(type2 && (type2.kind == classType && type2._class && type2._class.registered && type2._class.registered.type == enumClass && exp.op.exp1.expType))
+                     else
                      {
-                        if(CheckExpressionType(exp.op.exp2, exp.op.exp1.expType, false))
+                        if(op1IsEnum && exp.op.exp2.expType)
                         {
-                           if(exp.expType) FreeType(exp.expType);
-                           exp.expType = exp.op.exp2.expType;
-                           if(exp.op.exp2.expType) exp.op.exp2.expType.refCount++;
-                           valid = true;
+                           if(CheckExpressionType(exp.op.exp1, exp.op.exp2.expType, false))
+                           {
+                              if(exp.expType) FreeType(exp.expType);
+                              exp.expType = exp.op.exp1.expType;
+                              if(exp.op.exp1.expType) exp.op.exp1.expType.refCount++;
+                              valid = true;
+                           }
+                        }
+                        else if(op2IsEnum && exp.op.exp1.expType)
+                        {
+                           if(CheckExpressionType(exp.op.exp2, exp.op.exp1.expType, false))
+                           {
+                              if(exp.expType) FreeType(exp.expType);
+                              exp.expType = exp.op.exp2.expType;
+                              if(exp.op.exp2.expType) exp.op.exp2.expType.refCount++;
+                              valid = true;
+                           }
                         }
                      }
                   }
 
                   if(!valid)
                   {
-                     if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
-                     exp.op.exp2.destType = type1;
-                     type1.refCount++;
+                     // Added this first part of the if here to handle  5 + Degrees { 5 } with either a base unit dest or not a unit dest type
+                     if(type2 && type2.kind == classType && type2._class && type2._class.registered && type2._class.registered.type == unitClass &&
+                        (type1.kind != classType || !type1._class || !type1._class.registered || type1._class.registered.type != unitClass))
+                     {
+                        if(exp.op.exp1.destType) FreeType(exp.op.exp1.destType);
+                        exp.op.exp1.destType = type2;
+                        type2.refCount++;
+
+                        if(CheckExpressionType(exp.op.exp1, exp.op.exp1.destType, false))
+                        {
+                           if(exp.expType) FreeType(exp.expType);
+                           exp.expType = exp.op.exp1.destType;
+                           if(exp.op.exp1.destType) exp.op.exp1.destType.refCount++;
+                        }
+                     }
+                     else
+                     {
+                        if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
+                        exp.op.exp2.destType = type1;
+                        type1.refCount++;
 
                      /*
                      // Maybe this was meant to be an enum...
@@ -8659,43 +8811,44 @@ void ProcessExpressionType(Expression exp)
                      }
                      */
 
-                     if(CheckExpressionType(exp.op.exp2, exp.op.exp2.destType, false))
-                     {
-                        if(exp.expType) FreeType(exp.expType);
-                        exp.expType = exp.op.exp2.destType;
-                        if(exp.op.exp2.destType) exp.op.exp2.destType.refCount++;
-                     }
-                     else if(type1 && type2)
-                     {
-                        char expString1[10240];
-                        char expString2[10240];
-                        char type1String[1024];
-                        char type2String[1024];
-                        expString1[0] = '\0';
-                        expString2[0] = '\0';
-                        type1String[0] = '\0';
-                        type2String[0] = '\0';
-                        if(inCompiler)
+                        if(CheckExpressionType(exp.op.exp2, exp.op.exp2.destType, false))
                         {
-                           PrintExpression(exp.op.exp1, expString1);
-                           ChangeCh(expString1, '\n', ' ');
-                           PrintExpression(exp.op.exp2, expString2);
-                           ChangeCh(expString2, '\n', ' ');
-                           PrintType(exp.op.exp1.expType, type1String, false, true);
-                           PrintType(exp.op.exp2.expType, type2String, false, true);
+                           if(exp.expType) FreeType(exp.expType);
+                           exp.expType = exp.op.exp2.destType;
+                           if(exp.op.exp2.destType) exp.op.exp2.destType.refCount++;
                         }
+                        else if(type1 && type2)
+                        {
+                           char expString1[10240];
+                           char expString2[10240];
+                           char type1String[1024];
+                           char type2String[1024];
+                           expString1[0] = '\0';
+                           expString2[0] = '\0';
+                           type1String[0] = '\0';
+                           type2String[0] = '\0';
+                           if(inCompiler)
+                           {
+                              PrintExpression(exp.op.exp1, expString1);
+                              ChangeCh(expString1, '\n', ' ');
+                              PrintExpression(exp.op.exp2, expString2);
+                              ChangeCh(expString2, '\n', ' ');
+                              PrintType(exp.op.exp1.expType, type1String, false, true);
+                              PrintType(exp.op.exp2.expType, type2String, false, true);
+                           }
 
-                        Compiler_Warning($"incompatible expressions %s (%s) and %s (%s)\n", expString1, type1String, expString2, type2String);
+                           Compiler_Warning($"incompatible expressions %s (%s) and %s (%s)\n", expString1, type1String, expString2, type2String);
 
-                        if(type1.kind == classType && type1._class && type1._class.registered && type1._class.registered.type == enumClass)
-                        {
-                           exp.expType = exp.op.exp1.expType;
-                           if(exp.op.exp1.expType) exp.op.exp1.expType.refCount++;
-                        }
-                        else if(type2.kind == classType && type2._class && type2._class.registered && type2._class.registered.type == enumClass)
-                        {
-                           exp.expType = exp.op.exp2.expType;
-                           if(exp.op.exp2.expType) exp.op.exp2.expType.refCount++;
+                           if(type1.kind == classType && type1._class && type1._class.registered && type1._class.registered.type == enumClass)
+                           {
+                              exp.expType = exp.op.exp1.expType;
+                              if(exp.op.exp1.expType) exp.op.exp1.expType.refCount++;
+                           }
+                           else if(type2.kind == classType && type2._class && type2._class.registered && type2._class.registered.type == enumClass)
+                           {
+                              exp.expType = exp.op.exp2.expType;
+                              if(exp.op.exp2.expType) exp.op.exp2.expType.refCount++;
+                           }
                         }
                      }
                   }
@@ -8842,6 +8995,7 @@ void ProcessExpressionType(Expression exp)
             if(!e.next)
             {
                FreeType(e.destType);
+               e.opDestType = exp.opDestType;
                e.destType = exp.destType;
                if(e.destType) { exp.destType.refCount++; e.destType.count++; inced = true; }
             }
index be9c4ac..612adef 100644 (file)
@@ -717,7 +717,7 @@ public void DeclareClass(Symbol classSym, char * className)
          if(!classSym.module) return;
          classSym._import = ClassImport
          {
-            isRemote = classSym.registered ? classSym.registered.isRemote : false;
+            isRemote = classSym.registered ? classSym.registered.isRemote : 0;
             name = CopyString(classSym.string);
          };
          classSym.module.classes.Add(classSym._import);
index dcc2c96..b4a84bc 100644 (file)
@@ -7,7 +7,7 @@ extern External curExternal;
 ///////////////// INSTANCE DECLARATION PASS ///////////////////////
 
 // Returns true if we should add a * to the declarator
-static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
+static int ReplaceClassSpec(OldList specs, Specifier spec, bool param)
 {
    if(spec.type == templateTypeSpecifier)
    {
@@ -31,7 +31,7 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
             if(decl)
                FreeDeclarator(decl);
             if(isPointer)
-               return true;
+               return 1;
          }
       }
       else if(!param && parameter.dataType)
@@ -49,7 +49,7 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
          {
             bool isPointer = decl.type == pointerDeclarator;
             if(isPointer)
-               return true;
+               return 1;
          }
       }
       else
@@ -153,7 +153,7 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
             {
                spec.type = baseSpecifier;
                spec.specifier = VOID;
-               return true;
+               return 1;
             }
          }
          else
@@ -168,9 +168,9 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
          }
 
          if(_class && _class.dataTypeString && !strcmp(_class.dataTypeString, "char *"))
-            return true; //false;
+            return 1; //false;
          if(!_class || _class.type == normalClass || _class.type == noHeadClass)
-            return true;
+            return 1;
          else if(param && _class.type == structClass)
             return 2;
       }
@@ -180,10 +180,10 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
       if(spec.specifier == ANY_OBJECT)
       {
          spec.specifier = VOID;
-         return true;
+         return 1;
       }
    }
-   return false;
+   return 0;
 }
 
 static void ReplaceByInstancePtr(Specifier spec, Declarator * declPtr, int type)
index bd06074..3345322 100644 (file)
@@ -296,7 +296,7 @@ public:
 
    int count;     // DEBUGGING
 
-   bool isRemote;
+   int isRemote;  // TODO: Convert to an enum, can have values 0..3
    bool internalDecl;
    void * data;
    bool computeSize;
index f19ee4a..2ecbcc7 100644 (file)
@@ -799,7 +799,7 @@ static bool ReadTriMesh(FileInfo * info, Object object)
 
                   triangle->material = mat;
 
-                  face->done = (byte)bool::true;
+                  face->done = true;
                   object.flags.translucent = true;
                }
             }
@@ -826,7 +826,7 @@ static bool ReadTriMesh(FileInfo * info, Object object)
                         group.indices32[c*3+1] = face->indices[1];
                         group.indices32[c*3+2] = face->indices[2];
                      }
-                     face->done = (byte)bool::true;
+                     face->done = true;
                      c++;
                   }
                   mesh.UnlockPrimitiveGroup(group);
index 628ab93..ef3f7d1 100644 (file)
@@ -787,7 +787,7 @@ private class ColorValue : Color
          for(item = ((EnumClassData)class(DefinedColor).data).values.first; item; item = item.next)
          {
             DataRow row = defined.AddRow();
-            row.SetData(definedColorField, (Color)item.data);
+            row.SetData(definedColorField, (Color)(uint)item.data);
             strcpy(tempString, item.name);
             tempString[0] = (char)toupper(tempString[0]);
             row.SetData(definedColorName, tempString);
@@ -810,7 +810,7 @@ private class ColorValue : Color
          for(item = ((EnumClassData)class(SystemColor).data).values.first; item; item = item.next)
          {
             DataRow row = system.AddRow();
-            row.SetData(sysColorField, (Color)item.data);
+            row.SetData(sysColorField, (Color)(uint)item.data);
             strcpy(tempString, item.name);
             tempString[0] = (char)toupper(tempString[0]);
             row.SetData(sysColorName, tempString);
index 96e80b2..6dd8aa8 100644 (file)
@@ -1123,9 +1123,9 @@ class Direct3D9DisplayDriver : DisplayDriver
             break;
          case vSync:
          {
-            if(d3dDisplay.vSync != value)
+            if(d3dDisplay.vSync != (bool)value)
             {
-               d3dDisplay.vSync = value;
+               d3dDisplay.vSync = (bool)value;
                DisplaySize(display, display.width, display.height);
             }
             break;
index ac0e8c0..0014eba 100644 (file)
@@ -360,7 +360,7 @@ class GlyphPack : BTNode
       FontEntry fontEntry = null;
       FT_Face faces[128];
       float scales[128];
-      bool isGlyph = (uint)key & 0x80000000;
+      bool isGlyph = ((uint)key & 0x80000000) != 0;
       int curScript = ((uint)key & 0x7F000000) >> 24;
       unichar testChar = 0;
       /*
@@ -666,7 +666,7 @@ static uint * shaping(FontEntry entry, uint16 * string, int len, HB_Script scrip
   }
 
    *numGlyphs = shaper_item.num_glyphs;
-   *rightToLeft = shaper_item.item.bidiLevel % 2;
+   *rightToLeft = (bool)(shaper_item.item.bidiLevel % 2);
    return shaper_item.glyphs;
 }
 
index f8c2aaf..1533928 100644 (file)
@@ -3165,7 +3165,7 @@ class OpenGLDisplayDriver : DisplayDriver
             break;
          case depthWrite:
             if(value) glDepthMask((byte)bool::true); else glDepthMask((byte)bool::false);
-            oglDisplay.depthWrite = value;
+            oglDisplay.depthWrite = (bool)value;
             break;
          case fogColor:
          {
index 55ef738..9c62c63 100644 (file)
@@ -11,6 +11,11 @@ public struct AnchorValue
       int distance;
       float percent;
    };
+   property MinMaxValue
+   {
+      set { distance = value; type = offset; }
+      get { return distance; }
+   }
    property int
    {
       set { distance = value; type = offset; }
@@ -98,6 +103,11 @@ public struct MiddleAnchorValue
       int distance;
       float percent;
    };
+   property MinMaxValue
+   {
+      set { distance = value; type = none; }
+      get { return distance; }
+   }
    property int
    {
       set { distance = value; type = none; }
index 7261628..15a9ec4 100644 (file)
@@ -1294,8 +1294,8 @@ private:
       }
    }
 
-   int CheckColors(EditLine line, int wc, bool selection, int selX, int editX, bool *selected,
-                   Color selectionForeground, Color selectionBackground, Color textColor, Color *foreground, Color *background, bool *opacity, bool *overwrite)
+   bool CheckColors(EditLine line, int wc, bool selection, int selX, int editX, bool *selected,
+                    Color selectionForeground, Color selectionBackground, Color textColor, Color *foreground, Color *background, bool *opacity, int *overwrite)
    {
       bool flush = false;
 
@@ -1319,7 +1319,7 @@ private:
          if((style.stuckCaret && wc == line.count && !line.next) ||
             (!mouseMove && line == this.line && wc == editX))
          {
-            *overwrite = true;
+            *overwrite = 1;
             flush = true;
          }
       }
@@ -1491,9 +1491,9 @@ private:
       bool opacity;
 
       // Overwrite Caret Stuff
-      bool overWrite = false;
+      int overWrite = 0;
       int overWriteX, overWriteY;
-      byte overWriteCh;
+      char overWriteCh;
 
       // ****** SYNTAX STATES ******
       bool inMultiLineComment = style.inMultiLineComment;
@@ -1968,7 +1968,7 @@ private:
                {
                   flush = CheckColors(line, wc, selection, selX, editX, &selected, selectionForeground,
                      selectionBackground, textColor, &foreground, &background, &opacity, &overWrite);
-                  if(overWrite == true)
+                  if(overWrite == 1)
                   {
                      overWriteCh = (wc < line.count) ? line.buffer[wc] : ' ';
                      if(overWriteCh == '\t') overWriteCh = ' ';
@@ -1979,7 +1979,7 @@ private:
                      flagTrailingSpace = numSpaces && trailingSpace && style.syntax && start + bufferLen == line.count && line != this.line;
                      if(flagTrailingSpace) surface.SetBackground(red);
                      FlushBuffer(surface, line, wc, &renderStart, &x, y, numSpaces, flagTrailingSpace, box);
-                     if(overWrite == true)
+                     if(overWrite == 1)
                      {
                         overWriteX = x;
                         overWriteY = y;
@@ -2016,7 +2016,7 @@ private:
          if(CheckColors(line, c, selection, selX, editX, &selected, selectionForeground,
                         selectionBackground, textColor, &foreground, &background, &opacity, &overWrite))
          {
-            if(overWrite == true)
+            if(overWrite == 1)
             {
                overWriteX = x;
                overWriteY = y;
index 74a6c11..6fa3cba 100644 (file)
@@ -521,7 +521,7 @@ class Win32ConsoleInterface : Interface
    bool GetKeyState(Key key)
    {
       if(key < 256)
-         return keys[key];
+         return keys[key] != 0;
       else if(key == capsState)
          return GetKeyState(VK_CAPITAL) & 0x00000001;
       else if(key == numState)
index 3056b22..8bf565e 100644 (file)
@@ -815,7 +815,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
    }
    if(!windowData.ic)
    {
-      ch = (byte)Interface::TranslateKey(key, event->state & ShiftMask);
+      ch = (byte)Interface::TranslateKey(key, (event->state & ShiftMask) != 0);
       // 127 is delete, we don't treat that as a character (Use (SmartKey)key == del)
       if(ch == 128 || ch == 127) ch = 0;
    }
index e90f3d8..85f6717 100644 (file)
@@ -821,7 +821,7 @@ private:
       return eof;
    }
 
-   bool GetSize()
+   uint GetSize()
    {
       return totalSize;
    }
index ac5a6df..15b41fa 100644 (file)
@@ -735,7 +735,7 @@ public:
    {
       if(thread)
          thread.connected = false;
-      answered = 2;
+      answered = true; //2;
    }
 
    dllexport bool CallMethod(unsigned int methodID)
index c2551b9..1230c46 100644 (file)
@@ -44,7 +44,7 @@ public class DualPipe : File
    bool Seek(int pos, FileSeekMode mode) { return (input || output) ? File::Seek(pos, mode) : DualPipe_Seek(dp, pos, mode); }
    uint Tell() { return (input || output) ? File::Tell() : DualPipe_Tell(dp); }
    bool Eof() { return DualPipe_Eof(dp); }
-   bool GetSize() { return (input || output) ? File::GetSize() : DualPipe_GetSize(dp); }
+   uint GetSize() { return (input || output) ? File::GetSize() : DualPipe_GetSize(dp); }
 
 public:
    bool Peek() { return DualPipe_Peek(dp); }
index 3cba8bf..0324ba7 100644 (file)
@@ -1340,7 +1340,7 @@ class EARFile : File
       return position >= size || (f && f.Eof());
    }
 
-   bool GetSize()
+   uint GetSize()
    {
       return size;
    }
index e652211..8a91baa 100644 (file)
@@ -516,7 +516,7 @@ public:
 
    virtual bool Eof(void)
    {
-      return input ? feof(input) : true;
+      return input ? feof(input) != 0 : true;
    }
 
    virtual bool Truncate(FileSize size)
index 8f9d32e..1e71293 100644 (file)
@@ -173,7 +173,7 @@ public class TempFile : File
       return eof;
    }
 
-   bool GetSize()
+   uint GetSize()
    {
       return size;
    }
index 4bc49d9..2c5c1b2 100644 (file)
@@ -1491,7 +1491,7 @@ class SQLiteRow : DriverRow
          result = GoToSysID(*(int *)data);
          if(result)
             findSysID = true;
-         return result;
+         return result != 0;
       }
 
       useIndex = tbl.GetIndexOrder(order, false);
index 957d6ae..f64449e 100644 (file)
@@ -49,9 +49,9 @@ public:
    {
       set
       {
-         if(value != (compileFlags & REG_ICASE))
+         if(value != ((compileFlags & REG_ICASE) != 0))
          {
-            compileFlags = value ? compileFlags | REG_ICASE : compileFlags & ~REG_ICASE;
+            value ? (compileFlags |= REG_ICASE) : (compileFlags &= ~REG_ICASE);
             if(regex)
                Compile();
          }
@@ -63,10 +63,13 @@ public:
    {
       set
       {
-         if(value != (compileFlags & REG_NEWLINE))
-            compileFlags = value ? compileFlags | REG_NEWLINE : compileFlags & ~REG_NEWLINE;
-         if(regex)
-            Compile();
+         //if(value != ((compileFlags & REG_NEWLINE) != 0))
+         if(value != ((compileFlags & REG_EXTENDED)))
+         {
+            value ? (compileFlags |= REG_NEWLINE) : (compileFlags &= ~REG_NEWLINE);
+            if(regex)
+               Compile();
+         }
       }
       get { return (compileFlags & REG_NEWLINE) != 0; }
    }
@@ -75,8 +78,8 @@ public:
    {
       set
       {
-         if(value != (executeFlags & REG_NOTBOL))
-            executeFlags = value ? executeFlags | REG_NOTBOL : executeFlags & ~REG_NOTBOL;
+         if(value != ((executeFlags & REG_NOTBOL) != 0))
+            value ? (executeFlags |= REG_NOTBOL) : (executeFlags &= ~REG_NOTBOL);
       }
       get { return (executeFlags & REG_NOTBOL) != 0; }
    }
@@ -85,8 +88,8 @@ public:
    {
       set
       {
-         if(value != (executeFlags & REG_NOTEOL))
-            executeFlags = value ? executeFlags | REG_NOTEOL : executeFlags & ~REG_NOTEOL;
+         if(value != ((executeFlags & REG_NOTEOL) != 0))
+            value ? (executeFlags |= executeFlags | REG_NOTEOL) : (executeFlags &= ~REG_NOTEOL);
       }
       get { return (executeFlags & REG_NOTEOL) != 0; }
    }
@@ -95,9 +98,9 @@ public:
    {
       set
       {
-         if(value != (compileFlags & REG_EXTENDED))
+         if(value != ((compileFlags & REG_EXTENDED) != 0))
          {
-            compileFlags = value ? compileFlags | REG_EXTENDED : compileFlags & ~REG_EXTENDED;
+            value ? (compileFlags |= REG_EXTENDED) : (compileFlags &= ~REG_EXTENDED);
             if(regex)
                Compile();
          }
index 5bcd293..8428dc8 100644 (file)
@@ -44,7 +44,7 @@ ColorKey skinGradient[3] =
 {
    { Color { 40,40,40 }, 0.0f },
    { darkGray, 0.5f },
-   { Color { 40,40,40 }, 1.0f },
+   { Color { 40,40,40 }, 1.0f }
 };
 
 class SimSkin_Window : Window
index 7c41f7f..a7f9d77 100644 (file)
@@ -128,7 +128,7 @@ String ParseURL(String input)
    return renew output char[len];
 }
 
-/*static */bool GetKeyWordEx(char ** input, char * keyWord, int maxSize, bool treatEqual, bool acceptSingleQuote)
+/*static */int GetKeyWordEx(char ** input, char * keyWord, int maxSize, bool treatEqual, bool acceptSingleQuote)
 {
    char * string = *input;
    char ch;
@@ -171,7 +171,7 @@ String ParseURL(String input)
    return (c > 0) ? (wasQuoted ? WORD_QUOTED : WORD_NORMAL) : WORD_NONE;
 }
 
-static bool GetKeyWord(char ** input, char * keyWord, int maxSize)
+static int GetKeyWord(char ** input, char * keyWord, int maxSize)
 {
    return GetKeyWordEx(input, keyWord, maxSize, true, false);
 }
index b268f5a..b13c0f5 100644 (file)
@@ -762,7 +762,7 @@ public enum CompilerType
       {
          if(value)
          {
-            Platform c;
+            CompilerType c;
             for(c = firstCompilerType; c <= lastCompilerType; c++)
                if(!strcmpi(value, compilerTypeNames[c]))
                   return c;
index 5d8b667..21a5c3d 100644 (file)
@@ -2920,7 +2920,7 @@ private:
             f.Puts("\n");
          }
 
-         topNode.GenMakeCollectAssignNodeFlags(config, numCObjects,
+         topNode.GenMakeCollectAssignNodeFlags(config, numCObjects != 0,
                cflagsVariations, nodeCFlagsMapping,
                ecflagsVariations, nodeECFlagsMapping, null);
 
index e7acf69..3fcb2c3 100644 (file)
@@ -50,7 +50,7 @@ class MainForm : Window
    Button tabScl { tabButtons, master = this, stayDown = true, size = { 70, 20 }, anchor = { right = 10 + 3 * 80 }, caption = "Sub-Classes",  id = (int64)sclEditor, NotifyClicked = NotifyClicked };
    Button tabCls { tabButtons, master = this, stayDown = true, size = { 70, 20 }, anchor = { right = 10 + 2 * 80 }, caption = "Classes",       id = (int64)clsEditor, NotifyClicked = NotifyClicked };
    Button tabRes { tabButtons, master = this, stayDown = true, size = { 70, 20 }, anchor = { right = 10 + 1 * 80 }, caption = "Restrictions",  id = (int64)rstEditor, NotifyClicked = NotifyClicked };
-   Button tabMed { tabButtons, master = this, stayDown = true, size = { 70, 20 }, anchor = { right = 10 + 0 * 80},  caption = "Drugs",   id = (int64)medEditor, NotifyClicked = NotifyClicked };
+   Button tabMed { tabButtons, master = this, stayDown = true, size = { 70, 20 }, anchor = { right = 10 + 0 * 80 },  caption = "Drugs",   id = (int64)medEditor, NotifyClicked = NotifyClicked };
 }
 
 class RestrictionEditor : Window
index b3371c5..7495e41 100644 (file)
@@ -151,14 +151,14 @@ class NeuralApp : Application
                outputNeurons[c].Unactivate();
 
             inputNeurons[0].activation = (double)example->health;
-            inputNeurons[1].activation = example->hasKnife;
-            inputNeurons[2].activation = example->hasGun;
+            inputNeurons[1].activation = (double)example->hasKnife;
+            inputNeurons[2].activation = (double)example->hasGun;
             inputNeurons[3].activation = example->ennemies;
             for(c = 0; c<NUM_OUTPUT; c++)
                outputNeurons[c].Activate();
 
             for(c = 0; c<NUM_OUTPUT; c++)
-               outputNeurons[c].error = ((double)example->result == c) - outputNeurons[c].activation;
+               outputNeurons[c].error = (double)((int)example->result == c) - outputNeurons[c].activation;
 
             for(c = 0; c<NUM_INPUT; c++)
                inputNeurons[c].BackPropagate();
@@ -177,8 +177,8 @@ class NeuralApp : Application
             outputNeurons[o].Unactivate();
 
          inputNeurons[0].activation = (double)example->health;
-         inputNeurons[1].activation = example->hasKnife;
-         inputNeurons[2].activation = example->hasGun;
+         inputNeurons[1].activation = (double)example->hasKnife;
+         inputNeurons[2].activation = (double)example->hasGun;
          inputNeurons[3].activation = example->ennemies;
 
          for(o = 0; o<NUM_OUTPUT; o++)
@@ -199,8 +199,8 @@ class NeuralApp : Application
             outputNeurons[o].Unactivate();
 
          inputNeurons[0].activation = (double)example->health;
-         inputNeurons[1].activation = example->hasKnife;
-         inputNeurons[2].activation = example->hasGun;
+         inputNeurons[1].activation = (double)example->hasKnife;
+         inputNeurons[2].activation = (double)example->hasGun;
          inputNeurons[3].activation = example->ennemies;
 
          for(o = 0; o<NUM_OUTPUT; o++)
index 8f1bf45..54301eb 100644 (file)
@@ -75,7 +75,7 @@ static bool POKER_Same(int cards[5], int howMany, int what[2], int rest[3])
             rest[d++] = cards[c];
       }
    }
-   return numPairs;
+   return numPairs != 0;
 }
 
 // --- External Functions ---
index aeee025..8301ee6 100644 (file)
@@ -2,13 +2,13 @@ import "chess.ec"
 
 class AboutChess : Window
 {
-   background = black; 
+   background = black;
    foreground = white, size = Size { 440, 200 }, hasClose = true,
    text = APPNAME;
 
    Button ok
    {
-      this, isDefault = true, text = "OK", 
+      this, isDefault = true, text = "OK",
       anchor = { bottom = 10 }, size = { 80 };
 
       NotifyClicked = ButtonCloseDialog;
index 2e4bcd4..e623d3b 100644 (file)
@@ -12,7 +12,7 @@ define MAXDEPTH_PASS2 = 50;
 
 static MoveStack moveStack[MAXDEPTH_PASS2];
 
-void AddMoveToList(MoveStack stack, ChessState state, PieceType type, Player player, 
+void AddMoveToList(MoveStack stack, ChessState state, PieceType type, Player player,
                    int x1, int y1, int x2, int y2)
 {
    if(IsMoveValid(x1,y1,x2,y2, state, null, true))
@@ -133,7 +133,7 @@ void GeneratePieceMoveList(ChessState state, int x, int y, MoveStack stack)
                AddMoveToList(stack, state, type, player, x,y,x,y2);
             }
          }
-         break;      
+         break;
       case King:
          AddMoveToList(stack, state, type, player, x,y, x,y+1);
          AddMoveToList(stack, state, type, player, x,y, x+1,y+1);
@@ -338,8 +338,8 @@ class AIThread : Thread
    bool abortAI;
    ChessMove aiMove;
 
-   Timer aiTimer 
-   { 
+   Timer aiTimer
+   {
       this, 0.1;
 
       bool DelayExpired()
index 9f09b8c..b88af3d 100644 (file)
@@ -147,8 +147,8 @@ class Chess2D : Window
       if(!flip) y = 7-y; else x = 7-x;
 
       if(chessState->gameRunning &&
-         x < 8 && y < 8 && x >= 0 && y >= 0 && chessState->board[y][x] && 
-         chessState->isLocalPlayer[chessState->turn] && 
+         x < 8 && y < 8 && x >= 0 && y >= 0 && chessState->board[y][x] &&
+         chessState->isLocalPlayer[chessState->turn] &&
          chessState->board[y][x].player == chessState->turn)
       {
          dragging = true;
@@ -205,7 +205,7 @@ class Chess2D : Window
 
       if(x < 8 && y < 8 && x >= 0 && y >= 0 && dragging)
       {
-         drag.x = x;    
+         drag.x = x;
          drag.y = y;
          Update(null);
       }
index a09fd47..37336a9 100644 (file)
@@ -3,7 +3,7 @@ import "chess.ec"
 static char * names[Player][PieceType] =
 {
    { "", "WhitePawn", "WhiteKnigh", "WhiteBisho", "WhiteRook", "WhiteQueen", "WhiteKing" },
-   { "", "BlackPawn", "BlackKnigh", "BlackBisho", "BlackRook", "BlackQueen", "BlackKing" },
+   { "", "BlackPawn", "BlackKnigh", "BlackBisho", "BlackRook", "BlackQueen", "BlackKing" }
 };
 
 define SQUARE = squareSize; // 160;
@@ -11,9 +11,9 @@ define SQUARE_OFFSET = SQUARE * 3.5f;
 
 class Chess3D : Window
 {
-   Camera camera 
-   { 
-      attached, fov = 45, zMin = 50,zMax = 5000, 
+   Camera camera
+   {
+      attached, fov = 45, zMin = 50,zMax = 5000,
       position = { 0, 0, -1000 },
       orientation = Euler { 30, 30, 0 }
    };
@@ -61,14 +61,14 @@ class Chess3D : Window
    {
       Player player = atBoard.player;
       PieceType type = atBoard.type;
-      
+
       if(type)
       {
          char * name = names[player][type];
          Object object = chessSet.Find(name);
          if(object)
          {
-         
+
             float height = 0;
             if(high)
             {
@@ -90,7 +90,7 @@ class Chess3D : Window
                x * SQUARE - SQUARE_OFFSET,
                offsetY - height;
                y * SQUARE - SQUARE_OFFSET };
-            
+
             object.UpdateTransform();
 
             object.tag = (void *)(((y)*8)+(x)+1);
@@ -117,18 +117,18 @@ class Chess3D : Window
          RenderPiece(atBoard, x, y, false);
       }
    }
-   
+
    void RenderBoard()
    {
       display.DrawObject(chessBoard);
-  
+
       if(chessState->gameRunning)
       {
          int x,y;
          for(y=0; y<8; y++)
                 for(x=0; x<8; x++)
                RenderSquare(x, y);
-         
+
          if(useDrag && pieceSelected)
          {
             Piece atBoard = chessState->board[start.y][start.x];
@@ -155,7 +155,7 @@ class Chess3D : Window
    bool OnLeftButtonDown(int x, int y, Modifiers mods)
    {
       OldList list {};
-                   
+
       display.StartSelection(x,y, 0,0);
       display.SetCamera(null, camera);
       display.CollectHits();
@@ -180,15 +180,15 @@ class Chess3D : Window
             pieceSelected = false;
             ((Chess)master).ProcessUserMove(start.x, start.y, sx, sy);
          }
-         else if(chessState->board[sy][sx] && 
-            chessState->isLocalPlayer[chessState->turn] && 
+         else if(chessState->board[sy][sx] &&
+            chessState->isLocalPlayer[chessState->turn] &&
             chessState->board[sy][sx].player == chessState->turn)
          {
             if(useDrag)
             {
                Vector3D viewSpace, worldSpace;
                display.IntersectPolygons();
-               RenderSquare(sx, sy);               
+               RenderSquare(sx, sy);
                display.GetIntersect(viewSpace);
 
                camera.Untransform(viewSpace, worldSpace);
@@ -205,7 +205,7 @@ class Chess3D : Window
 
             OnMouseMove(x, y, mods);
          }
-         
+
          list.Free(null);
       }
       else if(display.DrawObject(chessBoard) && !moving && !lightMoving)
@@ -282,12 +282,12 @@ class Chess3D : Window
       else if(lightMoving)
       {
          light.orientation = Euler
-         { 
-            startOrientation.yaw + (x - startPosition.x), 
-            startOrientation.pitch + (y - startPosition.y), 
-            90 
+         {
+            startOrientation.yaw + (x - startPosition.x),
+            startOrientation.pitch + (y - startPosition.y),
+            90
          };
-         
+
          Update(null);
       }
       else if(pieceSelected && useDrag)
@@ -347,7 +347,7 @@ class Chess3D : Window
             Update(null);
             break;
          case wheelUp:
-         case equal: camera.position.z /= 1.1f; 
+         case equal: camera.position.z /= 1.1f;
             if(camera.position.z >= -1100)
                camera.position.z = -1100;
             Update(null);
index 53ffb94..c58146b 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    chessutils.ec - Utilities to validate moves
 ****************************************************************************/
 import "chess.ec"
@@ -98,10 +98,10 @@ static bool BasicMove(Piece board[8][8], int x1, int y1, int x2, int y2)
                valid = true;
             break;
          case Queen:
-            if((!Abs(dx) || !Abs(dy) || Abs(dx) == Abs(dy)) && 
+            if((!Abs(dx) || !Abs(dy) || Abs(dx) == Abs(dy)) &&
                FreeWay(board, x1,y1,x2,y2))
                valid = true;
-            break;      
+            break;
          case King:
             if(Abs(dx) <= 1 && Abs(dy) <= 1)
                valid = true;
@@ -184,12 +184,12 @@ bool IsMoveValid(int x1, int y1, int x2, int y2, ChessState state, Piece endBoar
                   if(x1 == x2 && !state.board[y2][x2])
                      valid = true;
                   // En Passant
-                  else if(Abs(dx) == 1 && 
+                  else if(Abs(dx) == 1 &&
                           x2 == state.enPassant.x && y2 == state.enPassant.y + direction)
                      valid = true;
                }
                // First 2 Squares Move
-               else if(y2 - y1 == direction * 2 && y1 == start && x1 == x2 
+               else if(y2 - y1 == direction * 2 && y1 == start && x1 == x2
                   && !state.board[y1+direction][x1] && !state.board[y2][x1])
                   valid = true;
                break;
@@ -201,7 +201,7 @@ bool IsMoveValid(int x1, int y1, int x2, int y2, ChessState state, Piece endBoar
                   if(!state.kingMoved[player] && !Check(state, player, x1, y1))
                   {
                      // King Side
-                     if(dx == 2 && !state.kRookMoved[player] && 
+                     if(dx == 2 && !state.kRookMoved[player] &&
                         !state.board[y1][5] && !state.board[y1][6] &&
                         !Check(state, player, 5, y1))
                         valid = true;
@@ -299,7 +299,7 @@ bool StateMakeMove(ChessState state, int x1, int y1, int x2, int y2, PieceType p
       if(delta)
          *delta = materialValues[Pawn];
    }
-   
+
    if(IsMoveValid(x1,y1,x2,y2, state, state.board, validate))
    {
       valid = true;
@@ -367,5 +367,5 @@ bool StateMakeMove(ChessState state, int x1, int y1, int x2, int y2, PieceType p
       state.turn ^= 1;
       state.numMoves ++;
    }
-   return valid;   
+   return valid;
 }
index cbb2a19..05ceff3 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    promotion.c - Pawn Promotion Window
 ****************************************************************************/
 import "chessutils.ec"
index a520507..69cd119 100644 (file)
@@ -7,8 +7,7 @@ public enum PlayerColor : byte
    blue, yellow, red, green;
    property CornerBlocksColor
    {
-      // TOFIX: get { return (CornerBlocksColor)((int)this+1); }
-      get { return (CornerBlocksColor)*(int *)&this+1; }
+      get { return (CornerBlocksColor)((int)this+1); }
    }
 };
 
@@ -248,8 +247,7 @@ struct CornerBlocksGameState
       PlayerColor p;
       int i;
 
-      // TOFIX: for(p = 0; p < PlayerColor::enumSize; p++)
-      for(p = blue; p <= green; p++)
+      for(p = 0; p < PlayerColor::enumSize; p++)
       {
          for(i = 0; i < numPieces; i++)
             playerPieces[p][i] = 1;
@@ -332,11 +330,11 @@ struct CornerBlocksGameState
             {
                for(x = 0; x < boardSize && !validMove; x++)
                {
-                  int flip;
+                  bool flip;
                   int direction;
                   for(direction = 0; direction < 4 && !validMove; direction++)
                   {
-                     for(flip = 0; flip <=1 && !validMove; flip++)
+                     for(flip = 0; flip <= 1 && !validMove; flip++)
                      {
                         if(ValidMove(playerColor, p, direction, flip, x, y))
                            result = validMove = true;
@@ -508,11 +506,11 @@ class CornerBlocks : Window
                         {
                            for(x = 0; x < boardSize && !validMove; x++)
                            {
-                              int flip;
+                              bool flip;
                               int direction;
                               for(direction = 0; direction < 4 && !validMove; direction++)
                               {
-                                 for(flip = 0; flip <=1 && !validMove; flip++)
+                                 for(flip = 0; flip <= 1 && !validMove; flip++)
                                  {
                                     if(gameState.ValidMove(colorPlayed, p, direction, flip, x, y))
                                     {
@@ -1121,8 +1119,7 @@ class CornerBlocksScores : Window
 
       for(p = blue; p <= green; p++)
       {
-         // TOFIX: bug here, why is -1 required?
-         int x = 80 + (p-1) * 120;
+         int x = 80 + p * 120;
          surface.foreground = colors[1][p];
          /* // GCC internal compiler error with -O2, MinGW GCC 4.4.0
          s = (state->numPlayers == 3 && p == green) ? "* Green *" : cornerBlocks.playerNames[p];
@@ -1162,10 +1159,9 @@ class CornerBlocksScores : Window
          if((state->numPlayers == 2 && p <= yellow) ||
             (state->numPlayers == 1 && p == blue))
          {
-            // TOFIX: Annoying +2 conversion issue
             if(state->numPlayers == 2)
                grandTotals[p] = state->scores[p] + state->bonus[p] +
-                                state->scores[p+red /*2*/] + state->bonus[p+red /*2*/];
+                                state->scores[p+2] + state->bonus[p+2];
             else
                grandTotals[p] = state->scores[0] + state->bonus[0] +
                                 state->scores[1] + state->bonus[1] +
index d95cf4e..d740aec 100644 (file)
@@ -391,7 +391,7 @@ class CrossWordsGame
                   anchored = true;
             }
             if(wordEnd > wordStart)
-               if(!CheckWord(newBoard, !direction, c, wordStart, wordEnd, score))
+               if(!CheckWord(newBoard, direction^1, c, wordStart, wordEnd, score))
                   return false;
          }
          else
index b48d785..1531702 100644 (file)
    },
    "Configurations" : [
       {
-         "Name" : "Default",
+         "Name" : "Debug",
          "Options" : {
             "Debug" : true,
             "FastMath" : false
          }
+      },
+      {
+         "Name" : "Release",
+         "Options" : {
+            "Optimization" : "Speed",
+            "FastMath" : true
+         }
       }
    ],
    "Files" : [
index 04888c6..d952df3 100644 (file)
@@ -121,8 +121,8 @@ class Othello : Window
       {
          board[sy][sx] = color;
          this.numChips[color] += numChips + 1;
-         this.numChips[1-color] -= numChips;
-         this.turn = 1-color;
+         this.numChips[color^1] -= numChips;
+         this.turn = color^1;
 
          if(!PossibleMove())
          {
@@ -329,7 +329,7 @@ class Othello : Window
          surface.SetForeground(tomato);
          if(gameOver)
             surface.WriteTextf(100, 420, "GAME OVER");
-         else if(!local && sockets[1-turn])
+         else if(!local && sockets[turn^1])
             surface.WriteTextf(50, 420, "It is your turn to move.");
       }
    }
@@ -345,7 +345,7 @@ class Othello : Window
       x /= WIDTH;
       y /= HEIGHT;
 
-      if(sockets[1-turn] || local)
+      if(sockets[turn^1] || local)
       {
          if(x < NUM_COLUMNS && y < NUM_ROWS && board[y][x] == empty)
          {
@@ -353,7 +353,7 @@ class Othello : Window
             if(TurnChips(x, y, turn, 1))
             {
                if(!local)
-                  sockets[1-packet.player].Send((byte *)&packet, sizeof(OPacket));
+                  sockets[packet.player^1].Send((byte *)&packet, sizeof(OPacket));
             }
          }
       }
index 564315d..f0baa2a 100644 (file)
@@ -1017,7 +1017,7 @@ static FileFilter fractalFilters[] =
 };
 static FileType fractalTypes[] =
 {
-   { "ECERE Fractal", "frc", always },
+   { "Ecere Fractal", "frc", always }
 };
 
 static FileFilter imageFilters[] =
@@ -1242,16 +1242,16 @@ class FractalsDesigner : Window
                      {
                         mandelbrot.thread.loop = loop;
                         mandelbrot.thread.maxLoops = f.GetFloat();
-                        mandelbrot.thread.useBlack = f.GetValue();
-                        mandelbrot.thread.doLoop = f.GetValue();
+                        mandelbrot.thread.useBlack = (bool)f.GetValue();
+                        mandelbrot.thread.doLoop = (bool)f.GetValue();
                      }
                      loop = f.GetValue();
                      if(loop)
                      {
                         julia.thread.loop = loop;
                         julia.thread.maxLoops = f.GetFloat();
-                        julia.thread.useBlack = f.GetValue();
-                        julia.thread.doLoop = f.GetValue();
+                        julia.thread.useBlack = (bool)f.GetValue();
+                        julia.thread.doLoop = (bool)f.GetValue();
                      }
                      else
                      {
index 40dbc03..cdd4f20 100644 (file)
@@ -83,11 +83,11 @@ class TrackXMLParser : XMLParser
          Vector3Df position { };
          while(GetWord())
          {
-            if(!strcmpi(keyWord, "x"))          { GetWord(); position.x = atof(keyWord); }
-            else if(!strcmpi(keyWord, "y"))     { GetWord(); position.y = atof(keyWord); }
-            else if(!strcmpi(keyWord, "z"))     { GetWord(); position.z = atof(keyWord); }
-            else if(!strcmpi(keyWord, "speed")) { GetWord(); object.speed = atof(keyWord); }
-            else if(!strcmpi(keyWord, "dir"))   { GetWord(); object.direction = atof(keyWord); }
+            if(!strcmpi(keyWord, "x"))          { GetWord(); position.x = (float)atof(keyWord); }
+            else if(!strcmpi(keyWord, "y"))     { GetWord(); position.y = (float)atof(keyWord); }
+            else if(!strcmpi(keyWord, "z"))     { GetWord(); position.z = (float)atof(keyWord); }
+            else if(!strcmpi(keyWord, "speed")) { GetWord(); object.speed = (float)atof(keyWord); }
+            else if(!strcmpi(keyWord, "dir"))   { GetWord(); object.direction = (float)atof(keyWord); }
          }
          object.position = position;
       }