}
}
-static void OutputSpecifier(struct Specifier * spec, struct __ecereNameSpace__ecere__com__Instance * f);
+static void OutputSpecifier(struct Specifier * spec, struct __ecereNameSpace__ecere__com__Instance * f, unsigned int typeName);
static void OutputDeclarator(struct Declarator * decl, struct __ecereNameSpace__ecere__com__Instance * f);
for(spec = (*type->qualifiers).first; spec; spec = spec->next)
{
-OutputSpecifier(spec, f);
+OutputSpecifier(spec, f, 0x0);
if(spec->next)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
}
for(spec = (*exp->_classExp.specifiers).first; spec; spec = spec->next)
{
-OutputSpecifier(spec, f);
+OutputSpecifier(spec, f, 0x0);
if(spec->next)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
}
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "__asm__ ");
if(stmt->asmStmt.spec)
-OutputSpecifier(stmt->asmStmt.spec, f);
+OutputSpecifier(stmt->asmStmt.spec, f, 0x0);
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "(");
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, stmt->asmStmt.statements);
if(stmt->asmStmt.inputFields || stmt->asmStmt.outputFields || stmt->asmStmt.clobberedFields)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
for(spec = (*ptr->qualifiers).first; spec; spec = spec->next)
{
-OutputSpecifier(spec, f);
+OutputSpecifier(spec, f, 0x0);
if(spec->next)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
}
static void OutputClassDef(struct ClassDef * def, struct __ecereNameSpace__ecere__com__Instance * f);
-static void OutputSpecifier(struct Specifier * spec, struct __ecereNameSpace__ecere__com__Instance * f)
+static void OutputSpecifier(struct Specifier * spec, struct __ecereNameSpace__ecere__com__Instance * f, unsigned int typeName)
{
switch(spec->type)
{
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "int");
break;
case UINT:
-((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "unsigned int");
+((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, typeName ? "uint" : "unsigned int");
break;
case INT64:
-((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "long long");
+((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, typeName ? "int64" : "long long");
break;
case VALIST:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "__builtin_va_list");
break;
case 7:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "subclass(");
-OutputSpecifier(spec->_class, f);
+OutputSpecifier(spec->_class, f, 0x0);
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, ")");
break;
case 8:
}
if(decl->specifiers)
{
+unsigned int inTypeDef = 0x0;
+
for(spec = (*decl->specifiers).first; spec; spec = spec->next)
{
-OutputSpecifier(spec, f);
+if(spec->type == 0 && spec->specifier == TYPEDEF)
+inTypeDef = 0x1;
+OutputSpecifier(spec, f, inTypeDef && !spec->next);
if(spec->next)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
}
{
for(spec = (*decl->specifiers).first; spec; spec = spec->next)
{
-OutputSpecifier(spec, f);
+OutputSpecifier(spec, f, 0x0);
if(spec->next)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
}
if(decl->extStorage)
{
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
-OutputSpecifier(decl->extStorage, f);
+OutputSpecifier(decl->extStorage, f, 0x0);
}
break;
}
for(spec = (*func->specifiers).first; spec; spec = spec->next)
{
-OutputSpecifier(spec, f);
+OutputSpecifier(spec, f, 0x0);
if(spec->next)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
}
static void OutputInstance(struct Instantiation * inst, struct __ecereNameSpace__ecere__com__Instance * f)
{
if(inst->_class)
-OutputSpecifier(inst->_class, f);
+OutputSpecifier(inst->_class, f, 0x0);
if(inst->exp)
{
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
for(spec = (*func->specifiers).first; spec; spec = spec->next)
{
-OutputSpecifier(spec, f);
+OutputSpecifier(spec, f, 0x0);
if(spec->next)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " ");
}
static void OutputClass(struct ClassDefinition * _class, struct __ecereNameSpace__ecere__com__Instance * f)
{
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "class ");
-OutputSpecifier(_class->_class, f);
+OutputSpecifier(_class->_class, f, 0x0);
if(_class->baseSpecs)
{
struct Specifier * spec;
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, " : ");
for(spec = (*_class->baseSpecs).first; spec; spec = spec->next)
{
-OutputSpecifier(spec, f);
+OutputSpecifier(spec, f, 0x0);
}
}
if(_class->definitions)
Specifier spec;
for(spec = type.qualifiers->first; spec; spec = spec.next)
{
- OutputSpecifier(spec, f);
+ OutputSpecifier(spec, f, false);
if(spec.next) f.Puts(" ");
}
}
Specifier spec;
for(spec = exp._classExp.specifiers->first; spec; spec = spec.next)
{
- OutputSpecifier(spec, f);
+ OutputSpecifier(spec, f, false);
if(spec.next) f.Puts(" ");
}
if(exp._classExp.decl)
AsmField field;
f.Puts("__asm__ ");
if(stmt.asmStmt.spec)
- OutputSpecifier(stmt.asmStmt.spec, f);
+ OutputSpecifier(stmt.asmStmt.spec, f, false);
f.Puts("(");
f.Puts(stmt.asmStmt.statements);
f.Puts(" ");
for(spec = ptr.qualifiers->first; spec; spec = spec.next)
{
- OutputSpecifier(spec, f);
+ OutputSpecifier(spec, f, false);
if(spec.next) f.Puts(" ");
}
}
OutputAttrib(extDecl.attr, f);
}
-static void OutputSpecifier(Specifier spec, File f)
+static void OutputSpecifier(Specifier spec, File f, bool typeName)
{
switch(spec.type)
{
f.Puts("int");
break;
case UINT:
- f.Puts("unsigned int");
+ f.Puts(typeName ? "uint" : "unsigned int");
break;
case INT64:
//f.Puts("__int64");
//f.Puts("int64");
- f.Puts("long long");
+ f.Puts(typeName ? "int64" : "long long");
break;
case VALIST:
f.Puts("__builtin_va_list");
break;
case subClassSpecifier:
f.Puts("subclass(");
- OutputSpecifier(spec._class, f);
+ OutputSpecifier(spec._class, f, false);
f.Puts(")");
break;
case templateTypeSpecifier:
if(decl.specifiers)
{
+ bool inTypeDef = false;
for(spec = decl.specifiers->first; spec; spec = spec.next)
{
- OutputSpecifier(spec, f);
+ if(spec.type == baseSpecifier && spec.specifier == TYPEDEF)
+ inTypeDef = true;
+ OutputSpecifier(spec, f, inTypeDef && !spec.next);
if(spec.next) f.Puts(" ");
}
}
{
for(spec = decl.specifiers->first; spec; spec = spec.next)
{
- OutputSpecifier(spec, f);
+ OutputSpecifier(spec, f, false);
if(spec.next) f.Puts(" ");
}
}
if(decl.extStorage)
{
f.Puts(" ");
- OutputSpecifier(decl.extStorage, f);
+ OutputSpecifier(decl.extStorage, f, false);
}
break;
}
Specifier spec;
for(spec = func.specifiers->first; spec; spec = spec.next)
{
- OutputSpecifier(spec, f);
+ OutputSpecifier(spec, f, false);
if(spec.next) f.Puts(" ");
}
f.Puts(" ");
static void OutputInstance(Instantiation inst, File f)
{
if(inst._class)
- OutputSpecifier(inst._class, f);
+ OutputSpecifier(inst._class, f, false);
if(inst.exp)
{
f.Puts(" ");
Specifier spec;
for(spec = func.specifiers->first; spec; spec = spec.next)
{
- OutputSpecifier(spec, f);
+ OutputSpecifier(spec, f, false);
if(spec.next) f.Puts(" ");
}
f.Puts(" ");
{
//if(func.class != (void *)-1)
if(func.class)
- OutputSpecifier(func.class, f);
+ OutputSpecifier(func.class, f, false);
f.Puts("::");
}*/
if(func.declarator) OutputDeclarator(func.declarator, f);
static void OutputClass(ClassDefinition _class, File f)
{
f.Puts("class ");
- OutputSpecifier(_class._class, f);
+ OutputSpecifier(_class._class, f, false);
if(_class.baseSpecs)
{
Specifier spec;
f.Puts(" : ");
for(spec = _class.baseSpecs->first; spec; spec = spec.next)
{
- OutputSpecifier(spec, f);
+ OutputSpecifier(spec, f, false);
}
}
if(_class.definitions)