- A syntax error was being generated for an unrecognized type, but not if using an existing (mismatched) type
extern unsigned int buildingECERECOMModule;
+extern int strcmp(const char * , const char * );
+
+extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
+
+extern void FreeSpecifier(struct Specifier * spec);
+
extern struct Declarator * GetFuncDecl(struct Declarator * decl);
extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * type, void * function, int declMode);
{
for(def = definitions->first; def; def = def->next)
{
+if(def->type == 0 && (def->function->isConstructor || def->function->isDestructor))
+{
+struct Specifier * spec = def->function->specifiers ? (*def->function->specifiers).last : (((void *)0));
+
+if(!spec || spec->type != 1 || !spec->name || (strcmp(spec->name, regClass->name) && (!spec->symbol || !spec->symbol->registered || strcmp(spec->symbol->registered->name, regClass->name))))
+{
+yylloc = def->function->loc;
+Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "wrong class name specified for %s\n", (((void *)0))), def->function->isConstructor ? __ecereNameSpace__ecere__GetTranslatedString("ec", "constructor", (((void *)0))) : __ecereNameSpace__ecere__GetTranslatedString("ec", "destructor", (((void *)0))));
+}
+FreeList(def->function->specifiers, FreeSpecifier);
+def->function->specifiers = (((void *)0));
+}
if(def->type == 0 && def->function->declarator)
{
struct ClassFunction * func = def->function;
break;
case 13:
{
-yyval.classFunction = MkClassFunction((((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
+yyval.classFunction = MkClassFunction(yyvsp[(1) - (3)].list, (((void *)0)), (((void *)0)), (((void *)0)));
yyval.classFunction->isConstructor = 0x1;
yyval.classFunction->loc = (yyloc);
yyval.classFunction->id = ++globalContext->nextID;
-FreeList(yyvsp[(1) - (3)].list, FreeSpecifier);
;
}
break;
case 14:
{
-yyval.classFunction = MkClassFunction((((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
+yyval.classFunction = MkClassFunction(yyvsp[(2) - (4)].list, (((void *)0)), (((void *)0)), (((void *)0)));
yyval.classFunction->isDestructor = 0x1;
yyval.classFunction->loc = (yyloc);
yyval.classFunction->id = ++globalContext->nextID;
-FreeList(yyvsp[(2) - (4)].list, FreeSpecifier);
+;
}
break;
case 15:
break;
case 13:
{
-yyval.classFunction = MkClassFunction((((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
+yyval.classFunction = MkClassFunction(yyvsp[(1) - (3)].list, (((void *)0)), (((void *)0)), (((void *)0)));
yyval.classFunction->isConstructor = 0x1;
yyval.classFunction->loc = (yyloc);
yyval.classFunction->id = ++globalContext->nextID;
-FreeList(yyvsp[(1) - (3)].list, FreeSpecifier);
;
}
break;
case 14:
{
-yyval.classFunction = MkClassFunction((((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
+yyval.classFunction = MkClassFunction(yyvsp[(2) - (4)].list, (((void *)0)), (((void *)0)), (((void *)0)));
yyval.classFunction->isDestructor = 0x1;
yyval.classFunction->loc = (yyloc);
yyval.classFunction->id = ++globalContext->nextID;
-FreeList(yyvsp[(2) - (4)].list, FreeSpecifier);
+;
}
break;
case 15:
{
for(def = definitions.first; def; def = def.next)
{
+ if(def.type == functionClassDef && (def.function.isConstructor || def.function.isDestructor))
+ {
+ Specifier spec = def.function.specifiers ? def.function.specifiers->last : null;
+ if(!spec || spec.type != nameSpecifier || !spec.name ||
+ (strcmp(spec.name, regClass.name) && (!spec.symbol || !spec.symbol.registered || strcmp(spec.symbol.registered.name, regClass.name))) )
+ {
+ yylloc = def.function.loc;
+ Compiler_Error($"wrong class name specified for %s\n", def.function.isConstructor ? $"constructor" : $"destructor");
+ }
+ FreeList(def.function.specifiers, FreeSpecifier);
+ def.function.specifiers = null;
+ }
if(def.type == functionClassDef && def.function.declarator)
{
ClassFunction func = def.function;
/* Line 1464 of yacc.c */
#line 545 "grammar.y"
- { (yyval.classFunction) = MkClassFunction(null, null, null, null); (yyval.classFunction).isConstructor = true; (yyval.classFunction).loc = (yyloc); (yyval.classFunction).id = ++globalContext.nextID; FreeList((yyvsp[(1) - (3)].list), FreeSpecifier); ;}
+ { (yyval.classFunction) = MkClassFunction((yyvsp[(1) - (3)].list), null, null, null); (yyval.classFunction).isConstructor = true; (yyval.classFunction).loc = (yyloc); (yyval.classFunction).id = ++globalContext.nextID; ;}
break;
case 14:
/* Line 1464 of yacc.c */
#line 550 "grammar.y"
- { (yyval.classFunction) = MkClassFunction(null, null, null, null); (yyval.classFunction).isDestructor = true; (yyval.classFunction).loc = (yyloc); (yyval.classFunction).id = ++globalContext.nextID; FreeList((yyvsp[(2) - (4)].list), FreeSpecifier) ;}
+ { (yyval.classFunction) = MkClassFunction((yyvsp[(2) - (4)].list), null, null, null); (yyval.classFunction).isDestructor = true; (yyval.classFunction).loc = (yyloc); (yyval.classFunction).id = ++globalContext.nextID; ;}
break;
case 15:
constructor_function_definition_start:
guess_declaration_specifiers '(' ')'
- { $$ = MkClassFunction(null, null, null, null); $$.isConstructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; FreeList($1, FreeSpecifier); }
+ { $$ = MkClassFunction($1, null, null, null); $$.isConstructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
;
destructor_function_definition_start:
'~' guess_declaration_specifiers '(' ')'
- { $$ = MkClassFunction(null, null, null, null); $$.isDestructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; FreeList($2, FreeSpecifier) }
+ { $$ = MkClassFunction($2, null, null, null); $$.isDestructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
;
virtual_class_function_definition_start:
if(pullDown && sKey == enter)
{
// Because we can still edit the date text while the calendar is dropped, enter on the date box should validate it
- NotifyTextEntry(master, this, contents /*null*/, true);//false);
+ NotifyTextEntry(master, this, contents, true);
((DataBox)master).SetData(&calendar.dateValue, false);
((DataBox)master).Refresh();
return false;
subclass(GlobalSettingsDriver) driverClass;
- ~GlobalAppSettings()
+ ~GlobalSettings()
{
if(f)
f.Unlock(0, 0, true);
void CloseAndMonitor()
{
Close();
- if(settingsFilePath && OnAskReloadSettings != GlobalAppSettings::OnAskReloadSettings)
+ if(settingsFilePath && OnAskReloadSettings != GlobalSettings::OnAskReloadSettings)
{
settingsMonitor.fileName = settingsFilePath;
settingsMonitor.StartMonitoring();
return result;
}
};
-
openMode = writeRead;
- ~File()
+ ~TempFile()
{
delete buffer;
}