compiler/libec; eda, extras: const fixes for DB apps
authorJerome St-Louis <jerome@ecere.com>
Fri, 30 May 2014 03:21:04 +0000 (23:21 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 30 May 2014 03:23:01 +0000 (23:23 -0400)
40 files changed:
compiler/bootstrap/ecere/bootstrap/LinkList.c
compiler/bootstrap/libec/bootstrap/ast.c
compiler/bootstrap/libec/bootstrap/ec.main.c
compiler/bootstrap/libec/bootstrap/ecdefs.c
compiler/bootstrap/libec/bootstrap/pass0.c
compiler/bootstrap/libec/bootstrap/pass1.c
compiler/bootstrap/libec/bootstrap/pass15.c
compiler/bootstrap/libec/bootstrap/pass2.c
compiler/libec/src/ast.ec
compiler/libec/src/ecdefs.ec
compiler/libec/src/pass0.ec
compiler/libec/src/pass1.ec
compiler/libec/src/pass15.ec
compiler/libec/src/pass2.ec
eda/drivers/sqlite/EDASQLite.ec
eda/libeda/src/EDA.ec
eda/libeda/src/EDB.ec
eda/libeda/src/ers.ec
eda/libeda/src/gui.ec
eda/libeda/src/gui/TableEditor.ec
eda/libeda/src/gui/controls/FieldBox.ec
eda/libeda/src/idList.ec
extras/CSVDataParser.ec
extras/CSVParser.ec
extras/Regex.ec
extras/base64.ec
extras/gui/RoundedSquare.ec
extras/gui/controls/CheckListBox.ec
extras/gui/controls/PasswordBox.ec
extras/gui/skins/SimSkin.ec
extras/stringTools.ec
extras/timeTools.ec
extras/types/CountryCode.ec
extras/types/Currency.ec
extras/types/ShortDate.ec
extras/wia.ec
ide/src/designer/CodeEditor.ec
samples/db/EDATest/EDATest.ec
samples/db/MovieCollection/borrowerReport.ec
samples/db/MovieCollection/reports.ec

index 8ec0aa9..574bed6 100644 (file)
@@ -350,7 +350,7 @@ struct __ecereNameSpace__ecere__com__LinkList * __ecerePointer___ecereNameSpace_
 return (void *)pointer;
 }
 
-struct __ecereNameSpace__ecere__com__IteratorPointer * __ecereMethod___ecereNameSpace__ecere__com__LinkList_GetAtPosition(struct __ecereNameSpace__ecere__com__Instance * this, uint64 pos, unsigned int create)
+struct __ecereNameSpace__ecere__com__IteratorPointer * __ecereMethod___ecereNameSpace__ecere__com__LinkList_GetAtPosition(struct __ecereNameSpace__ecere__com__Instance * this, const uint64 pos, unsigned int create)
 {
 struct __ecereNameSpace__ecere__com__LinkList * __ecerePointer___ecereNameSpace__ecere__com__LinkList = (struct __ecereNameSpace__ecere__com__LinkList *)(this ? (((char *)this) + structSize_Instance) : 0);
 int c;
index 9802030..b12ad3d 100644 (file)
@@ -2951,7 +2951,7 @@ return external;
 
 extern char *  strncpy(char * , const char * , size_t n);
 
-extern void ImportModule(char *  name, int importType, int importAccess, unsigned int loadDllOnly);
+extern void ImportModule(const char *  name, int importType, int importAccess, unsigned int loadDllOnly);
 
 struct External * MkExternalImport(char * name, int importType, int importAccess)
 {
@@ -3710,7 +3710,7 @@ struct ClassDef * MkClassDefProperty(struct PropertyDef * propertyDef)
 return __extension__ ({
 struct ClassDef * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassDef);
 
-__ecereInstance1->type = 3, __ecereInstance1->propertyDef = propertyDef, __ecereInstance1;
+__ecereInstance1->type = 3, __ecereInstance1->propertyDef = propertyDef, __ecereInstance1->loc = yylloc, __ecereInstance1;
 });
 }
 
@@ -3719,7 +3719,7 @@ struct ClassDef * MkClassDefClassProperty(struct PropertyDef * propertyDef)
 return __extension__ ({
 struct ClassDef * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassDef);
 
-__ecereInstance1->type = 10, __ecereInstance1->propertyDef = propertyDef, __ecereInstance1;
+__ecereInstance1->type = 10, __ecereInstance1->propertyDef = propertyDef, __ecereInstance1->loc = yylloc, __ecereInstance1;
 });
 }
 
@@ -3728,7 +3728,7 @@ struct ClassDef * MkClassDefClassPropertyValue(struct Identifier * id, struct In
 return __extension__ ({
 struct ClassDef * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassDef);
 
-__ecereInstance1->type = 11, __ecereInstance1->id = id, __ecereInstance1->initializer = initializer, __ecereInstance1;
+__ecereInstance1->type = 11, __ecereInstance1->id = id, __ecereInstance1->initializer = initializer, __ecereInstance1->loc = yylloc, __ecereInstance1;
 });
 }
 
index 03aa2f3..ee593d8 100644 (file)
@@ -487,6 +487,8 @@ struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
 
 struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
 
+struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
+
 struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
 
 struct __ecereNameSpace__ecere__com__Class * __ecereClass_char__PTR_;
@@ -741,10 +743,10 @@ extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
 
-extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
-
 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
 
+extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
+
 extern void __ecereNameSpace__ecere__LoadTranslatedStrings(const char * moduleName, const char *  name);
 
 unsigned int __ecereDll_Load_ec(struct __ecereNameSpace__ecere__com__Instance * module)
@@ -827,6 +829,7 @@ __ecereClass_TemplateDatatype = __ecereNameSpace__ecere__com__eSystem_FindClass(
 __ecereClass_TemplateParameter = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "TemplateParameter");
 __ecereClass_TemplatedType = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "TemplatedType");
 __ecereClass_Type = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "Type");
+__ecereProp_Type_specConst = _property = __ecereNameSpace__ecere__com__eClass_FindProperty(__ecereClass_Type, "specConst", module);
 __ecereClass_TypeName = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "TypeName");
 __ecereClass_char__PTR_ = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "char *");
 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "class");
index 84d2d9f..46db9ab 100644 (file)
@@ -1684,6 +1684,8 @@ static struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeKind;
 
+static struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst, * __ecerePropM_Type_specConst;
+
 extern void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
 
 const char * __ecereMethod_Type_OnGetString(struct __ecereNameSpace__ecere__com__Class * class, struct Type * this, char * tempString, void * fieldData, unsigned int * needClass)
@@ -1700,6 +1702,15 @@ void __ecereMethod_Type_OnFree(struct __ecereNameSpace__ecere__com__Class * clas
 {
 }
 
+unsigned int __ecereProp_Type_Get_specConst(struct Type * this)
+{
+struct Type * t = this;
+
+while((t->kind == 13 || t->kind == 12) && t->type)
+t = t->type;
+return t->constant;
+}
+
 struct OpTable
 {
 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
@@ -2010,6 +2021,8 @@ extern unsigned int __ecereNameSpace__ecere__com__eClass_AddMember(struct __ecer
 
 extern unsigned int __ecereNameSpace__ecere__com__eMember_AddMember(struct __ecereNameSpace__ecere__com__DataMember * addTo, struct __ecereNameSpace__ecere__com__DataMember * dataMember);
 
+extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  dataType, void *  setStmt, void *  getStmt, int declMode);
+
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
 
 struct __ecereNameSpace__ecere__com__DefinedExpression;
@@ -3107,6 +3120,9 @@ __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "attrStdcall", "bool:1
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "declaredWithStruct", "bool:1", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "typedByReference", "bool:1", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "casted", "bool:1", 4, 4, 1);
+__ecerePropM_Type_specConst = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "specConst", "bool", 0, __ecereProp_Type_Get_specConst, 1);
+if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application)
+__ecereProp_Type_specConst = __ecerePropM_Type_specConst, __ecerePropM_Type_specConst = (void *)0;
 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(1, "Operand", 0, sizeof(struct Operand), 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_Operand = class;
@@ -3181,5 +3197,6 @@ __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetTargetBits", "int Get
 void __ecereUnregisterModule_ecdefs(struct __ecereNameSpace__ecere__com__Instance * module)
 {
 
+__ecerePropM_Type_specConst = (void *)0;
 }
 
index 8a02dae..5c2b8cc 100644 (file)
@@ -2280,6 +2280,17 @@ FullClassNameCat(name, propertyDef->id->string, 0x1);
 MangleClassName(name);
 params = MkList();
 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
+if(propertyDef->isDBProp)
+{
+struct Specifier * spec;
+struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
+
+for(spec = (*specs).first; spec; spec = spec->next)
+if(spec->type == 0 && spec->specifier == CONST)
+break;
+if(!spec)
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
+}
 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
 {
 unsigned int isConversion = propertyDef->symbol->_property && propertyDef->symbol->_property->conversion;
index 19cfa7f..eae2d61 100644 (file)
@@ -3100,6 +3100,16 @@ struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
 struct Statement * compoundStmt;
 char * s;
 
+if(__extension__ ({
+char * __ecTemp1 = (((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&v)));
+
+((struct ClassPropertyValue *)(__ecTemp1 + __ecereClass_ClassPropertyValue->offset));
+})->exp)
+yylloc = __extension__ ({
+char * __ecTemp1 = (((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&v)));
+
+((struct ClassPropertyValue *)(__ecTemp1 + __ecereClass_ClassPropertyValue->offset));
+})->exp->loc;
 ListAdd(findClassArgs, MkExpIdentifier(MkIdentifier("module")));
 s = QMkString(__extension__ ({
 char * __ecTemp1 = (((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&v)));
index 63225ce..6bd547b 100644 (file)
@@ -3272,23 +3272,17 @@ void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameS
 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
 {
 struct Symbol * symbol = prop->symbol;
-char propName[1024];
 
 strcpy(setName, "__ecereProp_");
 FullClassNameCat(setName, prop->_class->fullName, 0x0);
 strcat(setName, "_Set_");
 FullClassNameCat(setName, prop->name, 0x1);
+MangleClassName(setName);
 strcpy(getName, "__ecereProp_");
 FullClassNameCat(getName, prop->_class->fullName, 0x0);
 strcat(getName, "_Get_");
 FullClassNameCat(getName, prop->name, 0x1);
-strcpy(propName, "__ecereProp_");
-FullClassNameCat(propName, prop->_class->fullName, 0x0);
-strcat(propName, "_");
-FullClassNameCat(propName, prop->name, 0x1);
 MangleClassName(getName);
-MangleClassName(setName);
-MangleClassName(propName);
 if(prop->_class->type == 1)
 DeclareStruct(prop->_class->fullName, 0x0);
 if(!symbol || curExternal->symbol->idCode < symbol->id)
@@ -3437,6 +3431,8 @@ struct Context * context = SetupTemplatesContext(prop->_class);
 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
 FinishTemplatesContext(context);
 }
+if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
 ListAdd(params, MkTypeName(specifiers, d));
 d = MkDeclaratorIdentifier(MkIdentifier(setName));
 if(dllImport)
@@ -3483,12 +3479,18 @@ if(!symbol->externalPtr)
 struct Declaration * decl;
 struct External * external;
 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
+char propName[1024];
 
 if(imported)
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
 else
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
 ListAdd(specifiers, MkSpecifierName("Property"));
+strcpy(propName, "__ecereProp_");
+FullClassNameCat(propName, prop->_class->fullName, 0x0);
+strcat(propName, "_");
+FullClassNameCat(propName, prop->name, 0x1);
+MangleClassName(propName);
 {
 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
 
@@ -4802,15 +4804,11 @@ static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
 
 extern void Compiler_Warning(const char *  format, ...);
 
-extern void CopyTypeInto(struct Type * type, struct Type * src);
-
-void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
-
-unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration, unsigned int warnConst)
-{
-if(source && dest)
+static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
 {
-if(warnConst && ((source->kind == 8 && source->_class && source->_class->registered) || source->kind == 12 || source->kind == 13) && ((dest->kind == 8 && dest->_class && dest->_class->registered) || dest->kind == 13))
+unsigned int status = 0x1;
+
+if(((source->kind == 8 && source->_class && source->_class->registered) || source->kind == 12 || source->kind == 13) && ((dest->kind == 8 && dest->_class && dest->_class->registered) || dest->kind == 13))
 {
 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->_class->registered : (((void *)0));
 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->_class->registered : (((void *)0));
@@ -4819,14 +4817,31 @@ if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->stru
 {
 struct Type * sourceType = source, * destType = dest;
 
-while(sourceType->type && (sourceType->kind == 13 || sourceType->kind == 12))
+while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->type)
 sourceType = sourceType->type;
-while(destType->type && (destType->kind == 13 || destType->kind == 12))
+while((destType->kind == 13 || destType->kind == 12) && destType->type)
 destType = destType->type;
 if(!destType->constant && sourceType->constant)
+{
+status = 0x0;
+if(warn)
 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
 }
 }
+}
+return status;
+}
+
+extern void CopyTypeInto(struct Type * type, struct Type * src);
+
+void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
+
+unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration, unsigned int warnConst)
+{
+if(source && dest)
+{
+if(warnConst)
+CheckConstCompatibility(source, dest, 0x1);
 if(source->kind == 20 && dest->kind != 20)
 {
 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
@@ -4841,7 +4856,7 @@ struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
 if(type)
 dest = type;
 }
-if(dest->classObjectType == 2)
+if(dest->classObjectType == 2 && dest->kind != 11)
 {
 if(source->classObjectType != 3)
 return 0x1;
@@ -4855,9 +4870,9 @@ return 0x1;
 }
 else
 {
-if(source->classObjectType == 3)
+if(source->kind != 11 && source->classObjectType == 3)
 return 0x1;
-if(dest->classObjectType == 3 && source->classObjectType != 2)
+if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
 return 0x1;
 }
 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
@@ -5167,6 +5182,8 @@ if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)
 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
 return 0x0;
 }
+else
+CheckConstCompatibility(dest->returnType, source->returnType, 0x1);
 for(; paramDest; paramDest = paramDest->next)
 {
 if(!paramSource)
@@ -16139,7 +16156,16 @@ exp->member.memberType = 1;
 if(!prop->dataType)
 ProcessPropertyType(prop);
 exp->expType = prop->dataType;
-if(prop->dataType)
+if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
+{
+struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
+
+CopyTypeInto(type, exp->expType);
+type->refCount = 1;
+type->constant = 0x1;
+exp->expType = type;
+}
+else if(prop->dataType)
 prop->dataType->refCount++;
 }
 else if(member)
index 1c09430..4e08e0b 100644 (file)
@@ -1515,6 +1515,10 @@ void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecer
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
 
+unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
+
+extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_Type_specConst;
+
 static void ProcessExpression(struct Expression * exp)
 {
 struct Location oldyylloc = yylloc;
@@ -2710,8 +2714,11 @@ else
 {
 struct Expression * c;
 struct Context * context = PushContext();
+struct __ecereNameSpace__ecere__sys__OldList * specs;
 
-c = MkExpExtensionCompound(MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("Instance")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")), MkInitializerAssignment(CopyExpression(memberExp->member.exp)))))), MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_vTbl"))), MkExpPointer(MkExpIdentifier(MkIdentifier(className)), MkIdentifier("_vTbl"))))))));
+c = MkExpExtensionCompound(MkCompoundStmt(MkListOne(MkDeclaration((specs = MkListOne(MkSpecifierName("Instance"))), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")), MkInitializerAssignment(CopyExpression(memberExp->member.exp)))))), MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_vTbl"))), MkExpPointer(MkExpIdentifier(MkIdentifier(className)), MkIdentifier("_vTbl"))))))));
+if(__ecereProp_Type_Get_specConst(type))
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
 c->loc = exp->loc;
 c->compound->compound.context = context;
 PopContext(context);
@@ -2856,10 +2863,13 @@ if(memberExp && cl && cl->type == 0 && (!type || type->byReference == 0x0) && st
 {
 struct Expression * c;
 struct Context * context = PushContext();
+struct __ecereNameSpace__ecere__sys__OldList * specs;
 
-c = MkExpExtensionCompound(MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("Instance")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")), MkInitializerAssignment(memberExpMemberExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_class"))), MkExpIdentifier(MkIdentifier(className))))))));
+c = MkExpExtensionCompound(MkCompoundStmt(MkListOne(MkDeclaration((specs = MkListOne(MkSpecifierName("Instance"))), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")), MkInitializerAssignment(memberExpMemberExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_class"))), MkExpIdentifier(MkIdentifier(className))))))));
 c->compound->compound.context = context;
 PopContext(context);
+if(__ecereProp_Type_Get_specConst(type))
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*exp->call.arguments), (((void *)0)), c);
 memberExpMemberExp = (((void *)0));
 }
@@ -3117,9 +3127,13 @@ __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*exp->call.argument
 }
 else
 {
-c = MkExpExtensionCompound(MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("Instance")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")), MkInitializerAssignment(CopyExpression(e)))))), MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_class"))), MkExpIdentifier(MkIdentifier(className))))))));
+struct __ecereNameSpace__ecere__sys__OldList * specs;
+
+c = MkExpExtensionCompound(MkCompoundStmt(MkListOne(MkDeclaration((specs = MkListOne(MkSpecifierName("Instance"))), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")), MkInitializerAssignment(CopyExpression(e)))))), MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_class"))), MkExpIdentifier(MkIdentifier(className))))))));
 c->compound->compound.context = context;
 PopContext(context);
+if(__ecereProp_Type_Get_specConst(type))
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*exp->call.arguments), e->prev, c);
 }
 }
index f03880b..5001277 100644 (file)
@@ -1952,17 +1952,17 @@ PropertyDef MkProperty(OldList specs, Declarator decl, Identifier id, Statement
 
 ClassDef MkClassDefProperty(PropertyDef propertyDef)
 {
-   return { type = propertyClassDef, propertyDef = propertyDef };
+   return { type = propertyClassDef, propertyDef = propertyDef, loc = yylloc };
 }
 
 ClassDef MkClassDefClassProperty(PropertyDef propertyDef)
 {
-   return { type = classPropertyClassDef, propertyDef = propertyDef };
+   return { type = classPropertyClassDef, propertyDef = propertyDef, loc = yylloc };
 }
 
 ClassDef MkClassDefClassPropertyValue(Identifier id, Initializer initializer)
 {
-   return { type = classPropertyValueClassDef, id = id, initializer = initializer };
+   return { type = classPropertyValueClassDef, id = id, initializer = initializer, loc = yylloc };
 }
 
 int CheckType(const char * text)
index 909efc8..0c25f7d 100644 (file)
@@ -1327,6 +1327,16 @@ public:
    {
 
    }
+
+   property bool specConst
+   {
+      get
+      {
+         Type t = this;
+         while((t.kind == pointerType || t.kind == arrayType) && t.type) t = t.type;
+         return t.constant;
+      }
+   }
 };
 
 public struct Operand
index 8404305..8f6a987 100644 (file)
@@ -1204,6 +1204,19 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                         PlugDeclarator(propertyDef.declarator,
                            MkDeclaratorIdentifier(MkIdentifier("value")))));
 
+                     // Add const to DB table rows properties Set
+                     if(propertyDef.isDBProp)
+                     {
+                        Specifier spec;
+                        OldList * specs = ((TypeName)params->last).qualifiers;
+
+                        for(spec = specs->first; spec; spec = spec.next)
+                           if(spec.type == baseSpecifier && spec.specifier == CONST)
+                              break;
+                        if(!spec)
+                           specs->Insert(null, MkSpecifier(CONST));
+                     }
+
                      // Take it out here...
                      //propertyDef.specifiers = null;
 
index 6578629..ec81363 100644 (file)
@@ -1959,6 +1959,9 @@ public void ProcessClassDefinitions()
          Statement compoundStmt;
          String s;
 
+         if(v.exp)
+            yylloc = v.exp.loc;
+
          ListAdd(findClassArgs, MkExpIdentifier(MkIdentifier("module")));
          s = QMkString(v.regClass.name);
          ListAdd(findClassArgs, MkExpString(s));
index 95ced2a..44524b5 100644 (file)
@@ -1245,13 +1245,13 @@ void DeclareStruct(const char * name, bool skipNoHead)
 void DeclareProperty(Property prop, char * setName, char * getName)
 {
    Symbol symbol = prop.symbol;
-   char propName[1024];
 
    strcpy(setName, "__ecereProp_");
    FullClassNameCat(setName, prop._class.fullName, false);
    strcat(setName, "_Set_");
    // strcat(setName, prop.name);
    FullClassNameCat(setName, prop.name, true);
+   MangleClassName(setName);
 
    strcpy(getName, "__ecereProp_");
    FullClassNameCat(getName, prop._class.fullName, false);
@@ -1259,16 +1259,8 @@ void DeclareProperty(Property prop, char * setName, char * getName)
    FullClassNameCat(getName, prop.name, true);
    // strcat(getName, prop.name);
 
-   strcpy(propName, "__ecereProp_");
-   FullClassNameCat(propName, prop._class.fullName, false);
-   strcat(propName, "_");
-   FullClassNameCat(propName, prop.name, true);
-   // strcat(propName, prop.name);
-
    // To support "char *" property
    MangleClassName(getName);
-   MangleClassName(setName);
-   MangleClassName(propName);
 
    if(prop._class.type == structClass)
       DeclareStruct(prop._class.fullName, false);
@@ -1277,6 +1269,7 @@ void DeclareProperty(Property prop, char * setName, char * getName)
    {
       bool imported = false;
       bool dllImport = false;
+
       if(!symbol || symbol._import)
       {
          if(!symbol)
@@ -1447,6 +1440,9 @@ void DeclareProperty(Property prop, char * setName, char * getName)
                   MkDeclaratorIdentifier(MkIdentifier("value")));
                FinishTemplatesContext(context);
             }
+            if(!strcmp(prop._class.base.fullName, "eda::Row") || !strcmp(prop._class.base.fullName, "eda::Id"))
+               specifiers->Insert(null, MkSpecifier(CONST));
+
             ListAdd(params, MkTypeName(specifiers, d));
 
             d = MkDeclaratorIdentifier(MkIdentifier(setName));
@@ -1507,6 +1503,7 @@ void DeclareProperty(Property prop, char * setName, char * getName)
          Declaration decl;
          External external;
          OldList * specifiers = MkList();
+         char propName[1024];
 
          if(imported)
             specifiers->Insert(null, MkSpecifier(EXTERN));
@@ -1515,6 +1512,13 @@ void DeclareProperty(Property prop, char * setName, char * getName)
 
          ListAdd(specifiers, MkSpecifierName("Property"));
 
+         strcpy(propName, "__ecereProp_");
+         FullClassNameCat(propName, prop._class.fullName, false);
+         strcat(propName, "_");
+         FullClassNameCat(propName, prop.name, true);
+         // strcat(propName, prop.name);
+         MangleClassName(propName);
+
          {
             OldList * list = MkList();
             ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer(null, null),
@@ -2922,27 +2926,38 @@ class Conversion : struct
    Type resultType;
 };
 
-public bool MatchTypes(Type source, Type dest, OldList conversions, Class owningClassSource, Class owningClassDest, bool doConversion, bool enumBaseType, bool acceptReversedParams,
-                       bool isConversionExploration, bool warnConst)
+static bool CheckConstCompatibility(Type source, Type dest, bool warn)
 {
-   if(source && dest)
+   bool status = true;
+   if(((source.kind == classType && source._class && source._class.registered) || source.kind == arrayType || source.kind == pointerType) &&
+      ((dest.kind == classType && dest._class && dest._class.registered) || /*dest.kind == arrayType || */dest.kind == pointerType))
    {
-      if(warnConst &&
-         ((source.kind == classType && source._class && source._class.registered) || source.kind == arrayType || source.kind == pointerType) &&
-         ((dest.kind == classType && dest._class && dest._class.registered) || /*dest.kind == arrayType || */dest.kind == pointerType))
-      {
-         Class sourceClass = source.kind == classType ? source._class.registered : null;
-         Class destClass = dest.kind == classType ? dest._class.registered : null;
-         if((!sourceClass || (sourceClass && sourceClass.type == normalClass && !sourceClass.structSize)) &&
-            (!destClass || (destClass && destClass.type == normalClass && !destClass.structSize)))
-         {
-            Type sourceType = source, destType = dest;
-            while(sourceType.type && (sourceType.kind == pointerType || sourceType.kind == arrayType)) sourceType = sourceType.type;
-            while(destType.type && (destType.kind == pointerType || destType.kind == arrayType)) destType = destType.type;
-            if(!destType.constant && sourceType.constant)
+      Class sourceClass = source.kind == classType ? source._class.registered : null;
+      Class destClass = dest.kind == classType ? dest._class.registered : null;
+      if((!sourceClass || (sourceClass && sourceClass.type == normalClass && !sourceClass.structSize)) &&
+         (!destClass || (destClass && destClass.type == normalClass && !destClass.structSize)))
+      {
+         Type sourceType = source, destType = dest;
+         while((sourceType.kind == pointerType || sourceType.kind == arrayType) && sourceType.type) sourceType = sourceType.type;
+         while((destType.kind == pointerType || destType.kind == arrayType) && destType.type) destType = destType.type;
+         if(!destType.constant && sourceType.constant)
+         {
+            status = false;
+            if(warn)
                Compiler_Warning($"discarding const qualifier\n");
          }
       }
+   }
+   return status;
+}
+
+public bool MatchTypes(Type source, Type dest, OldList conversions, Class owningClassSource, Class owningClassDest, bool doConversion, bool enumBaseType, bool acceptReversedParams,
+                       bool isConversionExploration, bool warnConst)
+{
+   if(source && dest)
+   {
+      if(warnConst)
+         CheckConstCompatibility(source, dest, true);
       // Property convert;
 
       if(source.kind == templateType && dest.kind != templateType)
@@ -2957,7 +2972,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
          if(type) dest = type;
       }
 
-      if(dest.classObjectType == typedObject)
+      if(dest.classObjectType == typedObject && dest.kind != functionType)
       {
          if(source.classObjectType != anyObject)
             return true;
@@ -2972,9 +2987,9 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
       }
       else
       {
-         if(source.classObjectType == anyObject)
+         if(source.kind != functionType && source.classObjectType == anyObject)
             return true;
-         if(dest.classObjectType == anyObject && source.classObjectType != typedObject)
+         if(dest.kind != functionType && dest.classObjectType == anyObject && source.classObjectType != typedObject)
             return true;
       }
 
@@ -3358,6 +3373,9 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
             Compiler_Warning($"incompatible return type for function\n");
             return false;
          }
+         // The const check is backwards from the MatchTypes above (for derivative classes checks)
+         else
+            CheckConstCompatibility(dest.returnType, source.returnType, true);
 
          // Check parameters
 
@@ -10121,7 +10139,16 @@ void ProcessExpressionType(Expression exp)
                   if(!prop.dataType)
                      ProcessPropertyType(prop);
                   exp.expType = prop.dataType;
-                  if(prop.dataType) prop.dataType.refCount++;
+                  if(!strcmp(_class.base.fullName, "eda::Row") && !exp.expType.constant && !exp.destType)
+                  {
+                     Type type { };
+                     CopyTypeInto(type, exp.expType);
+                     type.refCount = 1;
+                     type.constant = true;
+                     exp.expType = type;
+                  }
+                  else if(prop.dataType)
+                     prop.dataType.refCount++;
                }
                else if(member)
                {
index 9372c7b..37bbe83 100644 (file)
@@ -1782,15 +1782,18 @@ static void ProcessExpression(Expression exp)
                      // ({ Instance __internal_ClassInst = e; __internal_ClassInst ? __internal_ClassInst._vTbl : __ecereClass_...; })
                      Expression c;
                      Context context = PushContext();
+                     OldList * specs;
                      c = MkExpExtensionCompound(MkCompoundStmt(
                            MkListOne(MkDeclaration(
-                              MkListOne(MkSpecifierName("Instance")),
+                              (specs = MkListOne(MkSpecifierName("Instance"))),
                               MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")),
                                  MkInitializerAssignment(CopyExpression(memberExp.member.exp)))))),
                            MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(
                               MkExpIdentifier(MkIdentifier("__internal_ClassInst")),
                               MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_vTbl"))),
                               MkExpPointer(MkExpIdentifier(MkIdentifier(className)), MkIdentifier("_vTbl"))))))));
+                     if(type.specConst)
+                        specs->Insert(null, MkSpecifier(CONST));
                      c.loc = exp.loc;
                      c.compound.compound.context = context;
                      PopContext(context);
@@ -1986,9 +1989,11 @@ static void ProcessExpression(Expression exp)
                               // ({ Instance __internal_ClassInst = e; __internal_ClassInst ? __internal_ClassInst._class : __ecereClass_...; })
                               Expression c;
                               Context context = PushContext();
+                              OldList * specs;
+
                               c = MkExpExtensionCompound(MkCompoundStmt(
                                     MkListOne(MkDeclaration(
-                                       MkListOne(MkSpecifierName("Instance")),
+                                       (specs = MkListOne(MkSpecifierName("Instance"))),
                                        MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")),
                                           MkInitializerAssignment(memberExpMemberExp))))),
                                     MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(
@@ -1998,6 +2003,9 @@ static void ProcessExpression(Expression exp)
                               c.compound.compound.context = context;
                               PopContext(context);
 
+                              if(type.specConst)
+                                 specs->Insert(null, MkSpecifier(CONST));
+
                               exp.call.arguments->Insert(null, c);
 
                               memberExpMemberExp = null; // We used this
@@ -2319,9 +2327,10 @@ static void ProcessExpression(Expression exp)
                            }
                            else
                            {
+                              OldList * specs;
                               c = MkExpExtensionCompound(MkCompoundStmt(
                                     MkListOne(MkDeclaration(
-                                       MkListOne(MkSpecifierName("Instance")),
+                                       (specs = MkListOne(MkSpecifierName("Instance"))),
                                        MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")),
                                           MkInitializerAssignment(CopyExpression(e)))))),
                                     MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(
@@ -2331,6 +2340,9 @@ static void ProcessExpression(Expression exp)
                               c.compound.compound.context = context;
                               PopContext(context);
 
+                              if(type.specConst)
+                                 specs->Insert(null, MkSpecifier(CONST));
+
                               exp.call.arguments->Insert(e.prev, c);
                            }
                         }
index eabde0f..aee87d5 100644 (file)
@@ -154,7 +154,7 @@ class SQLiteField : Field
       delete name;
    }
 
-   String GetName()
+   const String GetName()
    {
       return name;
    }
@@ -983,7 +983,7 @@ class SQLiteTable : Table
       return result == SQLITE_OK;
    }
 
-   String GetName()
+   const String GetName()
    {
       return name;
    }
index 2586ad4..5cf05d7 100644 (file)
@@ -36,7 +36,7 @@ public:
 
 public class DataSourceDriver
 {
-   OldList listDB { offset = (uint)&((Database)0).prev };
+   OldList listDB { offset = (uint)(uintptr)&((Database)0).prev };
    class_data const char * name;
 
    class_property const char * name
@@ -81,7 +81,7 @@ static subclass(DataSourceDriver) GetDataDriver(const char * driverName)
       Module module;
       char moduleName[MAX_LOCATION];
       sprintf(moduleName, "EDA%s", driverName);
-      if(module = eModule_Load(__thisModule.application, moduleName, publicAccess))
+      if((module = eModule_Load(__thisModule.application, moduleName, publicAccess)))
          driver = FindDataDriverDerivative(eSystem_FindClass(module /*__thisModule.application*/, "DataSourceDriver"), driverName);
    }
    return driver;
@@ -209,7 +209,7 @@ public class Database
 {
    Database prev, next;
    DataSourceDriver ds;
-   OldList listTbl { offset = (uint)&((Table)0).prev };
+   OldList listTbl { offset = (uint)(uintptr)&((Table)0).prev };
    public virtual String GetName();
    public virtual Array<String> GetTables(); // TODO: make this Container<Table> GetTables(); // if supported, filled with ready to open Tables
 
index 354f744..34f0551 100644 (file)
@@ -14,7 +14,7 @@ public void SetEDBIndexOptions(EDBIndexOptions options)
 
 EDBIndexOptions indexOptions { saveIndex = true, deleteIndex = false; };
 
-static void UnusedFunction()
+__attribute__((unused)) static void UnusedFunction()
 {
    int a;
    a.OnGetString(0,0,0);
@@ -45,7 +45,6 @@ void RowsCountFileEdit(Archive archive, const String apath, const RowsCountFileA
    int temp;
    if(!*rowsCountPosition)
    {
-      int c;
       File f = ((EDBArchive)archive).f;
       EDBArchiveDir dir = (EDBArchiveDir) archive.OpenDirectory(apath, FileStats { }, readOnlyDir);
       uint position;
@@ -189,7 +188,7 @@ static class DBTable : struct
    String apath;
    String apathFields;
    OldList indexes;
-   OldList fields { offset = (uint)&((EDBField)0).prev; };
+   OldList fields { offset = (uint)(uintptr)&((EDBField)0).prev; };
    ArchiveDir dir;
 
    uint rowsCountPosition;
@@ -328,7 +327,6 @@ class EDBDatabase : Database
          dbTbl.rowsCount = dbTbl.allocatedRowsCount - dbTbl.deletedRowsCount;
 
          {
-            int c;
             File f = ((EDBArchive)archive).f;
             EDBArchiveDir dir = (EDBArchiveDir) dbTbl.dir;
             uint position;
@@ -779,7 +777,7 @@ static class EDBTable : Table
       return true;
    }
 
-   String GetName()
+   const String GetName()
    {
       return dbTable.apath;
    }
@@ -828,7 +826,7 @@ public:
    String apath;
    String aname;
 
-   String GetName() { return name; }
+   const String GetName() { return name; }
    Class GetType() { return type; }
    int GetLength() { return length; }
    Field GetNext() { return next; }
@@ -1104,7 +1102,6 @@ static class EDBRow : DriverRow
 
    bool Select(MoveOptions move)
    {
-      EDBDatabase edb = tbl.db;
       if(tbl.rowsCount)
       {
          if(index)
@@ -1220,7 +1217,6 @@ static class EDBRow : DriverRow
 
    bool Find(EDBField field, MoveOptions move, MatchOptions match, typed_object data)
    {
-      EDBDatabase edb = tbl.db;
       if(tbl == field.tbl)
       {
          if(tbl.rowsCount)
@@ -1428,7 +1424,6 @@ static class EDBRow : DriverRow
 
    bool FindMultiple(FieldFindData * findData, MoveOptions move, int numFields)
    {
-      EDBDatabase edb = tbl.db;
       int c;
       for(c = 0; c<numFields; c++)
          if(tbl != ((EDBField)findData[c].field).tbl)
index f491b12..90db95a 100644 (file)
@@ -606,14 +606,12 @@ public class CSVReport : ReportDestination
 
    void AddPage(Page page)
    {
-      int h;
       if(pageCount && display)
          display.NextPage();
       lastPage = page;
       page.master = this;
       page.parent = this;
       page.size = { MAXINT - 10, MAXINT - 10 };
-      h = page.size.h;
       pageCount++;
       page.Create();
    }
@@ -862,7 +860,7 @@ public:
 
    Array<Grouping> groupings { };
 
-   property String title
+   property const String title
    {
       set
       {
index a273ee7..6c65081 100644 (file)
@@ -12,8 +12,8 @@ const char * defaultNameField = "Name";
 const char * defaultIdField = "Id";
 const char * defaultActiveField = "Active";
 
-public void SetDefaultIdField(char * value) { defaultIdField = value; }
-public void SetDefaultNameField(char * value) { defaultNameField = value; }
+public void SetDefaultIdField(const char * value) { defaultIdField = value; }
+public void SetDefaultNameField(const char * value) { defaultNameField = value; }
 
 public class ButtonStyle : Button
 {
@@ -468,7 +468,6 @@ public:
 
    virtual void Save()
    {
-      bool result;
       if(field && row)
       {
          Class type = field.type;
@@ -853,7 +852,6 @@ public:
          bool result = true;
          if(/*row && */row != lastRow)
          {
-            uint id;
             if(editor.modifiedDocument)
             {
                if(row)
@@ -910,10 +908,10 @@ public:
    {
       if(editor)
       {
-         editor.btnSave.disabled = !(bool)list.currentRow;
-         editor.btnReload.disabled = !(bool)list.currentRow;
-         btnDelete.disabled = !(bool)list.currentRow;
-         editor.disabled = !(bool)list.firstRow;
+         editor.btnSave.disabled = !list.currentRow;
+         editor.btnReload.disabled = !list.currentRow;
+         btnDelete.disabled = !list.currentRow;
+         editor.disabled = !list.firstRow;
       }
    }
 
index ab3b8be..459a007 100644 (file)
@@ -275,7 +275,7 @@ public:
       }
    }
 
-   property String searchString
+   property const String searchString
    {
       set
       {
@@ -547,7 +547,6 @@ public:
 
          EditClear();
          {
-            bool active = true;
             r.Add();
             {
                // Patch for SQLite driver which auto-increments IDs
@@ -691,7 +690,6 @@ public:
       DebugLn("TableEditor::ListSelect");
       if(/*-row && -*/row != lastRow)
       {
-         uint id;
          if(modifiedDocument)
          {
             if(row)
@@ -910,7 +908,7 @@ private:
          Time lastTime = GetTime();
          static int slice = 128;
 
-         static int wordListPrepRowCount = 0, wordListPrepRowNum = 0, ticks = 0;
+         static int ticks = 0;
          ticks++;
          if(ticks % 10 == 0)
             PrintLn("listing... ");
@@ -973,8 +971,6 @@ private:
                   st = sqliteSearchTables[listEnumerationTimer.tablesIndex];
                   if(st.table && st.idField && st.searchFields && st.searchFields.count)
                   {
-                     wordListPrepRowNum = 0;
-                     wordListPrepRowCount = st.table.rowsCount;
 
                      if(st.table && st.idField && st.searchFields && st.searchFields.count &&
                            st.searchFields[0].field)
@@ -1298,7 +1294,6 @@ private:
                      //PrintLn("todo: support other field types for string search");
                   else if(field && field.type)
                   {
-                     const char * n = field.name;
                      char tempString[MAX_F_STRING];
                      int64 data = 0;
                      Class type = field.type;
@@ -1324,7 +1319,7 @@ private:
                      if(!(type.type == systemClass || type.type == unitClass || type.type == bitClass || type.type == enumClass))
                         ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type, (void *)data);
                      if(type.type == structClass)
-                        delete data;
+                        delete (void *)data;
                   }
                }
             }
@@ -1388,7 +1383,6 @@ private:
       DebugLn("TableEditor::ResetListFields");
       if(list && listFields && listFields.count)
       {
-         bool c = list.created;
          list.ClearFields();
          for(lf : listFields)
          {
@@ -1603,7 +1597,6 @@ private:
             }
             else if(lf.CustomLookup && lf.field.type)
             {
-               const char * n = lf.field.name;
                int64 data = 0;
                String s = null;
                Class type = lf.field.type;
@@ -1621,12 +1614,11 @@ private:
                if(!(type.type == systemClass || type.type == unitClass || type.type == bitClass || type.type == enumClass))
                   ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type, (void *)data);
                if(type.type == structClass)
-                  delete data;
+                  delete (void *)data;
                delete s; // ?
             }
             else if(lf.field.type && eClass_IsDerived(lf.dataField.dataType, class(char*)))
             {
-               const char * n = lf.field.name;
                char tempString[MAX_F_STRING];
                int64 data = 0;
                Class type = lf.field.type;
@@ -1650,11 +1642,10 @@ private:
                if(!(type.type == systemClass || type.type == unitClass || type.type == bitClass || type.type == enumClass))
                   ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type, (void *)data);
                if(type.type == structClass)
-                  delete data;
+                  delete (void *)data;
             }
             else if(lf.field.type)
             {
-               const char * n = lf.field.name;
                //char tempString[256];
                int64 data = 0;
                Class type = lf.field.type;
@@ -1674,7 +1665,7 @@ private:
                if(!(type.type == systemClass || type.type == unitClass || type.type == bitClass || type.type == enumClass))
                   ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type, (void *)data);
                if(type.type == structClass)
-                  delete data;
+                  delete (void *)data;
             }
          }
       }
@@ -1693,7 +1684,6 @@ private:
    {
       int c;
       int numTokens = 0;
-      int len[256];
       char * words[256];
       WordEntry entries[256];
       Array<Id> results = null;
@@ -1703,7 +1693,6 @@ private:
          numTokens = TokenizeWith(searchCopy, sizeof(words) / sizeof(char *), words, " ',/-;[]{}", false);
          for(c = 0; c<numTokens; c++)
          {
-            len[c] = strlen(words[c]);
             strlwr(words[c]);
             entries[c] = (WordEntry)wordTree.FindString(words[c]);
          }
@@ -1775,7 +1764,7 @@ private:
       File f;
 
       sprintf(filePath, "%s.search", table.name);
-      f = filePath ? FileOpenBuffered(filePath, read) : null;
+      f = FileOpenBuffered(filePath, read);
       if(f)
       {
          int a;
@@ -1908,7 +1897,6 @@ private:
 
             for(l = count-s; l>0; l--)
             {
-               uint wid;
                WordEntry start = null, wordEntry;
 
                while(l > 0 && !UTF8_IS_FIRST(subWord[l])) l--;
@@ -2098,7 +2086,6 @@ struct WordEntryBinaryTree : BinaryTree
    {
       WordEntry node;
       uint id;
-      uint count = this.count;
       DebugLn("WordEntryBinaryTree::OnSerialize");
       for(id = 1, node = (WordEntry)root; node;)
       {
@@ -2243,7 +2230,6 @@ class WordEntry : struct
       channel.Unserialize(id);
       if(id)
       {
-         uint count;
          WordEntry entry;
          // TODO: Fix typed_object issues
          entry = btnodes[id - 1] = eInstance_New(class(WordEntry));
index 654788a..8e2ccf7 100644 (file)
@@ -155,7 +155,6 @@ public class FieldBox : DataBox
 
    virtual void Save()
    {
-      bool result;
       Row row = this.row;
       if(visible && row)
       {
index 8f0e112..f6be74c 100644 (file)
@@ -14,7 +14,7 @@ extern int __ecereVMethodID_class_OnUnserialize;
 extern int __ecereVMethodID_class_OnSerialize;
 extern int __ecereVMethodID_class_OnFree;
 
-static void UnusedFunction()
+__attribute__((unused)) static void UnusedFunction()
 {
    int a;
    a.OnGetString(0,0,0);
@@ -192,7 +192,7 @@ public class Id : uint
                   if(nameField)
                   {
    #ifdef _DEBUG
-                     const char * fn = nameField->name;
+                     //const char * fn = nameField->name;
    #endif
                      // Get name data from row
                      int64 data = 0;
@@ -704,7 +704,6 @@ public class FixedMultiLineString : String
    Window OnEdit(DataBox dataBox, DataBox obsolete, int x, int y, int w, int h, void * userData)
    {
       // Don't show the editbox right away so that the text is highlighted by default
-      const char * string = "";
       EditBox editBox
       {
          dataBox, visible = false,
@@ -971,7 +970,7 @@ public struct DataList : OldList
             // if(type.type != normalClass || strcmp(type.dataTypeString, "char *"))
             if(type)
             {
-               void * data = ((type.type == normalClass || type.type == noHeadClass || type.type == structClass) ? row.GetData(null) : *(uint *)row.GetData(null));
+               void * data = ((type.type == normalClass || type.type == noHeadClass || type.type == structClass) ? row.GetData(null) : (void *)(uintptr)*(uint *)row.GetData(null));
                if(!data)
                {
                   //if(strcmp(type.dataTypeString, char *"))
@@ -1071,9 +1070,9 @@ public struct DataList : OldList
             }
             else
             {
-               uint i = r.GetData(null);
+               void * i = r.GetData(null);
                if(i)
-                  Add(OldLink { data = (void *)i });
+                  Add(OldLink { data = i });
             }
          }
          return true;
@@ -1089,7 +1088,7 @@ public struct DataList : OldList
       if(!class_data(type))
          class_data(type) = eSystem_FindClass(__thisModule.application, class_data(typeName));
       type = class_data(type);
-      while(node = first)
+      while((node = first))
       {
          // TO STUDY: ONFREE SHOULD BE USED ONLY FOR LISTBOX?
          if(type)
index d4e3ef1..ea0939c 100644 (file)
@@ -4,7 +4,7 @@ public import "CSVParser"
 import "timeTools"
 
 public enum ColumnType { null = 1, string = 2, number = 4, floater = 8, date = 12 };
-public String columnTypeNames[ColumnType] = { "", "Null", "String", "", "Number", "", "", "", "Float", "", "", "", "Date" };
+public const String columnTypeNames[ColumnType] = { "", "Null", "String", "", "Number", "", "", "", "Float", "", "", "", "Date" };
 
 public class Column : struct
 {
index d10afa7..938820a 100644 (file)
@@ -49,7 +49,7 @@ public:
       OnMessage(buffer);
    }
 
-   virtual bool OnMessage(String message)
+   virtual void OnMessage(const String message)
    {
       ::PrintLn(this._class.name, ": ", message,
             " lineNum=", info.lineNum,
index f64449e..d9a3789 100644 (file)
@@ -126,7 +126,7 @@ public:
 
    property int matchCount { get { return matchCount; } }
 
-   char * Match(String string)
+   char * Match(const String string)
    {
       if(valid)
       {
@@ -145,7 +145,7 @@ public:
             }
             if(c == maxMatchCount)
                matchCount = maxMatchCount;
-            return string + matches[0].rm_so;
+            return (char *)string + matches[0].rm_so;
          }
          else
             matchCount = 0;
index 349cd3a..ec3920f 100644 (file)
@@ -19,7 +19,6 @@ int Base64Encode(byte * input, int len, byte * encoded)
    int encLen = 0;
    while(c < len)
    {
-      int b;
       if(len - c < 3)
       {
          remaining = len - c;
@@ -40,7 +39,7 @@ int Base64Encode(byte * input, int len, byte * encoded)
    return encLen;
 }
 
-int Base64Decode(byte * input, int len, byte * decoded)
+int Base64Decode(const byte * input, int len, byte * decoded)
 {
    uint buffer;
    int c = 0;
index 34c32ca..f008a38 100644 (file)
@@ -319,12 +319,12 @@ class RoundedSquare : Window
       *ch = Max(*ch, 0);
    }
 
-   void PreShowDecorations(Font captionFont, Surface surface, char * name, bool active, bool moving)
+   void PreShowDecorations(Font captionFont, Surface surface, const char * name, bool active, bool moving)
    {
       bmps.RenderBack(surface, size, { (byte)(opacity * 255), background });
    }
 
-   void ShowDecorations(Font captionFont, Surface surface, char * name, bool active, bool moving)
+   void ShowDecorations(Font captionFont, Surface surface, const char * name, bool active, bool moving)
    {
       //if(borderStyle == contour)
          bmps.RenderBorder(surface, size, borderColor);
index b40755c..a88d97a 100644 (file)
@@ -180,7 +180,6 @@ class CheckListBox : ListBox
          CheckListBoxButton button = buttonMaps[(uintptr)row];
          if(button)
          {
-            bool wasChecked = button.checked;
             button.checked = false;
             button.buttonState = up;
          }
index ae81dbc..90ad090 100644 (file)
@@ -10,21 +10,14 @@ class PasswordBox : EditBox
 
    void OnRedraw(Surface surface)
    {
-      EditLine l;
-      int y, x1, x2;
+      char * contents = (char *)this.contents;
       char * backup = CopyString(contents);
       int len = strlen(backup);
-      char * string = new char[len + 1];
       // what char / font combination to use for desired blocking char on all platforms?
       // memset(string, 'g', len);
-      memset(string, 'l', len);
-      string[len] = 0;
-      GetSelPos(&l, &y, &x1, &l, &y, &x2, false);
-      contents = string;
-      SetSelPos(l, y, x1, l, y, x2);
+      memset(contents, 'l', len);
       EditBox::OnRedraw(surface);
       memcpy(contents, backup, len);
-      delete string;
       delete backup;
    }
 }
index 8428dc8..6aa383f 100644 (file)
@@ -49,7 +49,7 @@ ColorKey skinGradient[3] =
 
 class SimSkin_Window : Window
 {
-   void ShowDecorations(Font captionFont, Surface surface, char * name, bool active, bool moving)
+   void ShowDecorations(Font captionFont, Surface surface, const char * name, bool active, bool moving)
    {
       bool isNormal = (state == normal || state == maximized);
       int top = 0, border = 0, bottom = 0;
@@ -265,7 +265,7 @@ class SimSkin_Window : Window
 
    void SetWindowMinimum(MinMaxValue * mw, MinMaxValue * mh)
    {
-      bool isNormal = (state == normal || state == maximized);
+      //bool isNormal = (state == normal || state == maximized);
       if(nativeDecorations && rootWindow == this) return;
       if(((BorderBits)borderStyle).fixed && (state != maximized || !parent.menuBar))
       {
@@ -524,9 +524,9 @@ static void Button::Close_OnRedraw(Surface surface)
 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnApplyGraphics;
 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRedraw;
 
-static void Dummy()
+__attribute__((unused)) static void Dummy()
 {
-   Window a;
+   Window a = null;
    a.OnApplyGraphics();
    a.OnRedraw(null);
 }
@@ -636,9 +636,9 @@ class SimSkin_Button : Button
       {
          ButtonState state = this.buttonState;
          Bitmap buttonBitmap = bitmap ? bitmap.bitmap : null;
-         char * text = this.text;
+         const char * text = this.text;
          int offset = (state == down && this.offset) ? 1 : 0;
-         Color backColor = background;
+         //Color backColor = background;
          int isDefault = this.isDefault;
          Font font;
 
@@ -942,7 +942,7 @@ public class SimSkin : Skin
       return { faceName = "Verdana", size = 6.5f };
    }
 
-   char * ::CursorsBitmaps(uint id, int *hotSpotX, int *hotSpotY, byte ** paletteShades)
+   const char * ::CursorsBitmaps(uint id, int *hotSpotX, int *hotSpotY, byte ** paletteShades)
    {
       return null;
    }
index bd09c38..5fe2d05 100644 (file)
@@ -6,9 +6,10 @@ public import "ecere"
 
 public enum Trim { no, left = 1, right = 2, ends = 3, middle = 4, all = 7 };
 
-void TrimChars(char * string, char * output, char * chars, Trim trim, bool squash, char alt)
+void TrimChars(const char * string, char * output, const char * chars, Trim trim, bool squash, char alt)
 {
-   char * s = string, * o = output;
+   const char * s = string;
+   char * o = output;
    char ch;
    bool keepChar = (trim & left) != left;
    bool keepMiddleChars = (trim & middle) != middle;
@@ -35,7 +36,7 @@ void TrimChars(char * string, char * output, char * chars, Trim trim, bool squas
    *o = '\0';
 }
 
-char * TrimCharsCopy(char * string, char * chars, Trim trim, bool squash, char alt)
+char * TrimCharsCopy(const char * string, const char * chars, Trim trim, bool squash, char alt)
 {
    int len = strlen(string);
    char * output = new char[len+1];
@@ -45,9 +46,10 @@ char * TrimCharsCopy(char * string, char * chars, Trim trim, bool squash, char a
    return output;
 }
 
-void TrimTestChars(char * string, char * output, int (*CharTest)(char), Trim trim, bool squash, char alt)
+void TrimTestChars(const char * string, char * output, int (*CharTest)(char), Trim trim, bool squash, char alt)
 {
-   char * s = string, * o = output;
+   const char * s = string;
+   char * o = output;
    char ch;
    bool keepChar = (trim & left) != left;
    bool keepMiddleChars = (trim & middle) != middle;
@@ -74,7 +76,7 @@ void TrimTestChars(char * string, char * output, int (*CharTest)(char), Trim tri
    *o = '\0';
 }
 
-char * TrimTestCharsCopy(char * string, int (*CharTest)(char), Trim trim, bool squash, char alt)
+char * TrimTestCharsCopy(const char * string, int (*CharTest)(char), Trim trim, bool squash, char alt)
 {
    int len = strlen(string);
    char * output = new char[len+1];
index 3a62a85..223779a 100644 (file)
@@ -6,7 +6,7 @@ public import "ecere"
 
 Time QuickTime()
 {
-   DateTime time, t;
+   DateTime time;
    time.GetLocalTime();
    return time.hour * 60 * 60 + time.minute * 60 + time.second;
 }
index a2c5dc2..099b583 100644 (file)
@@ -6,7 +6,7 @@ public import "ecere"
 
 extern int __ecereVMethodID_class_OnGetString;
 
-static String countryNames[CountryCode] =
+static const String countryNames[CountryCode] =
 {
    "(none)",
    "Andorra", // 1974
@@ -316,7 +316,7 @@ public enum CountryCode
    //static const CountryCode ::first = AD;
    //static const CountryCode ::last = ZW;
 
-   char * OnGetString(char * tempString, void * fieldData, bool * needClass)
+   const char * OnGetString(char * tempString, void * fieldData, bool * needClass)
    {
       return name;
    }
@@ -331,8 +331,8 @@ public enum CountryCode
    }
 
 public:
-   property char * { get { char * s = OnGetString(null, null, null); return s; } }
-   property char * name { get { return countryNames[this]; } }
+   property const char * { get { const char * s = OnGetString(null, null, null); return s; } }
+   property const char * name { get { return countryNames[this]; } }
    // ATTENTION: allocated memory must be freed by caller
    property char * code
    {
@@ -348,7 +348,7 @@ public:
    }
 };
 
-static String subdivisionCategoryNames[SubdivisionCategory] =
+static const String subdivisionCategoryNames[SubdivisionCategory] =
 {
    "(none)",
    "Administration", "Metropolitan Administration",
@@ -448,10 +448,10 @@ public enum SubdivisionCategory
    territorialUnit, autonomousTerritorialUnit;
 
 public:
-   property char * name { get { return subdivisionCategoryNames[this]; } }
+   property const char * name { get { return subdivisionCategoryNames[this]; } }
 };
 
-static String caSubdivisionNames[CASubdivisionCode] =
+static const String caSubdivisionNames[CASubdivisionCode] =
 {
    "(none)",
    "Alberta",
@@ -478,16 +478,16 @@ public enum CASubdivisionCode
 {
    none, AB, BC, MB, NB, NL, NS, ON, PE, QC, SK, NT, NU, YT;
 
-   char * OnGetString(char * tempString, void * fieldData, bool * needClass)
+   const char * OnGetString(char * tempString, void * fieldData, bool * needClass)
    {
       return name;
    }
 
 public:
-   property char * { get { char * s = OnGetString(null, null, null); return s; } }
+   property const char * { get { const char * s = OnGetString(null, null, null); return s; } }
    // ATTENTION: allocated memory must be freed by caller
    property char * completeCode { get { return PrintString(CountryCode::CA, "-", this); } }
-   property char * name { get { return caSubdivisionNames[this]; } }
+   property const char * name { get { return caSubdivisionNames[this]; } }
    // ATTENTION: allocated memory must be freed by caller
    property char * code
    {
@@ -505,7 +505,7 @@ public:
    // TODO: OnDisplay and flag resources
 };
 
-static String usSubdivisionNames[USSubdivisionCode] =
+static const String usSubdivisionNames[USSubdivisionCode] =
 {
    "(none)",
    "Alaska",
@@ -584,16 +584,16 @@ public enum USSubdivisionCode
    NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, PR, RI, SC, SD, TN, TX,
    UM, UT, VA, VI, VT, WA, WI, WV, WY;
 
-   char * OnGetString(char * tempString, void * fieldData, bool * needClass)
+   const char * OnGetString(char * tempString, void * fieldData, bool * needClass)
    {
       return name;
    }
 
 public:
-   property char * { get { char * s = OnGetString(null, null, null); return s; } }
+   property const char * { get { const char * s = OnGetString(null, null, null); return s; } }
    // ATTENTION: allocated memory must be freed by caller
    property char * completeCode { get { return PrintString(CountryCode::US, "-", this); } }
-   property char * name { get { return usSubdivisionNames[this]; } }
+   property const char * name { get { return usSubdivisionNames[this]; } }
    // ATTENTION: allocated memory must be freed by caller
    property char * code
    {
index 498c760..7a29b3f 100644 (file)
@@ -6,7 +6,7 @@ public import "ecere"
 
 default:
 
-static void _WorkAround()
+__attribute__((unused)) static void _WorkAround()
 {
    int a;
    a.OnGetDataFromString(null);
@@ -17,7 +17,7 @@ private:
 
 public class Currency : double
 {
-   char * OnGetString(char * tempString, void * fieldData, bool * needClass)
+   const char * OnGetString(char * tempString, void * fieldData, bool * needClass)
    {
       char number[256];
       int len;
@@ -60,7 +60,7 @@ public class Currency : double
       return tempString;
    }
 
-   bool OnGetDataFromString(char * string)
+   bool OnGetDataFromString(const char * string)
    {
       int c;
       char ch;
index bb6cfba..35df061 100644 (file)
@@ -4,14 +4,14 @@ public import static "ecere"
 public import "ecere"
 #endif
 
-static Array<String> shortMonths
+static Array<const String> shortMonths
 { [
    $"Jan", $"Feb", $"Mar", $"Apr", $"May", $"Jun", $"Jul", $"Aug", $"Sep", $"Oct", $"Nov", $"Dec"
 ] };
 
 public struct ShortDate : Date
 {
-   char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
+   const char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
    {
       if(day || month || year)
       {
index 646bba8..5b7cb00 100644 (file)
@@ -69,12 +69,12 @@ public:
 
    virtual uint stdcall AddRef()
    {
-      return (uint)InterlockedIncrement(&_refCount);
+      return (uint)InterlockedIncrement((void *)&_refCount);
    }
 
    virtual uint stdcall Release()
    {
-      uint cRef = InterlockedDecrement(&_refCount);
+      uint cRef = InterlockedDecrement((void *)&_refCount);
       if(cRef == 0)
          delete this;
       return cRef;
@@ -219,7 +219,7 @@ class WiaItem
 {
    IWiaItem *pWiaItem;
 
-   HRESULT DeviceDlg(HWND hWndParent, uint lFlags, uint lIntent, int * count, void * images)
+   HRESULT DeviceDlg(HWND hWndParent, uint lFlags, uint lIntent, LONG * count, void * images)
    {
       return (HRESULT)IWiaItem_DeviceDlg(pWiaItem, hWndParent, lFlags, lIntent, count, images);
    }
@@ -268,7 +268,7 @@ public:
    {
       List<Bitmap> result = null;
       IWiaItem ** ppIWiaItem;
-      int count;
+      LONG count;
       Window window = ((GuiApplication)__thisModule.application).desktop.activeChild;
       if(window) window = window.rootWindow;
 
@@ -286,13 +286,13 @@ public:
             GET_STIDEVICE_TYPE(nDevType) == StiDeviceTypeScanner)
          {
             PROPSPEC specDocumentHandlingSelect;
-            LONG nDocumentHandlingSelect;
+            uint nDocumentHandlingSelect;
 
             specDocumentHandlingSelect.ulKind = PRSPEC_PROPID;
             specDocumentHandlingSelect.propid = WIA_DPS_DOCUMENT_HANDLING_SELECT;
 
             if(scannerProp.ReadLong(&specDocumentHandlingSelect, &nDocumentHandlingSelect) &&
-               nDocumentHandlingSelect & FEEDER)
+               (nDocumentHandlingSelect & FEEDER))
             {
                PROPSPEC specPages;
                PROPVARIANT varPages;
@@ -336,7 +336,7 @@ public:
                   {
                      GUID guidFormat = WiaImgFmt_BMP;
                      GUID preferredFormat;
-                     String format = "bmp";
+                     const String format = "bmp";
                      PROPSPEC specPreferredFormat;
 
                      specPreferredFormat.ulKind = PRSPEC_PROPID;
index 56b0892..6fd019e 100644 (file)
@@ -205,10 +205,13 @@ static void OutputString(File f, const char * string)
    }
 }
 
+// Consider merging with PrintType ?
 void OutputType(File f, Type type, bool outputName)
 {
    if(type)
    {
+      if(type.kind != pointerType && type.constant)
+         f.Printf("const ");
       switch(type.kind)
       {
          case voidType:
@@ -273,6 +276,8 @@ void OutputType(File f, Type type, bool outputName)
          case pointerType:
             OutputType(f, type.type, false);
             f.Printf(" *");
+            if(type.constant)
+               f.Printf(" const");
             break;
          case ellipsisType:
             f.Printf("...");
index 7f7e3d7..af16d40 100644 (file)
@@ -24,7 +24,7 @@ class EDABetterTestForm : Window
 
       bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
       {
-         char * select = row.string;
+         const char * select = row.string;
          if(!strcmp(select, "EDB") || !strcmp(select, "SQLite"))
          {
             char path[MAX_LOCATION];
index ae446c5..2ecbddb 100644 (file)
@@ -114,7 +114,7 @@ class BorrowerGroupFooter : Detail
 
    void OnRedraw(Surface surface)
    {
-      int x = clientSize.w - 1, y = clientSize.h - 1;
+      int x = clientSize.w - 1;
       surface.HLine(0, x, 5);
    }
 }
index ef2ccb2..161a97e 100644 (file)
@@ -2,7 +2,7 @@ import "EDA"
 
 struct ShortDate : Date
 {
-   char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
+   const char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
    {
       static const char months[12][4] =
       {