diff --git a/src/core/corelib.c b/src/core/corelib.c index a6c69dec..9de58134 100644 --- a/src/core/corelib.c +++ b/src/core/corelib.c @@ -144,10 +144,12 @@ static Janet janet_core_expand_path(int32_t argc, Janet *argv) { janet_buffer_push_cstring(out, input); i += 4; } else if (strncmp(template + i, ":cur:", 5) == 0) { - janet_buffer_push_bytes(out, (const uint8_t *) curfile, curname - curfile); + janet_buffer_push_bytes(out, (const uint8_t *) curfile, + (int32_t)(curname - curfile)); i += 4; } else if (strncmp(template + i, ":dir:", 5) == 0) { - janet_buffer_push_bytes(out, (const uint8_t *) input, name - input); + janet_buffer_push_bytes(out, (const uint8_t *) input, + (int32_t)(name - input)); i += 4; } else if (strncmp(template + i, ":sys:", 5) == 0) { janet_buffer_push_cstring(out, syspath); @@ -209,7 +211,7 @@ static Janet janet_core_expand_path(int32_t argc, Janet *argv) { } scan++; } - out->count = print - out->data; + out->count = (int32_t)(print - out->data); return janet_wrap_buffer(out); } diff --git a/src/core/peg.c b/src/core/peg.c index fe06a722..17555866 100644 --- a/src/core/peg.c +++ b/src/core/peg.c @@ -1002,7 +1002,7 @@ static void peg_unmarshal(void *p, JanetMarshalContext *ctx) { * need to a depth first traversal. It is stricter * than a dfs by not allowing certain kinds of unused * bytecode. */ - uint32_t blen = peg->bytecode_len; + uint32_t blen = (int32_t) peg->bytecode_len; uint32_t clen = peg->num_constants; uint8_t *op_flags = calloc(1, blen); if (NULL == op_flags) {