From 750e8a772ca54599a4a7859f059d656d828e4b78 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 25 Sep 2024 21:13:18 +0200 Subject: samba: Follow clang-tidy suggestions --- libs/samba/src/main/cpp/jni.hpp | 6 +++--- libs/samba/src/main/cpp/samba.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/samba/src/main/cpp') 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 { free(); if (other) { auto* env = AttachCurrentThread(); - this->ptr_ = other ? static_cast(env->NewGlobalRef(static_cast(other.get()))) : nullptr; + this->ptr_ = static_cast(env->NewGlobalRef(static_cast(other.get()))); } else { this->ptr_ = nullptr; } return *this; } - GlobalRef& operator=(GlobalRef&& other) { + GlobalRef& operator=(GlobalRef&& 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(); } -- cgit v1.2.3-70-g09d2