int32_t is long int on toaru? I should probably fix that

This commit is contained in:
K. Lange 2020-12-28 21:08:55 +09:00
parent 724e44655d
commit ae2b00bcfa
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ void krk_printValue(FILE * f, KrkValue value) {
if (IS_FLOATING(value)) {
fprintf(f, "%g", AS_FLOATING(value));
} else if (IS_INTEGER(value)) {
fprintf(f, "%d", AS_INTEGER(value));
fprintf(f, "%d", (int)AS_INTEGER(value));
} else if (IS_BOOLEAN(value)) {
fprintf(f, "%s", AS_BOOLEAN(value) ? "True" : "False");
} else if (IS_NONE(value)) {

2
vm.c
View File

@ -487,7 +487,7 @@ static void addObjects() {
}
char tmp[256] = {0};
if (IS_INTEGER(_b)) {
sprintf(tmp, "%d", AS_INTEGER(_b));
sprintf(tmp, "%d", (int)AS_INTEGER(_b));
} else if (IS_FLOATING(_b)) {
sprintf(tmp, "%g", AS_FLOATING(_b));
} else if (IS_BOOLEAN(_b)) {