return NOT_COMPATIBLE;
}
-BasicTypeDeclaration *ExpressionResolver::find_type(BasicTypeDeclaration::Kind kind, unsigned size)
+BasicTypeDeclaration *ExpressionResolver::find_type(BasicTypeDeclaration::Kind kind, unsigned size, bool sign)
{
for(vector<BasicTypeDeclaration *>::const_iterator i=basic_types.begin(); i!=basic_types.end(); ++i)
- if((*i)->kind==kind && (*i)->size==size)
+ if((*i)->kind==kind && (*i)->size==size && (*i)->sign==sign)
return *i;
return 0;
}
if(literal.value.check_type<bool>())
resolve(literal, find_type(BasicTypeDeclaration::BOOL, 1), false);
else if(literal.value.check_type<int>())
- resolve(literal, find_type(BasicTypeDeclaration::INT, 32), false);
+ resolve(literal, find_type(BasicTypeDeclaration::INT, 32, true), false);
+ else if(literal.value.check_type<unsigned>())
+ resolve(literal, find_type(BasicTypeDeclaration::INT, 32, false), false);
else if(literal.value.check_type<float>())
resolve(literal, find_type(BasicTypeDeclaration::FLOAT, 32), false);
}