1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 00:10:27 +00:00

Appease MSVC

This commit is contained in:
Calvin Rose 2019-06-19 09:45:56 -04:00
parent 0102a72538
commit 19a0444f41
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}

View File

@ -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) {