From ef238e0940a56298061f60c0c8d66cb7c4e2f653 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 28 Oct 2025 10:44:57 +0100 Subject: fix: remove two unused-variable warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matěj Cepl --- src/random.c | 3 +-- src/term.c | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/random.c b/src/random.c index 5a07e0d..4c92745 100644 --- a/src/random.c +++ b/src/random.c @@ -60,7 +60,6 @@ static int lua_get_random_bytes(lua_State* L) { return 2; } - ssize_t n; ssize_t total_read = 0; #ifdef _WIN32 @@ -99,7 +98,7 @@ static int lua_get_random_bytes(lua_State* L) { } while (total_read < num_bytes) { - n = read(fd, buffer + total_read, num_bytes - total_read); + ssize_t n = read(fd, buffer + total_read, num_bytes - total_read); if (n < 0) { if (errno == EINTR) { diff --git a/src/term.c b/src/term.c index 0325208..a389e06 100644 --- a/src/term.c +++ b/src/term.c @@ -1226,6 +1226,8 @@ static int lst_setconsolecp(lua_State *L) { int success = TRUE; #ifdef _WIN32 SetConsoleCP(cp); +#else + (void)cp; #endif lua_pushboolean(L, success); return 1; @@ -1262,6 +1264,8 @@ static int lst_setconsoleoutputcp(lua_State *L) { int success = TRUE; #ifdef _WIN32 SetConsoleOutputCP(cp); +#else + (void)cp; #endif lua_pushboolean(L, success); return 1; -- cgit v1.2.3-55-g6feb