summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:18:09 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:29 +0100
commit6794c2e44ede0da2772883fa53a7c935a2bae586 (patch)
tree1da4ae7cca654abc5e29df8d5ea3dff6a6dd1a32
parent22980bea48da60918354463d78dd53938f764725 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I89aa17e66c502e81089f42578b45097f44de4ea9
-rw-r--r--javaunohelper/source/bootstrap.cxx16
-rw-r--r--javaunohelper/source/javaunohelper.cxx16
-rw-r--r--javaunohelper/source/preload.cxx10
3 files changed, 21 insertions, 21 deletions
diff --git a/javaunohelper/source/bootstrap.cxx b/javaunohelper/source/bootstrap.cxx
index 81d6a35909b3..ac3b59603604 100644
--- a/javaunohelper/source/bootstrap.cxx
+++ b/javaunohelper/source/bootstrap.cxx
@@ -70,7 +70,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
{
try
{
- if (0 != jpairs)
+ if (nullptr != jpairs)
{
jsize nPos = 0, len = jni_env->GetArrayLength( jpairs );
while (nPos < len)
@@ -82,7 +82,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
jni_env->ExceptionClear();
throw RuntimeException( "index out of bounds?!" );
}
- if (0 != jstr)
+ if (nullptr != jstr)
{
OUString name( ::javaunohelper::jstring_to_oustring( jstr, jni_env ) );
// value
@@ -92,7 +92,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
jni_env->ExceptionClear();
throw RuntimeException( "index out of bounds?!" );
}
- if (0 != jstr)
+ if (nullptr != jstr)
{
OUString value( ::javaunohelper::jstring_to_oustring( jstr, jni_env ) );
@@ -106,7 +106,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
// bootstrap uno
Reference< XComponentContext > xContext;
- if (0 == juno_rc)
+ if (nullptr == juno_rc)
{
xContext = ::cppu::defaultBootstrap_InitialComponentContext();
}
@@ -126,7 +126,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
OUString cpp_env_name = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
OUString java_env_name = UNO_LB_JAVA;
Environment java_env, cpp_env;
- uno_getEnvironment(reinterpret_cast<uno_Environment **>(&cpp_env), cpp_env_name.pData, NULL);
+ uno_getEnvironment(reinterpret_cast<uno_Environment **>(&cpp_env), cpp_env_name.pData, nullptr);
uno_getEnvironment(reinterpret_cast<uno_Environment **>(&java_env), java_env_name.pData, vm_access.get() );
// map to java
@@ -148,7 +148,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
catch (const RuntimeException & exc)
{
jclass c = jni_env->FindClass( "com/sun/star/uno/RuntimeException" );
- if (0 != c)
+ if (nullptr != c)
{
OString cstr( OUStringToOString(
exc.Message, RTL_TEXTENCODING_JAVA_UTF8 ) );
@@ -159,7 +159,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
catch (const Exception & exc)
{
jclass c = jni_env->FindClass( "com/sun/star/uno/Exception" );
- if (0 != c)
+ if (nullptr != c)
{
OString cstr( OUStringToOString(
exc.Message, RTL_TEXTENCODING_JAVA_UTF8 ) );
@@ -168,7 +168,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
}
}
- return 0;
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/javaunohelper/source/javaunohelper.cxx b/javaunohelper/source/javaunohelper.cxx
index 4fd51a28e17e..d4a9722b382f 100644
--- a/javaunohelper/source/javaunohelper.cxx
+++ b/javaunohelper/source/javaunohelper.cxx
@@ -55,7 +55,7 @@ jboolean Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
{
bool bRet = false;
- const jchar* pJLibName = pJEnv->GetStringChars(jLibName, NULL);
+ const jchar* pJLibName = pJEnv->GetStringChars(jLibName, nullptr);
OUString aLibName(pJLibName);
pJEnv->ReleaseStringChars(jLibName, pJLibName);
@@ -77,13 +77,13 @@ jboolean Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
{
Environment java_env, loader_env;
- const sal_Char * pEnvTypeName = 0;
+ const sal_Char * pEnvTypeName = nullptr;
(*reinterpret_cast<component_getImplementationEnvironmentFunc>(pSym))(
&pEnvTypeName, reinterpret_cast<uno_Environment **>(&loader_env) );
if (! loader_env.is())
{
OUString aEnvTypeName( OUString::createFromAscii( pEnvTypeName ) );
- uno_getEnvironment( reinterpret_cast<uno_Environment **>(&loader_env), aEnvTypeName.pData, 0 );
+ uno_getEnvironment( reinterpret_cast<uno_Environment **>(&loader_env), aEnvTypeName.pData, nullptr );
}
// create vm access
@@ -138,7 +138,7 @@ jobject Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
JNIEnv * pJEnv, SAL_UNUSED_PARAMETER jclass, jstring jLibName, jstring jImplName,
jobject jSMgr, jobject jRegKey, jobject loader )
{
- const jchar* pJLibName = pJEnv->GetStringChars(jLibName, NULL);
+ const jchar* pJLibName = pJEnv->GetStringChars(jLibName, nullptr);
OUString aLibName(pJLibName);
pJEnv->ReleaseStringChars(jLibName, pJLibName);
@@ -153,7 +153,7 @@ jobject Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
aLibName += SAL_DLLEXTENSION;
- jobject joSLL_cpp = 0;
+ jobject joSLL_cpp = nullptr;
#ifndef DISABLE_DYNLOADING
osl::Module lib(aLibName, SAL_LOADMODULE_LAZY | SAL_LOADMODULE_GLOBAL);
@@ -167,14 +167,14 @@ jobject Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
{
Environment java_env, loader_env;
- const sal_Char * pEnvTypeName = 0;
+ const sal_Char * pEnvTypeName = nullptr;
(*reinterpret_cast<component_getImplementationEnvironmentFunc>(pSym))(
&pEnvTypeName, reinterpret_cast<uno_Environment **>(&loader_env) );
if (! loader_env.is())
{
OUString aEnvTypeName( OUString::createFromAscii( pEnvTypeName ) );
- uno_getEnvironment( reinterpret_cast<uno_Environment **>(&loader_env), aEnvTypeName.pData, 0 );
+ uno_getEnvironment( reinterpret_cast<uno_Environment **>(&loader_env), aEnvTypeName.pData, nullptr );
}
// create vm access
@@ -201,7 +201,7 @@ jobject Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
java2dest.mapInterface(
jRegKey, cppu::UnoType<registry::XRegistryKey>::get());
- const char* pImplName = pJEnv->GetStringUTFChars( jImplName, NULL );
+ const char* pImplName = pJEnv->GetStringUTFChars( jImplName, nullptr );
void * pSSF = (*reinterpret_cast<component_getFactoryFunc>(pSym))(
pImplName, pSMgr, pKey );
diff --git a/javaunohelper/source/preload.cxx b/javaunohelper/source/preload.cxx
index 3858d8f9ce0a..ac05c394a964 100644
--- a/javaunohelper/source/preload.cxx
+++ b/javaunohelper/source/preload.cxx
@@ -72,9 +72,9 @@ static bool inited_juhx( JNIEnv * jni_env )
s_bootstrap =
reinterpret_cast<javaunohelper::detail::Func_bootstrap *>(aModule.getFunctionSymbol(symbol));
- if (0 == s_writeInfo ||
- 0 == s_getFactory ||
- 0 == s_bootstrap)
+ if (nullptr == s_writeInfo ||
+ nullptr == s_getFactory ||
+ nullptr == s_bootstrap)
{
jclass c = jni_env->FindClass( "java/lang/RuntimeException" );
jni_env->ThrowNew(
@@ -107,7 +107,7 @@ Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
if (inited_juhx( pJEnv ))
return (*s_getFactory)(
pJEnv, jClass, jLibName, jImplName, jSMgr, jRegKey, loader );
- return 0;
+ return nullptr;
}
SAL_DLLPUBLIC_EXPORT jobject JNICALL
@@ -117,7 +117,7 @@ Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
{
if (inited_juhx( jni_env ))
return (*s_bootstrap)( jni_env, jClass, juno_rc, jpairs, loader );
- return 0;
+ return nullptr;
}
}