mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Removing explicit comparisons to PR_TRUE and PR_FALSE b=228448 p=gautheri@noos.fr r=me sr=mscott
This commit is contained in:
parent
a9c9e9fecd
commit
a3af919e2f
@ -472,7 +472,7 @@ nsresult nsAbDirectoryQuery::matchCard (nsIAbCard* card,
|
||||
rv = matchCardExpression (card, expression, &matchFound);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (matchFound == PR_TRUE)
|
||||
if (matchFound)
|
||||
{
|
||||
(*resultLimit)--;
|
||||
rv = queryMatch (card, arguments, listener);
|
||||
@ -530,14 +530,12 @@ nsresult nsAbDirectoryQuery::matchCardExpression (nsIAbCard* card,
|
||||
else
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
if (operation == nsIAbBooleanOperationTypes::OR &&
|
||||
value == PR_TRUE)
|
||||
if (operation == nsIAbBooleanOperationTypes::OR && value)
|
||||
break;
|
||||
else if (operation == nsIAbBooleanOperationTypes::AND &&
|
||||
value == PR_FALSE)
|
||||
else if (operation == nsIAbBooleanOperationTypes::AND && !value)
|
||||
break;
|
||||
else if (operation == nsIAbBooleanOperationTypes::NOT)
|
||||
value = (value == PR_TRUE) ? PR_FALSE : PR_TRUE;
|
||||
value = !value;
|
||||
}
|
||||
*result = value;
|
||||
|
||||
|
@ -53,7 +53,7 @@ nsAbDirectoryQueryProxy::~nsAbDirectoryQueryProxy()
|
||||
/* void initiate (in nsIAbDirectory directory); */
|
||||
NS_IMETHODIMP nsAbDirectoryQueryProxy::Initiate(nsIAbDirectory *directory)
|
||||
{
|
||||
if (mInitiated == PR_TRUE)
|
||||
if (mInitiated)
|
||||
return NS_OK;
|
||||
|
||||
nsAbDirectoryQuery* _directoryQuery = new nsAbDirectoryQuery (directory);
|
||||
|
@ -148,7 +148,7 @@ nsAbQueryLDAPMessageListener::~nsAbQueryLDAPMessageListener ()
|
||||
|
||||
nsresult nsAbQueryLDAPMessageListener::Initiate ()
|
||||
{
|
||||
if(mInitialized == PR_TRUE)
|
||||
if (mInitialized)
|
||||
return NS_OK;
|
||||
|
||||
mLock = PR_NewLock ();
|
||||
@ -171,7 +171,7 @@ nsresult nsAbQueryLDAPMessageListener::Cancel ()
|
||||
|
||||
nsAutoLock lock(mLock);
|
||||
|
||||
if (mFinished == PR_TRUE || mCanceled == PR_TRUE)
|
||||
if (mFinished || mCanceled)
|
||||
return NS_OK;
|
||||
|
||||
mCanceled = PR_TRUE;
|
||||
@ -196,12 +196,12 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListener::OnLDAPMessage(nsILDAPMessage *aMessa
|
||||
{
|
||||
nsAutoLock lock (mLock);
|
||||
|
||||
if (mFinished == PR_TRUE)
|
||||
if (mFinished)
|
||||
return NS_OK;
|
||||
|
||||
if (messageType == nsILDAPMessage::RES_SEARCH_RESULT)
|
||||
mFinished = PR_TRUE;
|
||||
else if (mCanceled == PR_TRUE)
|
||||
else if (mCanceled)
|
||||
{
|
||||
mFinished = PR_TRUE;
|
||||
cancelOperation = PR_TRUE;
|
||||
@ -210,7 +210,7 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListener::OnLDAPMessage(nsILDAPMessage *aMessa
|
||||
// Leave lock
|
||||
|
||||
nsCOMPtr<nsIAbDirectoryQueryResult> queryResult;
|
||||
if (cancelOperation == PR_FALSE)
|
||||
if (!cancelOperation)
|
||||
{
|
||||
switch (messageType)
|
||||
{
|
||||
@ -376,7 +376,7 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListener::OnLDAPInit(nsILDAPConnection *aConn,
|
||||
NS_ConvertUTF8toUCS2(spec).get(),
|
||||
nsIAuthPrompt::SAVE_PASSWORD_PERMANENTLY, getter_Copies(passwd),
|
||||
&status);
|
||||
if (NS_FAILED(rv) || status == PR_FALSE) {
|
||||
if (NS_FAILED(rv) || !status) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
@ -405,7 +405,7 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListener::OnLDAPInit(nsILDAPConnection *aConn,
|
||||
|
||||
nsresult nsAbQueryLDAPMessageListener::OnLDAPMessageBind (nsILDAPMessage *aMessage)
|
||||
{
|
||||
if (mBound == PR_TRUE)
|
||||
if (mBound)
|
||||
return NS_OK;
|
||||
|
||||
// see whether the bind actually succeeded
|
||||
@ -521,7 +521,7 @@ nsresult nsAbQueryLDAPMessageListener::OnLDAPMessageSearchEntry (nsILDAPMessage
|
||||
&hasSetCardProperty);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (hasSetCardProperty == PR_FALSE)
|
||||
if (!hasSetCardProperty)
|
||||
continue;
|
||||
|
||||
_propertyValue = new nsAbDirectoryQueryPropertyValue(propertyName.get (), card);
|
||||
@ -643,7 +643,7 @@ nsAbLDAPDirectoryQuery::~nsAbLDAPDirectoryQuery()
|
||||
}
|
||||
nsresult nsAbLDAPDirectoryQuery::Initiate ()
|
||||
{
|
||||
if(mInitialized == PR_TRUE)
|
||||
if (mInitialized)
|
||||
return NS_OK;
|
||||
|
||||
mLock = PR_NewLock ();
|
||||
@ -673,7 +673,7 @@ NS_IMETHODIMP nsAbLDAPDirectoryQuery::DoQuery(nsIAbDirectoryQueryArguments* argu
|
||||
PRBool doSubDirectories;
|
||||
rv = arguments->GetQuerySubDirectories (&doSubDirectories);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (doSubDirectories == PR_TRUE)
|
||||
if (doSubDirectories)
|
||||
scope = "sub";
|
||||
else
|
||||
scope = "one";
|
||||
|
@ -64,7 +64,7 @@ nsresult CStringArrayToCharPtrArray::Convert (nsCStringArray& array,
|
||||
for (PRUint32 i = 0; i < size; i++)
|
||||
{
|
||||
|
||||
if (copyElements == PR_TRUE)
|
||||
if (copyElements)
|
||||
(*returnPropertiesArray)[i] = ToNewCString(*array[i]);
|
||||
else
|
||||
(*returnPropertiesArray)[i] = NS_CONST_CAST(char*, (*array[i]).get());
|
||||
@ -117,7 +117,7 @@ nsresult StringArrayToPRUnicharPtrArray::Convert (nsStringArray& array,
|
||||
for (PRUint32 i = 0; i < size; i++)
|
||||
{
|
||||
|
||||
if (copyElements == PR_TRUE)
|
||||
if (copyElements)
|
||||
(*returnPropertiesArray)[i] = ToNewUnicode(*array[i]);
|
||||
else
|
||||
(*returnPropertiesArray)[i] = NS_CONST_CAST(PRUnichar*, (*array[i]).get());
|
||||
|
@ -100,7 +100,7 @@ private:
|
||||
if (!mArray)
|
||||
return;
|
||||
|
||||
if (mFreeElements == PR_TRUE)
|
||||
if (mFreeElements)
|
||||
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mSize, mArray);
|
||||
else
|
||||
{
|
||||
@ -194,7 +194,7 @@ private:
|
||||
if (!mArray)
|
||||
return;
|
||||
|
||||
if (mFreeElements == PR_TRUE)
|
||||
if (mFreeElements)
|
||||
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mSize, mArray);
|
||||
else
|
||||
{
|
||||
|
@ -1602,7 +1602,8 @@ static PRBool dir_AreServersSame (DIR_Server *first, DIR_Server *second, PRBool
|
||||
/* assume for right now one personal address book type where offline is PR_FALSE */
|
||||
if ((first->dirType == PABDirectory) && (second->dirType == PABDirectory))
|
||||
{
|
||||
if ((first->isOffline == PR_FALSE) && (second->isOffline == PR_FALSE)) /* are they both really address books? */
|
||||
/* are they both really address books? */
|
||||
if (!first->isOffline && !second->isOffline)
|
||||
{
|
||||
PR_ASSERT(first->fileName && second->fileName);
|
||||
if (first->fileName && second->fileName)
|
||||
@ -3245,11 +3246,9 @@ nsresult DIR_GetServerPreferences(nsVoidArray** list)
|
||||
/* Don't add servers which are in the old list and don't add a
|
||||
* second personal address book.
|
||||
*/
|
||||
if ( dir_AreServersSame(newServer, oldServer, PR_FALSE)
|
||||
|| ( oldServer->dirType == PABDirectory
|
||||
&& newServer->dirType == PABDirectory
|
||||
&& oldServer->isOffline == PR_FALSE
|
||||
&& newServer->isOffline == PR_FALSE))
|
||||
if (dir_AreServersSame(newServer, oldServer, PR_FALSE) ||
|
||||
(oldServer->dirType == PABDirectory && !oldServer->isOffline &&
|
||||
newServer->dirType == PABDirectory && !newServer->isOffline))
|
||||
{
|
||||
/* Copy any new prefs out of the new server.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user