From 19a0444f41e8947154041c92e46fc3158c410002 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Wed, 19 Jun 2019 09:45:56 -0400 Subject: [PATCH] Appease MSVC --- src/core/corelib.c | 8 +++++--- src/core/peg.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) 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) {