From 1900d8f8431ec29546cb6c259ad285933c36f37b Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Wed, 20 Jul 2022 08:04:03 -0500 Subject: [PATCH] Fix build warnings on Linux GCC version 12.1.0 x64 --- src/core/value.c | 2 +- src/mainclient/shell.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/value.c b/src/core/value.c index b4a17dab..2bca53d1 100644 --- a/src/core/value.c +++ b/src/core/value.c @@ -348,7 +348,7 @@ int32_t janet_hash(Janet x) { hash = (int32_t)((hilo << 16) | (hilo >> 16)); } else { /* Assuming 4 byte pointer (or smaller) */ - uintptr_t diff = janet_unwrap_pointer(x); + uintptr_t diff = (uintptr_t) janet_unwrap_pointer(x); uint32_t hilo = (uint32_t) diff * 2654435769u; hash = (int32_t)((hilo << 16) | (hilo >> 16)); } diff --git a/src/mainclient/shell.c b/src/mainclient/shell.c index 28859318..1a34432f 100644 --- a/src/mainclient/shell.c +++ b/src/mainclient/shell.c @@ -375,7 +375,7 @@ static void refresh(void) { /* Move cursor to original position. */ snprintf(seq, 64, "\r\x1b[%dC", (int)(_pos + gbl_plen)); janet_buffer_push_cstring(&b, seq); - if (write_console(b.data, b.count) == -1) { + if (write_console((char *) b.data, b.count) == -1) { exit(1); } janet_buffer_deinit(&b); @@ -857,7 +857,7 @@ static int line() { addhistory(); - if (write_console(gbl_prompt, gbl_plen) == -1) return -1; + if (write_console((char *) gbl_prompt, gbl_plen) == -1) return -1; for (;;) { char c; char seq[3];