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()
{
// We have a zeroing operator new
NS_ASSERTION(mLayoutStarted == PR_FALSE, "What?");
NS_ASSERTION(mDynamicLowerValue == PR_FALSE, "What?");
NS_ASSERTION(mParsing == PR_FALSE, "What?");
NS_ASSERTION(!mLayoutStarted, "What?");
NS_ASSERTION(!mDynamicLowerValue, "What?");
NS_ASSERTION(!mParsing, "What?");
NS_ASSERTION(mLastSampledUserEventTime == 0, "What?");
NS_ASSERTION(mDeflectedCount == 0, "What?");
NS_ASSERTION(mDroppedTimer == PR_FALSE, "What?");
NS_ASSERTION(!mDroppedTimer, "What?");
NS_ASSERTION(mInMonolithicContainer == 0, "What?");
NS_ASSERTION(mInNotification == 0, "What?");
NS_ASSERTION(mDeferredLayoutStart == PR_FALSE, "What?");
NS_ASSERTION(!mDeferredLayoutStart, "What?");
#ifdef NS_DEBUG
if (!gContentSinkLogModuleInfo) {

View file

@ -321,7 +321,7 @@ void nsXMLEventsManager::AddListeners(nsIDocument* aDocument)
for (int i = 0; i < mIncomplete.Count(); ++i) {
cur = mIncomplete[i];
//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;
}
}

View file

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

View file

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

View file

@ -6247,7 +6247,7 @@ nsDocShell::CanSavePresentation(PRUint32 aLoadType,
// then we should not cache the presentation.
PRBool canSaveState;
mOSHE->GetSaveLayoutStateFlag(&canSaveState);
if (canSaveState == PR_FALSE)
if (!canSaveState)
return PR_FALSE;
// 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);

View file

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

View file

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

View file

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

View file

@ -844,7 +844,7 @@ nsPresContext::UpdateAfterPreferencesChanged()
nsresult
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);
mDeviceContext = aDeviceContext;
@ -1257,7 +1257,7 @@ nsPresContext::SetFullZoom(float aZoom)
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;
mFullZoom = aZoom;

View file

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

View file

@ -221,7 +221,7 @@ void Area::ParseCoords(const nsAString& aSpec)
{
if (*tptr == ',')
{
if (has_comma == PR_FALSE)
if (!has_comma)
{
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 ((*tptr == '\0')&&(has_comma == PR_FALSE))
if ((*tptr == '\0') && !has_comma)
{
break;
}
@ -243,7 +243,7 @@ void Area::ParseCoords(const nsAString& aSpec)
* Else if the separator is all whitespace, and this is not the
* end of the string, add a comma to the separator.
*/
else if (has_comma == PR_FALSE)
else if (!has_comma)
{
*n_str = ',';
}

View file

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

View file

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

View file

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

View file

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

View file

@ -107,7 +107,7 @@ nsMemoryCacheDevice::Shutdown()
for (int i = kQueueCount - 1; i >= 0; --i) {
entry = (nsCacheEntry *)PR_LIST_HEAD(&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);
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
// just fallback to unescape'ing in-place
// 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 mozilla bug 198133. Need to handle this case.
if ((mStreamInitialized == PR_TRUE) && (mStreamEnded == PR_FALSE))
if (mStreamInitialized && !mStreamEnded)
inflateEnd (&d_stream);
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -347,7 +347,7 @@ NS_IMETHODIMP
nsDragService::SetCanDrop(PRBool aCanDrop)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::SetCanDrop(%s)",
aCanDrop == PR_TRUE?"TRUE":"FALSE"));
aCanDrop ? "TRUE" : "FALSE"));
return nsBaseDragService::SetCanDrop(aCanDrop);
}
@ -650,7 +650,7 @@ nsDragService::CreateDragMessage()
}
returnMsg->PrintToStream();
// 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;
}

View file

@ -174,7 +174,7 @@ nsresult nsPopupWindow::StandardWindowCreate(nsIWidget *aParent,
NS_METHOD nsPopupWindow::Show(PRBool bState)
{
//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);
return nsWindow::Show(bState);

View file

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

View file

@ -679,7 +679,7 @@ NS_METHOD nsWindow::Show(PRBool bState)
//and Show() checks. BeBook:
// 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.
if (bState == PR_FALSE)
if (!bState)
{
if (mView->Window() && !mView->Window()->IsHidden())
mView->Window()->Hide();
@ -1094,7 +1094,7 @@ NS_METHOD nsWindow::SetFocus(PRBool aRaise)
if (mView && mView->LockLooper())
{
if (mView->Window() &&
aRaise == PR_TRUE &&
aRaise &&
eWindowType_popup != mWindowType &&
!mView->Window()->IsActive() &&
gLastActiveWindow != mView->Window())

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1011,7 +1011,7 @@ nsPipeOutputStream::Wait()
mon.Wait();
mBlocked = PR_FALSE;
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;

View file

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

View file

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

View file

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