coder-mike / microvium

A compact, embeddable scripting engine for applications and microcontrollers for executing programs written in a subset of the JavaScript language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

int32_t is a long int

hiperiondev opened this issue · comments

In static Value vm_intToStr(VM* vm, int32_t i):
size = MVM_SNPRINTF(buf, sizeof buf, "%d", i);

must be:

size = MVM_SNPRINTF(buf, sizeof buf, "%ld", i);

Ah yeah, thanks. Should be fixed now!

The correct way of doing this is with the PRId32 macro. On LP64 platforms, coercing to long is inefficient.

Ah yeah, good call. Thanks @davidchisnall!