From 35bfa1b9f1af2d693a222ce71a94f42f7f613e1a Mon Sep 17 00:00:00 2001 From: Ratstail91 Date: Mon, 31 Jul 2023 12:06:04 +1000 Subject: [PATCH] Tweak, these were annoying me --- repl/lib_standard.c | 8 ++++---- repl/repl_tools.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/repl/lib_standard.c b/repl/lib_standard.c index ebfb0a3..786cbd3 100644 --- a/repl/lib_standard.c +++ b/repl/lib_standard.c @@ -202,11 +202,11 @@ static int nativeMax(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments) //cooerce if needed if (TOY_IS_INTEGER(resultLiteral) && TOY_IS_FLOAT(selfLiteral)) { - resultLiteral = TOY_TO_FLOAT_LITERAL( TOY_AS_INTEGER(resultLiteral) ); + resultLiteral = TOY_TO_FLOAT_LITERAL( (float)TOY_AS_INTEGER(resultLiteral) ); } if (TOY_IS_FLOAT(resultLiteral) && TOY_IS_INTEGER(selfLiteral)) { - selfLiteral = TOY_TO_FLOAT_LITERAL( TOY_AS_INTEGER(selfLiteral) ); + selfLiteral = TOY_TO_FLOAT_LITERAL( (float)TOY_AS_INTEGER(selfLiteral) ); } //compare @@ -258,11 +258,11 @@ static int nativeMin(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments) //cooerce if needed if (TOY_IS_INTEGER(resultLiteral) && TOY_IS_FLOAT(selfLiteral)) { - resultLiteral = TOY_TO_FLOAT_LITERAL( TOY_AS_INTEGER(resultLiteral) ); + resultLiteral = TOY_TO_FLOAT_LITERAL( (float)TOY_AS_INTEGER(resultLiteral) ); } if (TOY_IS_FLOAT(resultLiteral) && TOY_IS_INTEGER(selfLiteral)) { - selfLiteral = TOY_TO_FLOAT_LITERAL( TOY_AS_INTEGER(selfLiteral) ); + selfLiteral = TOY_TO_FLOAT_LITERAL( (float)TOY_AS_INTEGER(selfLiteral) ); } //compare diff --git a/repl/repl_tools.c b/repl/repl_tools.c index 6e58a44..a222c18 100644 --- a/repl/repl_tools.c +++ b/repl/repl_tools.c @@ -159,7 +159,7 @@ static unsigned char readByte(const unsigned char* tb, int* count) { static const char* readString(const unsigned char* tb, int* count) { const unsigned char* ret = tb + *count; - *count += strlen((char*)ret) + 1; //+1 for null character + *count += (int)strlen((char*)ret) + 1; //+1 for null character return (const char*)ret; }