Use Type::CHAR instead of Type::BOOL for stdlib functions.

This is because C has no int1 type.
This commit is contained in:
Stefano Sanfilippo 2015-03-08 12:29:13 +01:00
parent 83a331a9af
commit 519a7f7510

View File

@ -64,12 +64,12 @@ static const std::string ENTRYPOINT_NAME = "__Monicelli_main";
static const std::map<std::string, std::vector<FunctionPrototype const*>> STANDARD_MODULES = { static const std::map<std::string, std::vector<FunctionPrototype const*>> STANDARD_MODULES = {
{"iostream", { {"iostream", {
PUT(Type::BOOL, __Monicelli_putBool), PUT(Type::CHAR, __Monicelli_putBool),
PUT(Type::CHAR, __Monicelli_putChar), PUT(Type::CHAR, __Monicelli_putChar),
PUT(Type::FLOAT, __Monicelli_putFloat), PUT(Type::FLOAT, __Monicelli_putFloat),
PUT(Type::DOUBLE, __Monicelli_putDouble), PUT(Type::DOUBLE, __Monicelli_putDouble),
PUT(Type::INT, __Monicelli_putInt), PUT(Type::INT, __Monicelli_putInt),
GET(Type::BOOL, __Monicelli_getBool), GET(Type::CHAR, __Monicelli_getBool),
GET(Type::CHAR, __Monicelli_getChar), GET(Type::CHAR, __Monicelli_getChar),
GET(Type::FLOAT, __Monicelli_getFloat), GET(Type::FLOAT, __Monicelli_getFloat),
GET(Type::DOUBLE, __Monicelli_getDouble), GET(Type::DOUBLE, __Monicelli_getDouble),
@ -78,7 +78,7 @@ static const std::map<std::string, std::vector<FunctionPrototype const*>> STANDA
{"cassert", { new FunctionPrototype { {"cassert", { new FunctionPrototype {
new Id("__Monicelli_assert"), Type::VOID, new Id("__Monicelli_assert"), Type::VOID,
new PointerList<FunArg> { new PointerList<FunArg> {
new FunArg {new Id("condition"), Type::BOOL, false} new FunArg {new Id("condition"), Type::CHAR, false}
}, },
}}}, }}},
{"cstdlib", { new FunctionPrototype { {"cstdlib", { new FunctionPrototype {