From 6ea530cc48390a09a2af5de6dbe97689fcaefe26 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Fri, 3 Jul 2020 12:25:24 -0500 Subject: [PATCH] Address compilation warnings and errors. --- src/core/peg.c | 2 +- src/core/util.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/peg.c b/src/core/peg.c index 4267b7b7..3c11b3e5 100644 --- a/src/core/peg.c +++ b/src/core/peg.c @@ -1400,7 +1400,7 @@ static Janet cfun_peg_replace_generic(int32_t argc, Janet *argv, int only_one) { janet_buffer_push_bytes(ret, c.bytes.bytes + trail, (i - trail)); trail = i; } - int32_t nexti = result - c.bytes.bytes; + int32_t nexti = (int32_t)(result - c.bytes.bytes); janet_buffer_push_bytes(ret, c.repl.bytes, c.repl.len); trail = nexti; if (nexti == i) nexti++; diff --git a/src/core/util.h b/src/core/util.h index dd239a4b..e8eb9b81 100644 --- a/src/core/util.h +++ b/src/core/util.h @@ -100,6 +100,9 @@ void janet_core_cfuns(JanetTable *env, const char *regprefix, const JanetReg *cf /* Clock gettime */ #if !defined(JANET_REDUCED_OS) || !defined(JANET_SINGLE_THREADED) #include +#ifndef JANET_WINDOWS +#include +#endif #define JANET_GETTIME int janet_gettime(struct timespec *spec); #endif