Bug 517553: Remove '=='/'!=' 'PR_FALSE'/'PR_TRUE'

This commit is contained in:
Jae-Seong Lee-Russo 2010-02-07 10:52:43 -05:00
parent 60bb11b582
commit 082e12c87c
42 changed files with 93 additions and 92 deletions

View file

@ -190,15 +190,15 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
nsContentSink::nsContentSink() nsContentSink::nsContentSink()
{ {
// We have a zeroing operator new // We have a zeroing operator new
NS_ASSERTION(mLayoutStarted == PR_FALSE, "What?"); NS_ASSERTION(!mLayoutStarted, "What?");
NS_ASSERTION(mDynamicLowerValue == PR_FALSE, "What?"); NS_ASSERTION(!mDynamicLowerValue, "What?");
NS_ASSERTION(mParsing == PR_FALSE, "What?"); NS_ASSERTION(!mParsing, "What?");
NS_ASSERTION(mLastSampledUserEventTime == 0, "What?"); NS_ASSERTION(mLastSampledUserEventTime == 0, "What?");
NS_ASSERTION(mDeflectedCount == 0, "What?"); NS_ASSERTION(mDeflectedCount == 0, "What?");
NS_ASSERTION(mDroppedTimer == PR_FALSE, "What?"); NS_ASSERTION(!mDroppedTimer, "What?");
NS_ASSERTION(mInMonolithicContainer == 0, "What?"); NS_ASSERTION(mInMonolithicContainer == 0, "What?");
NS_ASSERTION(mInNotification == 0, "What?"); NS_ASSERTION(mInNotification == 0, "What?");
NS_ASSERTION(mDeferredLayoutStart == PR_FALSE, "What?"); NS_ASSERTION(!mDeferredLayoutStart, "What?");
#ifdef NS_DEBUG #ifdef NS_DEBUG
if (!gContentSinkLogModuleInfo) { if (!gContentSinkLogModuleInfo) {

View file

@ -321,7 +321,7 @@ void nsXMLEventsManager::AddListeners(nsIDocument* aDocument)
for (int i = 0; i < mIncomplete.Count(); ++i) { for (int i = 0; i < mIncomplete.Count(); ++i) {
cur = mIncomplete[i]; cur = mIncomplete[i];
//If this succeeds, the object will be removed from mIncomplete //If this succeeds, the object will be removed from mIncomplete
if (nsXMLEventsListener::InitXMLEventsListener(aDocument, this, cur) == PR_TRUE) if (nsXMLEventsListener::InitXMLEventsListener(aDocument, this, cur))
--i; --i;
} }
} }

View file

@ -868,7 +868,7 @@ nsSMILAnimationFunction::GetAccumulate() const
if (!value) if (!value)
return PR_FALSE; return PR_FALSE;
return (value->GetEnumValue() == PR_TRUE); return value->GetEnumValue();
} }
PRBool PRBool
@ -878,7 +878,7 @@ nsSMILAnimationFunction::GetAdditive() const
if (!value) if (!value)
return PR_FALSE; return PR_FALSE;
return (value->GetEnumValue() == PR_TRUE); return value->GetEnumValue();
} }
nsSMILAnimationFunction::nsSMILCalcMode nsSMILAnimationFunction::nsSMILCalcMode

View file

@ -96,7 +96,7 @@ nsXULTemplateResultSetStorage::HasMoreElements(PRBool *aResult)
// Because the nsXULTemplateResultSetStorage is owned by many nsXULTemplateResultStorage objects, // Because the nsXULTemplateResultSetStorage is owned by many nsXULTemplateResultStorage objects,
// it could live longer than it needed to get results. // it could live longer than it needed to get results.
// So we destroy the statement to free resources when all results are fetched // So we destroy the statement to free resources when all results are fetched
if (*aResult == PR_FALSE) { if (!*aResult) {
mStatement = nsnull; mStatement = nsnull;
} }
return NS_OK; return NS_OK;

View file

@ -6247,7 +6247,7 @@ nsDocShell::CanSavePresentation(PRUint32 aLoadType,
// then we should not cache the presentation. // then we should not cache the presentation.
PRBool canSaveState; PRBool canSaveState;
mOSHE->GetSaveLayoutStateFlag(&canSaveState); mOSHE->GetSaveLayoutStateFlag(&canSaveState);
if (canSaveState == PR_FALSE) if (!canSaveState)
return PR_FALSE; return PR_FALSE;
// If the document is not done loading, don't cache it. // If the document is not done loading, don't cache it.
@ -9516,7 +9516,7 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, nsIChannel * aChannel,
} }
} }
if (expired == PR_TRUE) if (expired)
entry->SetExpirationStatus(PR_TRUE); entry->SetExpirationStatus(PR_TRUE);

View file

@ -366,7 +366,7 @@ nsresult nsGeolocationService::Init()
GeoEnabledChangedCallback("geo.enabled", nsnull); GeoEnabledChangedCallback("geo.enabled", nsnull);
if (sGeoEnabled == PR_FALSE) if (!sGeoEnabled)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsCOMPtr<nsIGeolocationProvider> provider = do_GetService(NS_GEOLOCATION_PROVIDER_CONTRACTID); nsCOMPtr<nsIGeolocationProvider> provider = do_GetService(NS_GEOLOCATION_PROVIDER_CONTRACTID);
@ -580,7 +580,7 @@ nsGeolocationService::HasGeolocationProvider()
nsresult nsresult
nsGeolocationService::StartDevice() nsGeolocationService::StartDevice()
{ {
if (sGeoEnabled == PR_FALSE) if (!sGeoEnabled)
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
if (!HasGeolocationProvider()) if (!HasGeolocationProvider())
@ -830,7 +830,7 @@ nsGeolocation::GetCurrentPosition(nsIDOMGeoPositionCallback *callback,
{ {
NS_ENSURE_ARG_POINTER(callback); NS_ENSURE_ARG_POINTER(callback);
if (sGeoEnabled == PR_FALSE) if (!sGeoEnabled)
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
if (mPendingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW) if (mPendingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW)
@ -874,7 +874,7 @@ nsGeolocation::WatchPosition(nsIDOMGeoPositionCallback *callback,
NS_ENSURE_ARG_POINTER(callback); NS_ENSURE_ARG_POINTER(callback);
if (sGeoEnabled == PR_FALSE) if (!sGeoEnabled)
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
if (mPendingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW) if (mPendingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW)

View file

@ -71,7 +71,7 @@ NS_IMETHODIMP nsDebugDetector::Init(nsICharsetDetectionObserver* aObserver)
NS_IMETHODIMP nsDebugDetector::DoIt(const char* aBytesArray, PRUint32 aLen, PRBool* oDontFeedMe) NS_IMETHODIMP nsDebugDetector::DoIt(const char* aBytesArray, PRUint32 aLen, PRBool* oDontFeedMe)
{ {
NS_ASSERTION(mObserver != nsnull , "have not init yet"); NS_ASSERTION(mObserver != nsnull , "have not init yet");
NS_ASSERTION(mStop == PR_FALSE , "don't call DoIt if we return PR_TRUE in oDontFeedMe"); NS_ASSERTION(!mStop , "don't call DoIt if we return PR_TRUE in oDontFeedMe");
if((nsnull == aBytesArray) || (nsnull == oDontFeedMe)) if((nsnull == aBytesArray) || (nsnull == oDontFeedMe))
return NS_ERROR_ILLEGAL_VALUE; return NS_ERROR_ILLEGAL_VALUE;

View file

@ -402,7 +402,7 @@ NS_IMETHODIMP nsMetaCharsetObserver::Start()
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
if (bMetaCharsetObserverStarted == PR_FALSE) { if (!bMetaCharsetObserverStarted) {
bMetaCharsetObserverStarted = PR_TRUE; bMetaCharsetObserverStarted = PR_TRUE;
nsCOMPtr<nsIParserService> parserService(do_GetService(NS_PARSERSERVICE_CONTRACTID, &rv)); nsCOMPtr<nsIParserService> parserService(do_GetService(NS_PARSERSERVICE_CONTRACTID, &rv));
@ -421,7 +421,7 @@ NS_IMETHODIMP nsMetaCharsetObserver::Start()
NS_IMETHODIMP nsMetaCharsetObserver::End() NS_IMETHODIMP nsMetaCharsetObserver::End()
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
if (bMetaCharsetObserverStarted == PR_TRUE) { if (bMetaCharsetObserverStarted) {
bMetaCharsetObserverStarted = PR_FALSE; bMetaCharsetObserverStarted = PR_FALSE;
nsCOMPtr<nsIParserService> parserService(do_GetService(NS_PARSERSERVICE_CONTRACTID, &rv)); nsCOMPtr<nsIParserService> parserService(do_GetService(NS_PARSERSERVICE_CONTRACTID, &rv));

View file

@ -68,7 +68,7 @@ nsXMLEncodingObserver::nsXMLEncodingObserver()
nsXMLEncodingObserver::~nsXMLEncodingObserver() nsXMLEncodingObserver::~nsXMLEncodingObserver()
{ {
// call to end the ObserverService // call to end the ObserverService
if (bXMLEncodingObserverStarted == PR_TRUE) { if (bXMLEncodingObserverStarted) {
End(); End();
} }
} }
@ -200,7 +200,7 @@ NS_IMETHODIMP nsXMLEncodingObserver::Start()
{ {
nsresult res = NS_OK; nsresult res = NS_OK;
if (bXMLEncodingObserverStarted == PR_TRUE) if (bXMLEncodingObserverStarted)
return res; return res;
nsCOMPtr<nsIObserverService> anObserverService = do_GetService("@mozilla.org/observer-service;1", &res); nsCOMPtr<nsIObserverService> anObserverService = do_GetService("@mozilla.org/observer-service;1", &res);
@ -218,7 +218,7 @@ NS_IMETHODIMP nsXMLEncodingObserver::End()
{ {
nsresult res = NS_OK; nsresult res = NS_OK;
if (bXMLEncodingObserverStarted == PR_FALSE) if (!bXMLEncodingObserverStarted)
return res; return res;
nsCOMPtr<nsIObserverService> anObserverService = do_GetService("@mozilla.org/observer-service;1", &res); nsCOMPtr<nsIObserverService> anObserverService = do_GetService("@mozilla.org/observer-service;1", &res);

View file

@ -205,7 +205,7 @@ xpctools_InterpreterHook(JSContext *cx, JSStackFrame *fp, JSBool before,
ProfilerFunction* fun; ProfilerFunction* fun;
if (self->mScriptTable.Get(script, &fun)) if (self->mScriptTable.Get(script, &fun))
{ {
if(before == PR_TRUE) if(before)
{ {
fun->IncrementCallCount(); fun->IncrementCallCount();
fun->SetStartTime(); fun->SetStartTime();

View file

@ -844,7 +844,7 @@ nsPresContext::UpdateAfterPreferencesChanged()
nsresult nsresult
nsPresContext::Init(nsIDeviceContext* aDeviceContext) nsPresContext::Init(nsIDeviceContext* aDeviceContext)
{ {
NS_ASSERTION(!(mInitialized == PR_TRUE), "attempt to reinit pres context"); NS_ASSERTION(!mInitialized, "attempt to reinit pres context");
NS_ENSURE_ARG(aDeviceContext); NS_ENSURE_ARG(aDeviceContext);
mDeviceContext = aDeviceContext; mDeviceContext = aDeviceContext;
@ -1257,7 +1257,7 @@ nsPresContext::SetFullZoom(float aZoom)
mDeviceContext->FlushFontCache(); mDeviceContext->FlushFontCache();
} }
NS_ASSERTION(mSupressResizeReflow == PR_FALSE, "two zooms happening at the same time? impossible!"); NS_ASSERTION(!mSupressResizeReflow, "two zooms happening at the same time? impossible!");
mSupressResizeReflow = PR_TRUE; mSupressResizeReflow = PR_TRUE;
mFullZoom = aZoom; mFullZoom = aZoom;

View file

@ -1453,7 +1453,7 @@ nsListControlFrame::DoneAddingChildren(PRBool aIsDone)
// Here we check to see if all the frames have been created // Here we check to see if all the frames have been created
// for all the content. // for all the content.
// If so, then we can initialize; // If so, then we can initialize;
if (mIsAllFramesHere == PR_FALSE) { if (!mIsAllFramesHere) {
// if all the frames are now present we can initialize // if all the frames are now present we can initialize
if (CheckIfAllFramesHere()) { if (CheckIfAllFramesHere()) {
mHasBeenInitialized = PR_TRUE; mHasBeenInitialized = PR_TRUE;

View file

@ -221,7 +221,7 @@ void Area::ParseCoords(const nsAString& aSpec)
{ {
if (*tptr == ',') if (*tptr == ',')
{ {
if (has_comma == PR_FALSE) if (!has_comma)
{ {
has_comma = PR_TRUE; has_comma = PR_TRUE;
} }
@ -235,7 +235,7 @@ void Area::ParseCoords(const nsAString& aSpec)
/* /*
* If this was trailing whitespace we skipped, we are done. * If this was trailing whitespace we skipped, we are done.
*/ */
if ((*tptr == '\0')&&(has_comma == PR_FALSE)) if ((*tptr == '\0') && !has_comma)
{ {
break; break;
} }
@ -243,7 +243,7 @@ void Area::ParseCoords(const nsAString& aSpec)
* Else if the separator is all whitespace, and this is not the * Else if the separator is all whitespace, and this is not the
* end of the string, add a comma to the separator. * end of the string, add a comma to the separator.
*/ */
else if (has_comma == PR_FALSE) else if (!has_comma)
{ {
*n_str = ','; *n_str = ',';
} }

View file

@ -1358,7 +1358,7 @@ CSSParserImpl::GetURLInParens(nsString& aURL)
void void
CSSParserImpl::UngetToken() CSSParserImpl::UngetToken()
{ {
NS_PRECONDITION(mHavePushBack == PR_FALSE, "double pushback"); NS_PRECONDITION(!mHavePushBack, "double pushback");
mHavePushBack = PR_TRUE; mHavePushBack = PR_TRUE;
} }

View file

@ -99,7 +99,7 @@ public:
public: public:
AutoClipPathReferencer(nsSVGClipPathFrame *aFrame) AutoClipPathReferencer(nsSVGClipPathFrame *aFrame)
: mFrame(aFrame) { : mFrame(aFrame) {
NS_ASSERTION(mFrame->mInUse == PR_FALSE, "reference loop!"); NS_ASSERTION(!mFrame->mInUse, "reference loop!");
mFrame->mInUse = PR_TRUE; mFrame->mInUse = PR_TRUE;
} }
~AutoClipPathReferencer() { ~AutoClipPathReferencer() {

View file

@ -94,7 +94,7 @@ private:
public: public:
AutoMaskReferencer(nsSVGMaskFrame *aFrame) AutoMaskReferencer(nsSVGMaskFrame *aFrame)
: mFrame(aFrame) { : mFrame(aFrame) {
NS_ASSERTION(mFrame->mInUse == PR_FALSE, "reference loop!"); NS_ASSERTION(!mFrame->mInUse, "reference loop!");
mFrame->mInUse = PR_TRUE; mFrame->mInUse = PR_TRUE;
} }
~AutoMaskReferencer() { ~AutoMaskReferencer() {

View file

@ -747,7 +747,7 @@ void
nsDiskCacheStreamIO::DeleteBuffer() nsDiskCacheStreamIO::DeleteBuffer()
{ {
if (mBuffer) { if (mBuffer) {
NS_ASSERTION(mBufDirty == PR_FALSE, "deleting dirty buffer"); NS_ASSERTION(!mBufDirty, "deleting dirty buffer");
free(mBuffer); free(mBuffer);
mBuffer = nsnull; mBuffer = nsnull;
mBufPos = 0; mBufPos = 0;

View file

@ -107,7 +107,7 @@ nsMemoryCacheDevice::Shutdown()
for (int i = kQueueCount - 1; i >= 0; --i) { for (int i = kQueueCount - 1; i >= 0; --i) {
entry = (nsCacheEntry *)PR_LIST_HEAD(&mEvictionList[i]); entry = (nsCacheEntry *)PR_LIST_HEAD(&mEvictionList[i]);
while (entry != &mEvictionList[i]) { while (entry != &mEvictionList[i]) {
NS_ASSERTION(entry->IsInUse() == PR_FALSE, "### shutting down with active entries"); NS_ASSERTION(!entry->IsInUse(), "### shutting down with active entries");
next = (nsCacheEntry *)PR_NEXT_LINK(entry); next = (nsCacheEntry *)PR_NEXT_LINK(entry);
PR_REMOVE_AND_INIT_LINK(entry); PR_REMOVE_AND_INIT_LINK(entry);

View file

@ -315,7 +315,7 @@ nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char* aDataStr) {
} }
} }
if (success == PR_FALSE) { if (!success) {
// if unsuccessfully at charset conversion, then // if unsuccessfully at charset conversion, then
// just fallback to unescape'ing in-place // just fallback to unescape'ing in-place
// XXX - this shouldn't be using UTF8, should it? // XXX - this shouldn't be using UTF8, should it?

View file

@ -85,7 +85,7 @@ nsHTTPCompressConv::~nsHTTPCompressConv()
// For some reason we are not getting Z_STREAM_END. But this was also seen // For some reason we are not getting Z_STREAM_END. But this was also seen
// for mozilla bug 198133. Need to handle this case. // for mozilla bug 198133. Need to handle this case.
if ((mStreamInitialized == PR_TRUE) && (mStreamEnded == PR_FALSE)) if (mStreamInitialized && !mStreamEnded)
inflateEnd (&d_stream); inflateEnd (&d_stream);
} }

View file

@ -128,7 +128,7 @@ nsWifiMonitor::DoScanWithCoreWLAN()
nsAutoMonitor mon(mMonitor); nsAutoMonitor mon(mMonitor);
mon.Wait(PR_SecondsToInterval(60)); mon.Wait(PR_SecondsToInterval(60));
} }
while (mKeepGoing == PR_TRUE); while (mKeepGoing);
return NS_OK; return NS_OK;
} }
@ -264,7 +264,7 @@ nsWifiMonitor::DoScanOld()
nsAutoMonitor mon(mMonitor); nsAutoMonitor mon(mMonitor);
mon.Wait(PR_SecondsToInterval(60)); mon.Wait(PR_SecondsToInterval(60));
} }
while (mKeepGoing == PR_TRUE); while (mKeepGoing);
(*WirelessDetach_function_)(wifi_context_); (*WirelessDetach_function_)(wifi_context_);

View file

@ -161,7 +161,7 @@ nsWifiMonitor::DoScan()
char* args[] = {(char*) &accessPoints, (char*) iw_stats, nsnull }; char* args[] = {(char*) &accessPoints, (char*) iw_stats, nsnull };
while (mKeepGoing == PR_TRUE) { while (mKeepGoing) {
accessPoints.Clear(); accessPoints.Clear();

View file

@ -545,7 +545,7 @@ nsWifiMonitor::DoScan()
nsAutoMonitor mon(mMonitor); nsAutoMonitor mon(mMonitor);
mon.Wait(PR_SecondsToInterval(60)); mon.Wait(PR_SecondsToInterval(60));
} }
while (mKeepGoing == PR_TRUE); while (mKeepGoing);
@ -702,7 +702,7 @@ nsWifiMonitor::DoScan()
nsAutoMonitor mon(mMonitor); nsAutoMonitor mon(mMonitor);
mon.Wait(PR_SecondsToInterval(60)); mon.Wait(PR_SecondsToInterval(60));
} }
while (mKeepGoing == PR_TRUE); while (mKeepGoing);
} }
#endif #endif
return NS_OK; return NS_OK;

View file

@ -266,7 +266,7 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
rv = result->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) &mResult); rv = result->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) &mResult);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
if (mAllowNegativeAssertions == PR_TRUE) if (mAllowNegativeAssertions)
{ {
// See if any previous data source negates this // See if any previous data source negates this
PRBool hasNegation = PR_FALSE; PRBool hasNegation = PR_FALSE;
@ -290,7 +290,7 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
} }
} }
if (mCoalesceDuplicateArcs == PR_TRUE) if (mCoalesceDuplicateArcs)
{ {
// Now see if we've returned it once already. // Now see if we've returned it once already.
// XXX N.B. performance here...may want to hash if things get large? // XXX N.B. performance here...may want to hash if things get large?
@ -303,7 +303,7 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
break; break;
} }
} }
if (alreadyReturned == PR_TRUE) if (alreadyReturned)
{ {
NS_RELEASE(mResult); NS_RELEASE(mResult);
continue; continue;
@ -320,7 +320,7 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
// optional. This could get to be pretty expensive (this // optional. This could get to be pretty expensive (this
// implementation turns iteration into O(n^2)). // implementation turns iteration into O(n^2)).
if (mCoalesceDuplicateArcs == PR_TRUE) if (mCoalesceDuplicateArcs)
{ {
mAlreadyReturned.AppendElement(mResult); mAlreadyReturned.AppendElement(mResult);
} }
@ -686,7 +686,7 @@ CompositeDataSourceImpl::GetSource(nsIRDFResource* property,
PRBool tv, PRBool tv,
nsIRDFResource** source) nsIRDFResource** source)
{ {
if ((mAllowNegativeAssertions == PR_FALSE) && (tv == PR_FALSE)) if (!mAllowNegativeAssertions && !tv)
return(NS_RDF_NO_VALUE); return(NS_RDF_NO_VALUE);
PRInt32 count = mDataSources.Count(); PRInt32 count = mDataSources.Count();
@ -698,7 +698,7 @@ CompositeDataSourceImpl::GetSource(nsIRDFResource* property,
if (rv == NS_RDF_NO_VALUE) if (rv == NS_RDF_NO_VALUE)
continue; continue;
if (mAllowNegativeAssertions == PR_FALSE) return(NS_OK); if (!mAllowNegativeAssertions) return(NS_OK);
// okay, found it. make sure we don't have the opposite // okay, found it. make sure we don't have the opposite
// asserted in a more local data source // asserted in a more local data source
@ -729,7 +729,7 @@ CompositeDataSourceImpl::GetSources(nsIRDFResource* aProperty,
if (! aResult) if (! aResult)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE)) if (! mAllowNegativeAssertions && ! aTruthValue)
return(NS_RDF_NO_VALUE); return(NS_RDF_NO_VALUE);
*aResult = CompositeAssertionEnumeratorImpl::Create(mAllocator, *aResult = CompositeAssertionEnumeratorImpl::Create(mAllocator,
@ -763,7 +763,7 @@ CompositeDataSourceImpl::GetTarget(nsIRDFResource* aSource,
if (! aResult) if (! aResult)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE)) if (! mAllowNegativeAssertions && ! aTruthValue)
return(NS_RDF_NO_VALUE); return(NS_RDF_NO_VALUE);
PRInt32 count = mDataSources.Count(); PRInt32 count = mDataSources.Count();
@ -778,7 +778,7 @@ CompositeDataSourceImpl::GetTarget(nsIRDFResource* aSource,
// okay, found it. make sure we don't have the opposite // okay, found it. make sure we don't have the opposite
// asserted in an earlier data source // asserted in an earlier data source
if (mAllowNegativeAssertions == PR_TRUE) { if (mAllowNegativeAssertions) {
if (HasAssertionN(count-1, aSource, aProperty, *aResult, !aTruthValue)) { if (HasAssertionN(count-1, aSource, aProperty, *aResult, !aTruthValue)) {
// whoops, it's been negated. // whoops, it's been negated.
NS_RELEASE(*aResult); NS_RELEASE(*aResult);
@ -835,7 +835,7 @@ CompositeDataSourceImpl::GetTargets(nsIRDFResource* aSource,
if (! aResult) if (! aResult)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE)) if (! mAllowNegativeAssertions && ! aTruthValue)
return(NS_RDF_NO_VALUE); return(NS_RDF_NO_VALUE);
*aResult = *aResult =
@ -870,7 +870,7 @@ CompositeDataSourceImpl::Assert(nsIRDFResource* aSource,
if (! aTarget) if (! aTarget)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE)) if (! mAllowNegativeAssertions && ! aTruthValue)
return(NS_RDF_ASSERTION_REJECTED); return(NS_RDF_ASSERTION_REJECTED);
nsresult rv; nsresult rv;
@ -1066,7 +1066,7 @@ CompositeDataSourceImpl::HasAssertion(nsIRDFResource* aSource,
if (! aResult) if (! aResult)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE)) if (! mAllowNegativeAssertions && ! aTruthValue)
{ {
*aResult = PR_FALSE; *aResult = PR_FALSE;
return(NS_OK); return(NS_OK);
@ -1085,7 +1085,7 @@ CompositeDataSourceImpl::HasAssertion(nsIRDFResource* aSource,
if (*aResult) if (*aResult)
return NS_OK; return NS_OK;
if (mAllowNegativeAssertions == PR_TRUE) if (mAllowNegativeAssertions)
{ {
PRBool hasNegation; PRBool hasNegation;
rv = datasource->HasAssertion(aSource, aProperty, aTarget, !aTruthValue, &hasNegation); rv = datasource->HasAssertion(aSource, aProperty, aTarget, !aTruthValue, &hasNegation);
@ -1138,7 +1138,7 @@ CompositeDataSourceImpl::HasArcIn(nsIRDFNode *aNode, nsIRDFResource *aArc, PRBoo
for (PRInt32 i = 0; i < count; ++i) { for (PRInt32 i = 0; i < count; ++i) {
rv = mDataSources[i]->HasArcIn(aNode, aArc, result); rv = mDataSources[i]->HasArcIn(aNode, aArc, result);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
if (*result == PR_TRUE) if (*result)
return NS_OK; return NS_OK;
} }
return NS_OK; return NS_OK;
@ -1153,7 +1153,7 @@ CompositeDataSourceImpl::HasArcOut(nsIRDFResource *aSource, nsIRDFResource *aArc
for (PRInt32 i = 0; i < count; ++i) { for (PRInt32 i = 0; i < count; ++i) {
rv = mDataSources[i]->HasArcOut(aSource, aArc, result); rv = mDataSources[i]->HasArcOut(aSource, aArc, result);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
if (*result == PR_TRUE) if (*result)
return NS_OK; return NS_OK;
} }
return NS_OK; return NS_OK;
@ -1235,7 +1235,8 @@ CompositeDataSourceImpl::GetAllCmds(nsIRDFResource* source,
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
{ {
PRBool hasMore = PR_FALSE; PRBool hasMore = PR_FALSE;
while(NS_SUCCEEDED(rv = dsCmds->HasMoreElements(&hasMore)) && (hasMore == PR_TRUE)) while(NS_SUCCEEDED(rv = dsCmds->HasMoreElements(&hasMore)) &&
hasMore)
{ {
nsCOMPtr<nsISupports> item; nsCOMPtr<nsISupports> item;
if (NS_SUCCEEDED(rv = dsCmds->GetNext(getter_AddRefs(item)))) if (NS_SUCCEEDED(rv = dsCmds->GetNext(getter_AddRefs(item))))
@ -1397,7 +1398,7 @@ CompositeDataSourceImpl::OnAssert(nsIRDFDataSource* aDataSource,
// datasource that coughed up the assertion. // datasource that coughed up the assertion.
nsresult rv = NS_OK; nsresult rv = NS_OK;
if (mAllowNegativeAssertions == PR_TRUE) if (mAllowNegativeAssertions)
{ {
PRBool hasAssertion; PRBool hasAssertion;
rv = HasAssertion(aSource, aProperty, aTarget, PR_TRUE, &hasAssertion); rv = HasAssertion(aSource, aProperty, aTarget, PR_TRUE, &hasAssertion);
@ -1428,7 +1429,7 @@ CompositeDataSourceImpl::OnUnassert(nsIRDFDataSource* aDataSource,
// datasource that coughed up the assertion. // datasource that coughed up the assertion.
nsresult rv; nsresult rv;
if (mAllowNegativeAssertions == PR_TRUE) if (mAllowNegativeAssertions)
{ {
PRBool hasAssertion; PRBool hasAssertion;
rv = HasAssertion(aSource, aProperty, aTarget, PR_TRUE, &hasAssertion); rv = HasAssertion(aSource, aProperty, aTarget, PR_TRUE, &hasAssertion);

View file

@ -541,7 +541,7 @@ RDFContainerImpl::Renumber(PRInt32 aStartIndex, PRInt32 aIncrement)
} }
PRBool err = PR_FALSE; PRBool err = PR_FALSE;
while ((err == PR_FALSE) && ((aIncrement < 0) ? (i <= count) : (i >= aStartIndex))) while (!err && ((aIncrement < 0) ? (i <= count) : (i >= aStartIndex)))
{ {
nsCOMPtr<nsIRDFResource> oldOrdinal; nsCOMPtr<nsIRDFResource> oldOrdinal;
rv = gRDFContainerUtils->IndexToOrdinalResource(i, getter_AddRefs(oldOrdinal)); rv = gRDFContainerUtils->IndexToOrdinalResource(i, getter_AddRefs(oldOrdinal));
@ -620,7 +620,7 @@ RDFContainerImpl::Renumber(PRInt32 aStartIndex, PRInt32 aIncrement)
i -= aIncrement; i -= aIncrement;
} }
if ((err == PR_FALSE) && (aIncrement < 0)) if (!err && (aIncrement < 0))
{ {
// Update the container's nextVal to reflect the // Update the container's nextVal to reflect the
// renumbering. We do this now if aIncrement < 0 because, up // renumbering. We do this now if aIncrement < 0 because, up
@ -638,7 +638,7 @@ RDFContainerImpl::Renumber(PRInt32 aStartIndex, PRInt32 aIncrement)
propagatable->SetPropagateChanges(PR_TRUE); propagatable->SetPropagateChanges(PR_TRUE);
} }
if (err == PR_TRUE) return(rv); if (err) return(rv);
return NS_OK; return NS_OK;
} }

View file

@ -439,7 +439,7 @@ RDFContainerUtilsImpl::MakeContainer(nsIRDFDataSource* aDataSource, nsIRDFResour
rv = IsContainer(aDataSource, aResource, &isContainer); rv = IsContainer(aDataSource, aResource, &isContainer);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
if (isContainer == PR_FALSE) if (!isContainer)
{ {
rv = aDataSource->Assert(aResource, kRDF_instanceOf, aType, PR_TRUE); rv = aDataSource->Assert(aResource, kRDF_instanceOf, aType, PR_TRUE);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;

View file

@ -139,7 +139,7 @@ FileSystemDataSource::isDirURI(nsIRDFResource* source)
{ {
PRBool isPackageFlag = PR_FALSE; PRBool isPackageFlag = PR_FALSE;
rv = aMacFile->IsPackage(&isPackageFlag); rv = aMacFile->IsPackage(&isPackageFlag);
if (NS_SUCCEEDED(rv) && (isPackageFlag == PR_TRUE)) if (NS_SUCCEEDED(rv) && isPackageFlag)
{ {
isDirFlag = PR_FALSE; isDirFlag = PR_FALSE;
} }
@ -798,7 +798,7 @@ FileSystemDataSource::ArcLabelsOut(nsIRDFResource *source,
if (isDirURI(source)) if (isDirURI(source))
{ {
#ifdef XP_WIN #ifdef XP_WIN
if (isValidFolder(source) == PR_TRUE) if (isValidFolder(source))
{ {
array->AppendElement(mNC_Child); array->AppendElement(mNC_Child);
} }
@ -983,7 +983,7 @@ FileSystemDataSource::isValidFolder(nsIRDFResource *source)
{ {
PRBool hasAny = PR_FALSE, hasMore; PRBool hasAny = PR_FALSE, hasMore;
while (NS_SUCCEEDED(folderEnum->HasMoreElements(&hasMore)) && while (NS_SUCCEEDED(folderEnum->HasMoreElements(&hasMore)) &&
(hasMore == PR_TRUE)) hasMore)
{ {
hasAny = PR_TRUE; hasAny = PR_TRUE;
@ -1010,7 +1010,7 @@ FileSystemDataSource::isValidFolder(nsIRDFResource *source)
break; break;
} }
} }
if (hasAny == PR_FALSE) isValid = PR_TRUE; if (!hasAny) isValid = PR_TRUE;
} }
} }
return(isValid); return(isValid);
@ -1065,7 +1065,7 @@ FileSystemDataSource::GetFolderList(nsIRDFResource *source, PRBool allowHidden,
PRBool hasMore; PRBool hasMore;
while(NS_SUCCEEDED(rv = dirContents->HasMoreElements(&hasMore)) && while(NS_SUCCEEDED(rv = dirContents->HasMoreElements(&hasMore)) &&
(hasMore == PR_TRUE)) hasMore)
{ {
nsCOMPtr<nsISupports> isupports; nsCOMPtr<nsISupports> isupports;
if (NS_FAILED(rv = dirContents->GetNext(getter_AddRefs(isupports)))) if (NS_FAILED(rv = dirContents->GetNext(getter_AddRefs(isupports))))
@ -1075,12 +1075,12 @@ FileSystemDataSource::GetFolderList(nsIRDFResource *source, PRBool allowHidden,
if (!aFile) if (!aFile)
break; break;
if (allowHidden == PR_FALSE) if (!allowHidden)
{ {
PRBool hiddenFlag = PR_FALSE; PRBool hiddenFlag = PR_FALSE;
if (NS_FAILED(rv = aFile->IsHidden(&hiddenFlag))) if (NS_FAILED(rv = aFile->IsHidden(&hiddenFlag)))
break; break;
if (hiddenFlag == PR_TRUE) if (hiddenFlag)
continue; continue;
} }
@ -1120,7 +1120,7 @@ FileSystemDataSource::GetFolderList(nsIRDFResource *source, PRBool allowHidden,
PRBool dirFlag = PR_FALSE; PRBool dirFlag = PR_FALSE;
rv = aFile->IsDirectory(&dirFlag); rv = aFile->IsDirectory(&dirFlag);
if (NS_SUCCEEDED(rv) && (dirFlag == PR_TRUE)) if (NS_SUCCEEDED(rv) && dirFlag)
{ {
fullURI.Append('/'); fullURI.Append('/');
} }
@ -1130,7 +1130,7 @@ FileSystemDataSource::GetFolderList(nsIRDFResource *source, PRBool allowHidden,
nameArray->AppendElement(fileRes); nameArray->AppendElement(fileRes);
if (onlyFirst == PR_TRUE) if (onlyFirst)
break; break;
} }
@ -1222,7 +1222,7 @@ FileSystemDataSource::GetFileSize(nsIRDFResource *source, nsIRDFInt **aResult)
PRBool isDir = PR_FALSE; PRBool isDir = PR_FALSE;
if (NS_FAILED(rv = aFile->IsDirectory(&isDir))) if (NS_FAILED(rv = aFile->IsDirectory(&isDir)))
return(rv); return(rv);
if (isDir == PR_TRUE) if (isDir)
return(NS_RDF_NO_VALUE); return(NS_RDF_NO_VALUE);
PRInt64 aFileSize64; PRInt64 aFileSize64;
@ -1292,7 +1292,7 @@ FileSystemDataSource::GetName(nsIRDFResource *source, nsIRDFLiteral **aResult)
{ {
PRBool isPackageFlag = PR_FALSE; PRBool isPackageFlag = PR_FALSE;
rv = aMacFile->IsPackage(&isPackageFlag); rv = aMacFile->IsPackage(&isPackageFlag);
if (NS_SUCCEEDED(rv) && (isPackageFlag == PR_TRUE)) if (NS_SUCCEEDED(rv) && isPackageFlag)
{ {
// mungle package names under Mac OS 9/X // mungle package names under Mac OS 9/X
PRUint32 len = name.Length(); PRUint32 len = name.Length();

View file

@ -757,7 +757,7 @@ walkTree(STCategoryNode * root, STCategoryNodeProcessor func,
while (begin != end) { while (begin != end) {
node = nodes[begin]; node = nodes[begin];
ret = (*func) (inRequest, inOptions, inContext, clientData, node); ret = (*func) (inRequest, inOptions, inContext, clientData, node);
if (ret == PR_FALSE) { if (!ret) {
/* Abort */ /* Abort */
break; break;
} }

View file

@ -347,7 +347,7 @@ NS_IMETHODIMP
nsDragService::SetCanDrop(PRBool aCanDrop) nsDragService::SetCanDrop(PRBool aCanDrop)
{ {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::SetCanDrop(%s)", PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::SetCanDrop(%s)",
aCanDrop == PR_TRUE?"TRUE":"FALSE")); aCanDrop ? "TRUE" : "FALSE"));
return nsBaseDragService::SetCanDrop(aCanDrop); return nsBaseDragService::SetCanDrop(aCanDrop);
} }
@ -650,7 +650,7 @@ nsDragService::CreateDragMessage()
} }
returnMsg->PrintToStream(); returnMsg->PrintToStream();
// If we did not add a type, we can't drag // If we did not add a type, we can't drag
NS_ASSERTION(addedType == PR_TRUE, "No flavor/mime in the drag message!"); NS_ASSERTION(addedType, "No flavor/mime in the drag message!");
return returnMsg; return returnMsg;
} }

View file

@ -174,7 +174,7 @@ nsresult nsPopupWindow::StandardWindowCreate(nsIWidget *aParent,
NS_METHOD nsPopupWindow::Show(PRBool bState) NS_METHOD nsPopupWindow::Show(PRBool bState)
{ {
//Bring popup to correct workspace. //Bring popup to correct workspace.
if (bState == PR_TRUE && mView && mView->Window() != NULL ) if (bState && mView && mView->Window() != NULL)
mView->Window()->SetWorkspaces(B_CURRENT_WORKSPACE); mView->Window()->SetWorkspaces(B_CURRENT_WORKSPACE);
return nsWindow::Show(bState); return nsWindow::Show(bState);

View file

@ -168,7 +168,7 @@ void nsToolkit::CreateUIThread()
0); 0);
// wait for the gui thread to start // wait for the gui thread to start
while(gThreadState == PR_FALSE) while(!gThreadState)
{ {
PR_Wait(monitor, PR_INTERVAL_NO_TIMEOUT); PR_Wait(monitor, PR_INTERVAL_NO_TIMEOUT);
} }

View file

@ -679,7 +679,7 @@ NS_METHOD nsWindow::Show(PRBool bState)
//and Show() checks. BeBook: //and Show() checks. BeBook:
// If Hide() is called more than once, you'll need to call Show() // If Hide() is called more than once, you'll need to call Show()
// an equal number of times for the window to become visible again. // an equal number of times for the window to become visible again.
if (bState == PR_FALSE) if (!bState)
{ {
if (mView->Window() && !mView->Window()->IsHidden()) if (mView->Window() && !mView->Window()->IsHidden())
mView->Window()->Hide(); mView->Window()->Hide();
@ -1094,7 +1094,7 @@ NS_METHOD nsWindow::SetFocus(PRBool aRaise)
if (mView && mView->LockLooper()) if (mView && mView->LockLooper())
{ {
if (mView->Window() && if (mView->Window() &&
aRaise == PR_TRUE && aRaise &&
eWindowType_popup != mWindowType && eWindowType_popup != mWindowType &&
!mView->Window()->IsActive() && !mView->Window()->IsActive() &&
gLastActiveWindow != mView->Window()) gLastActiveWindow != mView->Window())

View file

@ -1018,7 +1018,7 @@ GlobalPrinters::GetDefaultPrinterName(PRUnichar **aDefaultPrinterName)
{ {
*aDefaultPrinterName = nsnull; *aDefaultPrinterName = nsnull;
PRBool allocate = (GlobalPrinters::GetInstance()->PrintersAreAllocated() == PR_FALSE); PRBool allocate = !GlobalPrinters::GetInstance()->PrintersAreAllocated();
if (allocate) { if (allocate) {
nsresult rv = GlobalPrinters::GetInstance()->InitializeGlobalPrinters(); nsresult rv = GlobalPrinters::GetInstance()->InitializeGlobalPrinters();

View file

@ -836,7 +836,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
*_retval = PR_TRUE; *_retval = PR_TRUE;
} }
// check for automatic text/uri-list -> text/x-moz-url mapping // check for automatic text/uri-list -> text/x-moz-url mapping
if (*_retval == PR_FALSE && if (!*_retval &&
name && name &&
(strcmp(name, gTextUriListType) == 0) && (strcmp(name, gTextUriListType) == 0) &&
(strcmp(aDataFlavor, kURLMime) == 0)) { (strcmp(aDataFlavor, kURLMime) == 0)) {
@ -846,7 +846,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
*_retval = PR_TRUE; *_retval = PR_TRUE;
} }
// check for automatic _NETSCAPE_URL -> text/x-moz-url mapping // check for automatic _NETSCAPE_URL -> text/x-moz-url mapping
if (*_retval == PR_FALSE && if (!*_retval &&
name && name &&
(strcmp(name, gMozUrlType) == 0) && (strcmp(name, gMozUrlType) == 0) &&
(strcmp(aDataFlavor, kURLMime) == 0)) { (strcmp(aDataFlavor, kURLMime) == 0)) {
@ -856,7 +856,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
*_retval = PR_TRUE; *_retval = PR_TRUE;
} }
// check for auto text/plain -> text/unicode mapping // check for auto text/plain -> text/unicode mapping
if (*_retval == PR_FALSE && if (!*_retval &&
name && name &&
(strcmp(name, kTextMime) == 0) && (strcmp(name, kTextMime) == 0) &&
((strcmp(aDataFlavor, kUnicodeMime) == 0) || ((strcmp(aDataFlavor, kUnicodeMime) == 0) ||

View file

@ -295,7 +295,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
} }
#endif #endif
if (result == PR_TRUE) { if (result) {
// Remember what filter type the user selected // Remember what filter type the user selected
mSelectedType = (PRInt16)ofn.nFilterIndex; mSelectedType = (PRInt16)ofn.nFilterIndex;

View file

@ -294,7 +294,7 @@ void nsToolkit::CreateUIThread()
0); 0);
// wait for the gui thread to start // wait for the gui thread to start
while(gThreadState == PR_FALSE) { while(!gThreadState) {
::PR_Wait(monitor, PR_INTERVAL_NO_TIMEOUT); ::PR_Wait(monitor, PR_INTERVAL_NO_TIMEOUT);
} }

View file

@ -1487,7 +1487,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const nsACString &newName, PRBool mov
{ {
PRBool isDir; PRBool isDir;
newParentDir->IsDirectory(&isDir); newParentDir->IsDirectory(&isDir);
if (isDir == PR_FALSE) if (!isDir)
{ {
return NS_ERROR_FILE_DESTINATION_NOT_DIR; return NS_ERROR_FILE_DESTINATION_NOT_DIR;
} }

View file

@ -1540,7 +1540,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const nsAString &newName, PRBool foll
{ {
PRBool isDir; PRBool isDir;
newParentDir->IsDirectory(&isDir); newParentDir->IsDirectory(&isDir);
if (isDir == PR_FALSE) if (!isDir)
{ {
if (followSymlinks) if (followSymlinks)
{ {

View file

@ -1011,7 +1011,7 @@ nsPipeOutputStream::Wait()
mon.Wait(); mon.Wait();
mBlocked = PR_FALSE; mBlocked = PR_FALSE;
LOG(("OOO pipe output: woke up [pipe-status=%x writable=%u]\n", LOG(("OOO pipe output: woke up [pipe-status=%x writable=%u]\n",
mPipe->mStatus, mWritable == PR_TRUE)); mPipe->mStatus, mWritable));
} }
return mPipe->mStatus == NS_BASE_STREAM_CLOSED ? NS_OK : mPipe->mStatus; return mPipe->mStatus == NS_BASE_STREAM_CLOSED ? NS_OK : mPipe->mStatus;

View file

@ -110,7 +110,7 @@ int ProcessArgs(nsIComponentRegistrar* registrar, int argc, char *argv[])
} }
i++; i++;
} else { } else {
if (gUnreg == PR_TRUE) { if (gUnreg) {
res = Unregister(argv[i]); res = Unregister(argv[i]);
if (NS_SUCCEEDED(res)) { if (NS_SUCCEEDED(res)) {
cout << "Successfully unregistered: " << argv[i] << "\n"; cout << "Successfully unregistered: " << argv[i] << "\n";

View file

@ -42,7 +42,7 @@ PRBool LoopInDir(nsILocalFile* file)
return PR_FALSE; return PR_FALSE;
} }
if (isDir == PR_TRUE) if (isDir)
{ {
nsCOMPtr<nsILocalFile> lfile = do_QueryInterface(file); nsCOMPtr<nsILocalFile> lfile = do_QueryInterface(file);
LoopInDir(lfile); LoopInDir(lfile);

View file

@ -114,7 +114,7 @@ public:
NS_IMETHOD LockFactory(PRBool aLock) { NS_IMETHOD LockFactory(PRBool aLock) {
printf("nsTestComFactory: "); printf("nsTestComFactory: ");
printf("%s", (aLock == PR_TRUE ? "Locking server" : "Unlocking server")); printf("%s", (aLock ? "Locking server" : "Unlocking server"));
printf("\n"); printf("\n");
return S_OK; return S_OK;
} }