From 7993b79f40d9e1b5beed70b31caed80a6f1ee4b2 Mon Sep 17 00:00:00 2001 From: Severin Leonhardt Date: Fri, 23 Sep 2022 17:09:00 +0200 Subject: [PATCH] Fix signed/unsigned mismatch This fixes the following warnings from MSVC: warning C4245: 'initializing': conversion from 'int' to 'datastax::StringRef::size_type', signed/unsigned mismatch warning C4245: '=': conversion from 'int' to 'DWORD', signed/unsigned mismatch --- src/string_ref.cpp | 2 +- src/utils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/string_ref.cpp b/src/string_ref.cpp index 7e1e17352..830b2bec3 100644 --- a/src/string_ref.cpp +++ b/src/string_ref.cpp @@ -18,6 +18,6 @@ namespace datastax { -const StringRef::size_type StringRef::npos = -1; +const StringRef::size_type StringRef::npos = std::numeric_limits::max(); } // namespace datastax diff --git a/src/utils.cpp b/src/utils.cpp index 0dedf2587..5927be1ee 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -179,7 +179,7 @@ void set_thread_name(const String& thread_name) { THREADNAME_INFO info; info.dwType = 0x1000; info.szName = thread_name.c_str(); - info.dwThreadID = -1; + info.dwThreadID = (DWORD)-1; info.dwFlags = 0; #pragma warning(push) #pragma warning(disable : 6320 6322)