aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2025-10-28 10:44:57 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2025-11-05 11:59:14 +0100
commitef238e0940a56298061f60c0c8d66cb7c4e2f653 (patch)
tree358a15d6b6a1a203ad3fc2aaed0d46334662c3c6
parent88ac69f94ddbe172458c79f2a5e37b6704c606a2 (diff)
downloadluasystem-master.tar.gz
luasystem-master.tar.bz2
luasystem-master.zip
fix: remove two unused-variable warningsHEADmaster
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
-rw-r--r--src/random.c3
-rw-r--r--src/term.c4
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) {
60 return 2; 60 return 2;
61 } 61 }
62 62
63 ssize_t n;
64 ssize_t total_read = 0; 63 ssize_t total_read = 0;
65 64
66#ifdef _WIN32 65#ifdef _WIN32
@@ -99,7 +98,7 @@ static int lua_get_random_bytes(lua_State* L) {
99 } 98 }
100 99
101 while (total_read < num_bytes) { 100 while (total_read < num_bytes) {
102 n = read(fd, buffer + total_read, num_bytes - total_read); 101 ssize_t n = read(fd, buffer + total_read, num_bytes - total_read);
103 102
104 if (n < 0) { 103 if (n < 0) {
105 if (errno == EINTR) { 104 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) {
1226 int success = TRUE; 1226 int success = TRUE;
1227#ifdef _WIN32 1227#ifdef _WIN32
1228 SetConsoleCP(cp); 1228 SetConsoleCP(cp);
1229#else
1230 (void)cp;
1229#endif 1231#endif
1230 lua_pushboolean(L, success); 1232 lua_pushboolean(L, success);
1231 return 1; 1233 return 1;
@@ -1262,6 +1264,8 @@ static int lst_setconsoleoutputcp(lua_State *L) {
1262 int success = TRUE; 1264 int success = TRUE;
1263#ifdef _WIN32 1265#ifdef _WIN32
1264 SetConsoleOutputCP(cp); 1266 SetConsoleOutputCP(cp);
1267#else
1268 (void)cp;
1265#endif 1269#endif
1266 lua_pushboolean(L, success); 1270 lua_pushboolean(L, success);
1267 return 1; 1271 return 1;