More loplugin:simplifybool

Change-Id: I51e7a11149676a8b5396d9eb993a509859cdf725
This commit is contained in:
Stephan Bergmann 2015-04-27 15:28:09 +02:00
parent d3273a06eb
commit 3daf0c7e77
8 changed files with 17 additions and 18 deletions

View File

@ -76,7 +76,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if (pInfo == NULL)
{
if (false == findAndSelect(&pInfo))
if (!findAndSelect(&pInfo))
return -1;
}
else

View File

@ -281,7 +281,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
break;
}
}
if (bLdPath == false)
if (!bLdPath)
return false;
return true;

View File

@ -94,7 +94,7 @@ bool SunVersion::init(const char *szVersion)
(nPart < 2 && *pCur == '.') )
&& (
//prevent 1.4.0. 1.4.0-
pCur + 1 == pEnd ? isdigit(*(pCur)) : true) )
pCur + 1 != pEnd || isdigit(*(pCur))) )
{
int len = pCur - pLast;
if (len >= 127)

View File

@ -976,11 +976,11 @@ rtl::Reference<VendorBase> getJREInfoByPath(
}
bool bProcessRun= false;
if (getJavaProps(sFilePath,
if (!getJavaProps(sFilePath,
#ifdef JVM_ONE_PATH_CHECK
sResolvedDir,
#endif
props, & bProcessRun) == false)
props, & bProcessRun))
{
//The java executable could not be run or the system properties
//could not be retrieved. We can assume that this java is corrupt.
@ -991,7 +991,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
//in jdk/jre/bin. We do not search any further, because we assume that if one java
//does not work then the other does not work as well. This saves us to run java
//again which is quite costly.
if (bProcessRun == true)
if (bProcessRun)
{
// 1.3.1 special treatment: jdk/bin/java and /jdk/jre/bin/java are links to
//a script, named .java_wrapper. The script starts jdk/bin/sparc/native_threads/java
@ -1084,7 +1084,7 @@ Reference<VendorBase> createInstance(createInstance_func pFunc,
Reference<VendorBase> aBase = (*pFunc)();
if (aBase.is())
{
if (aBase->initialize(properties) == false)
if (!aBase->initialize(properties))
aBase = 0;
}
return aBase;

View File

@ -173,7 +173,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
break;
}
}
if (bLdPath == false)
if (!bLdPath)
return false;
return true;

View File

@ -777,7 +777,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
bNil = false;
else
throw FrameworkException(JFW_E_ERROR, sExcMsg);
if (bNil == true)
if (bNil)
return;
//Get javaInfo@manuallySelected attribute
@ -890,7 +890,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc,
//javaInfo@autoSelect
xmlSetProp(pJavaInfoNode, reinterpret_cast<xmlChar const *>("autoSelect"),
reinterpret_cast<xmlChar const *>(bAutoSelect == true ? "true" : "false"));
reinterpret_cast<xmlChar const *>(bAutoSelect ? "true" : "false"));
//Set xsi:nil in javaInfo element to false
//the xmlNs pointer must not be destroyed
@ -977,7 +977,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc,
JavaInfo * CNodeJavaInfo::makeJavaInfo() const
{
if (bNil == true || m_bEmptyNode == true)
if (bNil || m_bEmptyNode)
return NULL;
JavaInfo * pInfo = static_cast<JavaInfo*>(rtl_allocateMemory(sizeof(JavaInfo)));
if (pInfo == NULL)

View File

@ -276,8 +276,7 @@ javaFrameworkError SAL_CALL jfw_startVM(
//Check if the selected Java was set in this process. If so it
//must not have the requirments flag JFW_REQUIRE_NEEDRESTART
if ((aInfo->nRequirements & JFW_REQUIRE_NEEDRESTART)
&&
(jfw::wasJavaSelectedInSameProcess() == true))
&& jfw::wasJavaSelectedInSameProcess())
return JFW_E_NEED_RESTART;
vmParams = settings.getVmParametersUtf8();
@ -533,7 +532,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
jfw_freeJavaInfo(arInfos[j]);
rtl_freeMemory(arInfos);
if (bInfoFound == true)
if (bInfoFound)
break;
//All Java installations found by the current plug-in lib
//do not provide the required features. Try the next plug-in
@ -591,7 +590,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
}
}
}//end iterate over paths
if (bInfoFound == true)
if (bInfoFound)
break;
}// end iterate plug-ins
}
@ -837,7 +836,7 @@ javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled)
if (jfw::getMode() == jfw::JFW_MODE_DIRECT)
return JFW_E_DIRECT_MODE;
if (g_bEnabledSwitchedOn == false && bEnabled == sal_True)
if (!g_bEnabledSwitchedOn && bEnabled == sal_True)
{
//When the process started then Enabled was false.
//This is first time enabled is set to true.

View File

@ -418,7 +418,7 @@ JFW_MODE getMode()
static bool g_bMode = false;
static JFW_MODE g_mode = JFW_MODE_APPLICATION;
if (g_bMode == false)
if (!g_bMode)
{
//check if either of the "direct mode" bootstrap variables is set
bool bDirectMode = true;
@ -555,7 +555,7 @@ void setJavaSelected()
bool wasJavaSelectedInSameProcess()
{
//g_setJavaProcId not set means no Java selected
if (g_bJavaSet == true)
if (g_bJavaSet)
return true;
return false;
}