summaryrefslogtreecommitdiff
path: root/libs/samba/src/main/cpp
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2024-09-25 21:13:18 +0200
committerJoel Klinghed <the_jk@spawned.biz>2024-09-25 21:13:18 +0200
commit750e8a772ca54599a4a7859f059d656d828e4b78 (patch)
tree7396534bcd09f89c2cf919234007aecd687eb910 /libs/samba/src/main/cpp
parent574f4a278982dadf87fafb50038c5150b958b219 (diff)
samba: Follow clang-tidy suggestions
Diffstat (limited to 'libs/samba/src/main/cpp')
-rw-r--r--libs/samba/src/main/cpp/jni.hpp6
-rw-r--r--libs/samba/src/main/cpp/samba.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/libs/samba/src/main/cpp/jni.hpp b/libs/samba/src/main/cpp/jni.hpp
index b9bdb69..aa79bbe 100644
--- a/libs/samba/src/main/cpp/jni.hpp
+++ b/libs/samba/src/main/cpp/jni.hpp
@@ -48,7 +48,7 @@ class Ref {
virtual T release_to_local() = 0;
virtual void del() = 0;
- JNIEnv* env_;
+ JNIEnv* env_{nullptr};
T ptr_;
};
@@ -134,14 +134,14 @@ class GlobalRef : public Ref<T> {
free();
if (other) {
auto* env = AttachCurrentThread();
- this->ptr_ = other ? static_cast<T>(env->NewGlobalRef(static_cast<jobject>(other.get()))) : nullptr;
+ this->ptr_ = static_cast<T>(env->NewGlobalRef(static_cast<jobject>(other.get())));
} else {
this->ptr_ = nullptr;
}
return *this;
}
- GlobalRef& operator=(GlobalRef<T>&& other) {
+ GlobalRef& operator=(GlobalRef<T>&& other) noexcept {
free();
this->ptr_ = other.ptr_;
other.ptr_ = nullptr;
diff --git a/libs/samba/src/main/cpp/samba.cpp b/libs/samba/src/main/cpp/samba.cpp
index 302fb3a..ed73d62 100644
--- a/libs/samba/src/main/cpp/samba.cpp
+++ b/libs/samba/src/main/cpp/samba.cpp
@@ -406,7 +406,7 @@ void RegisterSamba(JNIEnv* env) {
}
void UnregisterSamba() {
- g_CreateDirEntry = 0;
+ g_CreateDirEntry = nullptr;
g_NativeSambaClass.reset();
g_DirEntryClass.reset();
}