From 6621c97c34e6e1f193e45bb3bbf0d888368c4a5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Sun, 11 Feb 2024 16:38:03 -0500
Subject: [PATCH] Disable MSVC warnings 4244 and 4267.

The alternative is to explicitly copy/paste the type everywhere
forcing the compiler to do the only thing it could possibly do,
and making it painful to change a type later.

Honestly, in my opinion, these warnings should just be disabled
completely everywhere.
---
 src/conio/cterm.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/conio/cterm.c b/src/conio/cterm.c
index 19edfafa64..9d787f7294 100644
--- a/src/conio/cterm.c
+++ b/src/conio/cterm.c
@@ -54,6 +54,16 @@
 #include "base64.h"
 #include <crc16.h>
 
+/*
+ * Disable warnings for well-defined standard C operations
+ * 4244 appears to be for implicit conversions
+ * warning C4244: '=': conversion from 'uint64_t' to 'int', possible loss of data
+ * 4267 is the same thing, but from size_t.
+ */
+#ifdef _MSC_VER
+#pragma warning(disable : 4244 4267)
+#endif
+
 // Hack for Visual Studio 2022
 #ifndef UINT64_MAX
 #define UINT64_MAX UINT64_C(-1)
-- 
GitLab