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 compile warnings with jni_utils.hpp #16336

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Changes from 3 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
18 changes: 7 additions & 11 deletions java/src/main/native/include/jni_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class native_jArray {
return data()[index];
}

const N_TYPE* const data() const
N_TYPE const* data() const
{
init_data_ptr();
return data_ptr;
Expand All @@ -296,16 +296,14 @@ class native_jArray {
return data_ptr;
}

const N_TYPE* const begin() const { return data(); }
N_TYPE const* begin() const { return data(); }

N_TYPE* begin() { return data(); }

const N_TYPE* const end() const { return data() + size(); }
N_TYPE const* end() const { return data() + size(); }

N_TYPE* end() { return data() + size(); }

const J_ARRAY_TYPE get_jArray() const { return orig; }

J_ARRAY_TYPE get_jArray() { return orig; }
ttnghia marked this conversation as resolved.
Show resolved Hide resolved

/**
Expand Down Expand Up @@ -430,9 +428,7 @@ class native_jpointerArray {
T* const* begin() const { return data(); }
T* const* end() const { return data() + size(); }

const jlongArray get_jArray() const { return wrapped.get_jArray(); }

jlongArray get_jArray() { return wrapped.get_jArray(); }
jlongArray get_jArray() const { return wrapped.get_jArray(); }

void assert_no_nulls() const
{
Expand Down Expand Up @@ -624,7 +620,7 @@ class native_jstring {
return true;
}

const jstring get_jstring() const { return orig; }
jstring get_jstring() const { return orig; }

~native_jstring()
{
Expand Down Expand Up @@ -753,13 +749,13 @@ class native_jstringArray {
return cache[index];
}

char const** const as_c_array() const
char const** as_c_array() const
{
init_c_cache();
return c_cache.data();
}

const std::vector<std::string> as_cpp_vector() const
std::vector<std::string> as_cpp_vector() const
{
init_cpp_cache();
return cpp_cache;
Expand Down
Loading