From e431d2b869d7ef71de51ce352671a6f2aba31e2a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 20 Oct 2020 05:46:28 +0200 Subject: Use -Wshadow: Shadowing (or local scope override) often causing sloppy bugs, avoid. --- include/jau/function_def.hpp | 8 ++++---- include/jau/jni/helper_jni.hpp | 4 ++-- include/jau/jni/jni_mem.hpp | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'include/jau') diff --git a/include/jau/function_def.hpp b/include/jau/function_def.hpp index d5242af..d1184c3 100644 --- a/include/jau/function_def.hpp +++ b/include/jau/function_def.hpp @@ -221,13 +221,13 @@ namespace jau { public: /** Utilizes copy-ctor from 'const I& _data' */ - CaptureInvocationFunc(const I& _data, R(*_function)(I&, A...), bool dataIsIdentity) noexcept - : data(_data), function(_function), dataIsIdentity(dataIsIdentity) { + CaptureInvocationFunc(const I& _data, R(*_function)(I&, A...), bool dataIsIdentity_) noexcept + : data(_data), function(_function), dataIsIdentity(dataIsIdentity_) { } /** Utilizes move-ctor from moved 'I&& _data' */ - CaptureInvocationFunc(I&& _data, R(*_function)(I&, A...), bool dataIsIdentity) noexcept - : data(std::move(_data)), function(_function), dataIsIdentity(dataIsIdentity) { + CaptureInvocationFunc(I&& _data, R(*_function)(I&, A...), bool dataIsIdentity_) noexcept + : data(std::move(_data)), function(_function), dataIsIdentity(dataIsIdentity_) { } int getType() const noexcept override { return 3; } diff --git a/include/jau/jni/helper_jni.hpp b/include/jau/jni/helper_jni.hpp index 582f355..c8a7393 100644 --- a/include/jau/jni/helper_jni.hpp +++ b/include/jau/jni/helper_jni.hpp @@ -159,8 +159,8 @@ namespace jau { } return true; } - JavaGlobalObj(jobject obj, jmethodID mNotifyDeleted) noexcept - : javaObjectRef(obj), mNotifyDeleted(mNotifyDeleted) { } + JavaGlobalObj(jobject obj, jmethodID mNotifyDeleted_) noexcept + : javaObjectRef(obj), mNotifyDeleted(mNotifyDeleted_) { } JavaGlobalObj(const JavaGlobalObj &o) noexcept = default; JavaGlobalObj(JavaGlobalObj &&o) noexcept = default; diff --git a/include/jau/jni/jni_mem.hpp b/include/jau/jni/jni_mem.hpp index 1bf2f7c..12ee82e 100644 --- a/include/jau/jni/jni_mem.hpp +++ b/include/jau/jni/jni_mem.hpp @@ -144,7 +144,7 @@ private: jboolean isCopy = false; public: - JNICriticalArray(JNIEnv *env) : env(env) {} + JNICriticalArray(JNIEnv *env_val) : env(env_val) {} JNICriticalArray(const JNICriticalArray &o) = delete; JNICriticalArray(JNICriticalArray &&o) = delete; @@ -174,16 +174,16 @@ public: /** * Acquired the primitive array. */ - T* get(U jarray, Mode mode=UPDATE_AND_RELEASE) { - if( nullptr == jarray ) { + T* get(U jarray_val, Mode mode_val=UPDATE_AND_RELEASE) { + if( nullptr == jarray_val ) { return nullptr; } - T* narray = static_cast( env->GetPrimitiveArrayCritical(jarray, &isCopy) ); - if( nullptr != narray ) { - this->mode = mode; - this->jarray = jarray; - this->narray = narray; - return narray; + T* _narray = static_cast( env->GetPrimitiveArrayCritical(jarray_val, &isCopy) ); + if( nullptr != _narray ) { + this->mode = mode_val; + this->jarray = jarray_val; + this->narray = _narray; + return _narray; } return nullptr; } -- cgit v1.2.3