diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-02 14:52:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 14:52:36 +0200 |
commit | 058a0afdeca83145d58a95c426dd01216c397ea9 (patch) | |
tree | be0cd59e5a90926e9d653fed9f3b1b77e735ca2f /platform/android/thread_jandroid.cpp | |
parent | 5f11e1557156617366d2c316a97716172103980d (diff) | |
parent | 95a1400a2ac9de1a29fa305f45b928ce8e3044bd (diff) |
Merge pull request #37338 from lupoDharkael/nullprt
Replace NULL with nullptr
Diffstat (limited to 'platform/android/thread_jandroid.cpp')
-rw-r--r-- | platform/android/thread_jandroid.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/platform/android/thread_jandroid.cpp b/platform/android/thread_jandroid.cpp index 98b61ad755..729327f6f0 100644 --- a/platform/android/thread_jandroid.cpp +++ b/platform/android/thread_jandroid.cpp @@ -66,7 +66,7 @@ void *ThreadAndroid::thread_callback(void *userdata) { pthread_setspecific(thread_id_key, (void *)memnew(ID(t->id))); t->callback(t->user); ScriptServer::thread_exit(); - return NULL; + return nullptr; } Thread *ThreadAndroid::create_func_jandroid(ThreadCreateCallback p_callback, void *p_user, const Settings &) { @@ -100,7 +100,7 @@ void ThreadAndroid::wait_to_finish_func_jandroid(Thread *p_thread) { ERR_FAIL_COND(!tp); ERR_FAIL_COND(tp->pthread == 0); - pthread_join(tp->pthread, NULL); + pthread_join(tp->pthread, nullptr); tp->pthread = 0; } @@ -108,21 +108,21 @@ void ThreadAndroid::_thread_destroyed(void *value) { /* The thread is being destroyed, detach it from the Java VM and set the mThreadKey value to NULL as required */ JNIEnv *env = (JNIEnv *)value; - if (env != NULL) { + if (env != nullptr) { java_vm->DetachCurrentThread(); - pthread_setspecific(jvm_key, NULL); + pthread_setspecific(jvm_key, nullptr); } } pthread_key_t ThreadAndroid::jvm_key; -JavaVM *ThreadAndroid::java_vm = NULL; +JavaVM *ThreadAndroid::java_vm = nullptr; void ThreadAndroid::setup_thread() { if (pthread_getspecific(jvm_key)) return; //already setup JNIEnv *env; - java_vm->AttachCurrentThread(&env, NULL); + java_vm->AttachCurrentThread(&env, nullptr); pthread_setspecific(jvm_key, (void *)env); } @@ -142,8 +142,8 @@ JNIEnv *ThreadAndroid::get_env() { setup_thread(); } - JNIEnv *env = NULL; - java_vm->AttachCurrentThread(&env, NULL); + JNIEnv *env = nullptr; + java_vm->AttachCurrentThread(&env, nullptr); return env; } |