Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix -Wsign-compare warnings in 1DS C++ SDK. #1321

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/jni/LogManager_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ Java_com_microsoft_applications_events_LogManagerProvider_00024LogManagerImpl_na
ManagerAndConfig const* mc;
{
std::lock_guard<std::mutex> lock(jniManagersMutex);
if (nativeLogManagerIndex < 0 || nativeLogManagerIndex >= jniManagers.size())
if (nativeLogManagerIndex < 0 || nativeLogManagerIndex >= static_cast<jlong>(jniManagers.size()))
{
return nullptr;
}
Expand All @@ -914,7 +914,7 @@ Java_com_microsoft_applications_events_LogManagerProvider_00024LogManagerImpl_na
{
{
std::lock_guard<std::mutex> lock(jniManagersMutex);
if (nativeLogManager < 0 || nativeLogManager >= jniManagers.size())
if (nativeLogManager < 0 || nativeLogManager >= static_cast<jlong>(jniManagers.size()))
{
return;
}
Expand Down Expand Up @@ -971,7 +971,7 @@ Java_com_microsoft_applications_events_LogManagerProvider_00024LogManagerImpl_na
ManagerAndConfig* mc;
{
std::lock_guard<std::mutex> lock(jniManagersMutex);
if (nativeLogManagerIndex < 0 || nativeLogManagerIndex >= jniManagers.size())
if (nativeLogManagerIndex < 0 || nativeLogManagerIndex >= static_cast<jlong>(jniManagers.size()))
{
return 0;
}
Expand All @@ -997,7 +997,7 @@ Java_com_microsoft_applications_events_LogManagerProvider_00024LogManagerImpl_na
static ILogManager* getLogManager(jlong nativeLogManager)
{
std::lock_guard<std::mutex> lock(jniManagersMutex);
if (nativeLogManager < 0 || nativeLogManager >= jniManagers.size())
if (nativeLogManager < 0 || nativeLogManager >= static_cast<jlong>(jniManagers.size()))
{
return nullptr;
}
Expand Down Expand Up @@ -1587,7 +1587,8 @@ Java_com_microsoft_applications_events_LogManagerProvider_00024LogManagerImpl_na
jlong eventType,
jlong identity) {
std::lock_guard<std::mutex> l(listeners_mutex);
if (identity < 0 || identity >= listeners.size() || !listeners[identity]) {
if (identity < 0 || identity >= static_cast<jlong>(jniManagers.size()) || !listeners[identity])
{
return;
}
auto logManager = getLogManager(native_log_manager);
Expand Down
2 changes: 1 addition & 1 deletion tests/common/SocketTools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class SocketAddr
#ifdef _WIN32
INT addrlen = sizeof(m_data);
WCHAR buf[200];
for(int i = 0; i < sizeof(buf) && addr[i]; i++)
for(size_t i = 0; i < sizeof(buf) && addr[i]; i++)
{
buf[i] = addr[i];
}
Expand Down
Loading