Misc: clang-cl warning clean-up

This commit is contained in:
Stenzek
2023-09-03 14:30:26 +10:00
parent 7f446526d1
commit 80e3d29ab8
52 changed files with 470 additions and 394 deletions

View File

@ -188,7 +188,8 @@ static ALWAYS_INLINE void FormatLogMessageAndPrintW(const char* channelName, con
char* message_buf = buf;
int message_len;
if ((message_len = FormatLogMessageForDisplay(message_buf, sizeof(buf), channelName, functionName, level, message,
timestamp, ansi_color_code, newline)) > (sizeof(buf) - 1))
timestamp, ansi_color_code, newline)) >
static_cast<int>(sizeof(buf) - 1))
{
message_buf = static_cast<char*>(std::malloc(message_len + 1));
message_len = FormatLogMessageForDisplay(message_buf, message_len + 1, channelName, functionName, level, message,
@ -201,8 +202,8 @@ static ALWAYS_INLINE void FormatLogMessageAndPrintW(const char* channelName, con
// anyway...
wchar_t wbuf[512];
wchar_t* wmessage_buf = wbuf;
int wmessage_buflen = countof(wbuf) - 1;
if (message_len >= countof(wbuf))
int wmessage_buflen = static_cast<int>(std::size(wbuf) - 1);
if (message_len >= static_cast<int>(std::size(wbuf)))
{
wmessage_buflen = message_len;
wmessage_buf = static_cast<wchar_t*>(std::malloc((wmessage_buflen + 1) * sizeof(wchar_t)));