diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:18:14 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:29 +0100 |
commit | 81da71b64098e3f0d5ebe61d0c94c73e316c21b3 (patch) | |
tree | 29ceb2cac30ccdcf57bdabd9627e9ad85e5e0b00 /jvmaccess/source/virtualmachine.cxx | |
parent | 6794c2e44ede0da2772883fa53a7c935a2bae586 (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I226aeb4787a4c30e17fb54dc7775a288aa09b760
Diffstat (limited to 'jvmaccess/source/virtualmachine.cxx')
-rw-r--r-- | jvmaccess/source/virtualmachine.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/jvmaccess/source/virtualmachine.cxx b/jvmaccess/source/virtualmachine.cxx index 3ff5dc7aaaf2..fb548adf2ce7 100644 --- a/jvmaccess/source/virtualmachine.cxx +++ b/jvmaccess/source/virtualmachine.cxx @@ -49,7 +49,7 @@ VirtualMachine::AttachGuard::AttachGuard( { assert(m_xMachine.is()); m_pEnvironment = m_xMachine->attachThread(&m_bDetach); - if (m_pEnvironment == 0) + if (m_pEnvironment == nullptr) throw CreationException(); } @@ -64,7 +64,7 @@ VirtualMachine::VirtualMachine(JavaVM * pVm, int nVersion, bool bDestroy, m_pVm(pVm), m_nVersion(nVersion), m_bDestroy(bDestroy) { (void) pMainThreadEnv; // avoid warnings - assert(pVm != 0); + assert(pVm != nullptr); assert(nVersion >= JNI_VERSION_1_2); assert(pMainThreadEnv); } @@ -86,12 +86,12 @@ VirtualMachine::~VirtualMachine() JNIEnv * VirtualMachine::attachThread(bool * pAttached) const { - assert(pAttached != 0 && "bad parameter"); + assert(pAttached != nullptr && "bad parameter"); JNIEnv * pEnv; jint n = m_pVm->GetEnv(reinterpret_cast< void ** >(&pEnv), m_nVersion); SAL_WARN_IF( n != JNI_OK && n != JNI_EDETACHED, "jvmaccess", "JNI: GetEnv failed"); - if (pEnv == 0) + if (pEnv == nullptr) { if (m_pVm->AttachCurrentThread ( @@ -102,9 +102,9 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const // JNIEnv** and not void ** &pEnv, #endif - 0) + nullptr) != JNI_OK) - return 0; + return nullptr; *pAttached = true; } else |