Bug 517553: Remove '=='/'!=' 'PR_FALSE'/'PR_TRUE'
authorJae-Seong Lee-Russo <lusian@gmail.com>
Sun, 07 Feb 2010 10:52:43 -0500
changeset 37970 53308118abed2d1a68590a6426e34debdd4e1e67
parent 37969 0ddf975663a00d272f07e689799aa18c3133ed87
child 37971 872dcf34dab3cb4d4c68486dd24ffc5b6f6c5fec
push idunknown
push userunknown
push dateunknown
bugs517553
milestone1.9.3a2pre
Bug 517553: Remove '=='/'!=' 'PR_FALSE'/'PR_TRUE'
content/base/src/nsContentSink.cpp
content/events/src/nsXMLEventsManager.cpp
content/smil/nsSMILAnimationFunction.cpp
content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp
docshell/base/nsDocShell.cpp
dom/src/geolocation/nsGeolocation.cpp
intl/chardet/src/nsDebugDetector.cpp
intl/chardet/src/nsMetaCharsetObserver.cpp
intl/chardet/src/nsXMLEncodingObserver.cpp
js/src/xpconnect/tools/src/nsXPCToolsProfiler.cpp
layout/base/nsPresContext.cpp
layout/forms/nsListControlFrame.cpp
layout/generic/nsImageMap.cpp
layout/style/nsCSSParser.cpp
layout/svg/base/src/nsSVGClipPathFrame.h
layout/svg/base/src/nsSVGMaskFrame.h
netwerk/cache/src/nsDiskCacheStreams.cpp
netwerk/cache/src/nsMemoryCacheDevice.cpp
netwerk/streamconv/converters/nsDirIndexParser.cpp
netwerk/streamconv/converters/nsHTTPCompressConv.cpp
netwerk/wifi/src/nsWifiScannerMac.cpp
netwerk/wifi/src/nsWifiScannerUnix.cpp
netwerk/wifi/src/nsWifiScannerWin.cpp
rdf/base/src/nsCompositeDataSource.cpp
rdf/base/src/nsRDFContainer.cpp
rdf/base/src/nsRDFContainerUtils.cpp
rdf/datasource/src/nsFileSystemDataSource.cpp
tools/trace-malloc/spacecategory.c
widget/src/beos/nsDragService.cpp
widget/src/beos/nsPopupWindow.cpp
widget/src/beos/nsToolkit.cpp
widget/src/beos/nsWindow.cpp
widget/src/gtk2/nsDeviceContextSpecG.cpp
widget/src/gtk2/nsDragService.cpp
widget/src/windows/nsFilePicker.cpp
widget/src/windows/nsToolkit.cpp
xpcom/io/nsLocalFileOS2.cpp
xpcom/io/nsLocalFileWin.cpp
xpcom/io/nsPipe3.cpp
xpcom/tests/RegFactory.cpp
xpcom/tests/nsIFileEnumerator.cpp
xpcom/tests/windows/TestCOM.cpp
--- a/content/base/src/nsContentSink.cpp
+++ b/content/base/src/nsContentSink.cpp
@@ -185,25 +185,25 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mNodeInfoManager,
                                                   nsNodeInfoManager)
 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) {
     gContentSinkLogModuleInfo = PR_NewLogModule("nscontentsink");
   }
 #endif
 }
 
--- a/content/events/src/nsXMLEventsManager.cpp
+++ b/content/events/src/nsXMLEventsManager.cpp
@@ -316,17 +316,17 @@ PRBool nsXMLEventsManager::RemoveListene
 }
 
 void nsXMLEventsManager::AddListeners(nsIDocument* aDocument)
 {
   nsIContent *cur;
   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;
   }
 }
 
 void 
 nsXMLEventsManager::BeginUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) {}
 void 
 nsXMLEventsManager::EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) {}
--- a/content/smil/nsSMILAnimationFunction.cpp
+++ b/content/smil/nsSMILAnimationFunction.cpp
@@ -863,27 +863,27 @@ nsSMILAnimationFunction::CheckKeySplines
 
 PRBool
 nsSMILAnimationFunction::GetAccumulate() const
 {
   const nsAttrValue* value = GetAttr(nsGkAtoms::accumulate);
   if (!value)
     return PR_FALSE;
 
-  return (value->GetEnumValue() == PR_TRUE);
+  return value->GetEnumValue();
 }
 
 PRBool
 nsSMILAnimationFunction::GetAdditive() const
 {
   const nsAttrValue* value = GetAttr(nsGkAtoms::additive);
   if (!value)
     return PR_FALSE;
 
-  return (value->GetEnumValue() == PR_TRUE);
+  return value->GetEnumValue();
 }
 
 nsSMILAnimationFunction::nsSMILCalcMode
 nsSMILAnimationFunction::GetCalcMode() const
 {
   const nsAttrValue* value = GetAttr(nsGkAtoms::calcMode);
   if (!value)
     return CALC_LINEAR;
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp
@@ -91,17 +91,17 @@ nsXULTemplateResultSetStorage::HasMoreEl
         return NS_OK;
     }
 
     nsresult rv = mStatement->ExecuteStep(aResult);
     NS_ENSURE_SUCCESS(rv, rv);
     // 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;
 }
 
 NS_IMETHODIMP
 nsXULTemplateResultSetStorage::GetNext(nsISupports **aResult)
 {
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -6242,17 +6242,17 @@ nsDocShell::CanSavePresentation(PRUint32
         aLoadType != LOAD_STOP_CONTENT_AND_REPLACE &&
         aLoadType != LOAD_ERROR_PAGE)
         return PR_FALSE;
 
     // If the session history entry has the saveLayoutState flag set to false,
     // 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.
     nsCOMPtr<nsPIDOMWindow> pWin = do_QueryInterface(mScriptGlobal);
     if (!pWin || pWin->IsLoading())
         return PR_FALSE;
 
     if (pWin->WouldReuseInnerWindow(aNewDocument))
@@ -9511,17 +9511,17 @@ nsDocShell::AddToSessionHistory(nsIURI *
             PRUint32 expTime;         
             cacheEntryInfo->GetExpirationTime(&expTime);         
             PRUint32 now = PRTimeToSeconds(PR_Now());                  
             if (expTime <=  now)            
                 expired = PR_TRUE;         
          
         }
     }
-    if (expired == PR_TRUE)
+    if (expired)
         entry->SetExpirationStatus(PR_TRUE);
 
 
     if (root == static_cast<nsIDocShellTreeItem *>(this) && mSessionHistory) {
         // This is the root docshell
         if (LOAD_TYPE_HAS_FLAGS(mLoadType, LOAD_FLAGS_REPLACE_HISTORY)) {            
             // Replace current entry in session history.
             PRInt32  index = 0;   
--- a/dom/src/geolocation/nsGeolocation.cpp
+++ b/dom/src/geolocation/nsGeolocation.cpp
@@ -361,17 +361,17 @@ nsresult nsGeolocationService::Init()
   mTimeout = nsContentUtils::GetIntPref("geo.timeout", 6000);
 
   nsContentUtils::RegisterPrefCallback("geo.enabled",
                                        GeoEnabledChangedCallback,
                                        nsnull);
 
   GeoEnabledChangedCallback("geo.enabled", nsnull);
 
-  if (sGeoEnabled == PR_FALSE)
+  if (!sGeoEnabled)
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIGeolocationProvider> provider = do_GetService(NS_GEOLOCATION_PROVIDER_CONTRACTID);
   if (provider)
     mProviders.AppendObject(provider);
 
   // look up any providers that were registered via the category manager
   nsCOMPtr<nsICategoryManager> catMan(do_GetService("@mozilla.org/categorymanager;1"));
@@ -575,17 +575,17 @@ PRBool
 nsGeolocationService::HasGeolocationProvider()
 {
   return mProviders.Count() > 0;
 }
 
 nsresult
 nsGeolocationService::StartDevice()
 {
-  if (sGeoEnabled == PR_FALSE)
+  if (!sGeoEnabled)
     return NS_ERROR_NOT_AVAILABLE;
 
   if (!HasGeolocationProvider())
     return NS_ERROR_NOT_AVAILABLE;
   
   // if we have one, start it up.
 
   // Start them up!
@@ -825,17 +825,17 @@ nsGeolocation::Update(nsIDOMGeoPosition 
 
 NS_IMETHODIMP
 nsGeolocation::GetCurrentPosition(nsIDOMGeoPositionCallback *callback,
                                   nsIDOMGeoPositionErrorCallback *errorCallback,
                                   nsIDOMGeoPositionOptions *options)
 {
   NS_ENSURE_ARG_POINTER(callback);
 
-  if (sGeoEnabled == PR_FALSE)
+  if (!sGeoEnabled)
     return NS_ERROR_NOT_AVAILABLE;
 
   if (mPendingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW)
     return NS_ERROR_NOT_AVAILABLE;
 
   nsRefPtr<nsGeolocationRequest> request = new nsGeolocationRequest(this, callback, errorCallback, options);
   if (!request)
     return NS_ERROR_OUT_OF_MEMORY;
@@ -869,17 +869,17 @@ NS_IMETHODIMP
 nsGeolocation::WatchPosition(nsIDOMGeoPositionCallback *callback,
                              nsIDOMGeoPositionErrorCallback *errorCallback,
                              nsIDOMGeoPositionOptions *options,
                              PRInt32 *_retval NS_OUTPARAM)
 {
 
   NS_ENSURE_ARG_POINTER(callback);
 
-  if (sGeoEnabled == PR_FALSE)
+  if (!sGeoEnabled)
     return NS_ERROR_NOT_AVAILABLE;
 
   if (mPendingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW)
     return NS_ERROR_NOT_AVAILABLE;
 
   nsRefPtr<nsGeolocationRequest> request = new nsGeolocationRequest(this, callback, errorCallback, options);
   if (!request)
     return NS_ERROR_OUT_OF_MEMORY;
--- a/intl/chardet/src/nsDebugDetector.cpp
+++ b/intl/chardet/src/nsDebugDetector.cpp
@@ -66,17 +66,17 @@ NS_IMETHODIMP nsDebugDetector::Init(nsIC
   mObserver = aObserver;
   return NS_OK;
 }
 //--------------------------------------------------------------------
 
 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;
 
   mBlks++;
   if((k1stBlk == mSel) && (1 == mBlks)) {
      *oDontFeedMe = mStop = PR_TRUE;
      Report();
--- a/intl/chardet/src/nsMetaCharsetObserver.cpp
+++ b/intl/chardet/src/nsMetaCharsetObserver.cpp
@@ -397,17 +397,17 @@ NS_IMETHODIMP nsMetaCharsetObserver::Obs
   return rv;
 }
 
 //-------------------------------------------------------------------------
 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));
 
     if (NS_FAILED(rv))
       return rv;
 
     rv = parserService->RegisterObserver(this,
@@ -416,17 +416,17 @@ NS_IMETHODIMP nsMetaCharsetObserver::Sta
   }
 
   return rv;
 }
 //-------------------------------------------------------------------------
 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));
 
     if (NS_FAILED(rv))
       return rv;
     
     rv = parserService->UnregisterObserver(this, NS_LITERAL_STRING("text/html"));
--- a/intl/chardet/src/nsXMLEncodingObserver.cpp
+++ b/intl/chardet/src/nsXMLEncodingObserver.cpp
@@ -63,17 +63,17 @@ static const eHTMLTags gTags[] =
 nsXMLEncodingObserver::nsXMLEncodingObserver()
 {
   bXMLEncodingObserverStarted = PR_FALSE;
 }
 //-------------------------------------------------------------------------
 nsXMLEncodingObserver::~nsXMLEncodingObserver()
 {
   // call to end the ObserverService
-  if (bXMLEncodingObserverStarted == PR_TRUE) {
+  if (bXMLEncodingObserverStarted) {
     End();
   }
 }
 
 //-------------------------------------------------------------------------
 NS_IMPL_ADDREF ( nsXMLEncodingObserver )
 NS_IMPL_RELEASE ( nsXMLEncodingObserver )
 
@@ -195,17 +195,17 @@ NS_IMETHODIMP nsXMLEncodingObserver::Obs
 {
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 //-------------------------------------------------------------------------
 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);
 
     if (NS_SUCCEEDED(res)) {
       res = anObserverService->AddObserver(this, "xmlparser", PR_TRUE);
 
       bXMLEncodingObserverStarted = PR_TRUE;
@@ -213,17 +213,17 @@ NS_IMETHODIMP nsXMLEncodingObserver::Sta
 
     return res;
 }
 //-------------------------------------------------------------------------
 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);
     if (NS_SUCCEEDED(res)) {
       res = anObserverService->RemoveObserver(this, "xmlparser");
 
       bXMLEncodingObserverStarted = PR_FALSE;
     }
--- a/js/src/xpconnect/tools/src/nsXPCToolsProfiler.cpp
+++ b/js/src/xpconnect/tools/src/nsXPCToolsProfiler.cpp
@@ -200,17 +200,17 @@ xpctools_InterpreterHook(JSContext *cx, 
     {
         nsXPCToolsProfiler* self = (nsXPCToolsProfiler*) closure;    
 
         PR_Lock(self->mLock);
 
         ProfilerFunction* fun;
         if (self->mScriptTable.Get(script, &fun))
         {
-            if(before == PR_TRUE)
+            if(before)
             {
                 fun->IncrementCallCount();
                 fun->SetStartTime();
             }
             else
             {
                 PRUint32 delta = fun->SetEndTime();
 
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -839,17 +839,17 @@ nsPresContext::UpdateAfterPreferencesCha
   }
 
   RebuildAllStyleData(hint);
 }
 
 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;
   NS_ADDREF(mDeviceContext);
 
   if (mDeviceContext->SetPixelScale(mFullZoom))
     mDeviceContext->FlushFontCache();
   mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
@@ -1252,17 +1252,17 @@ nsPresContext::SetFullZoom(float aZoom)
   nscoord oldWidthAppUnits, oldHeightAppUnits;
   mShell->GetViewManager()->GetWindowDimensions(&oldWidthAppUnits, &oldHeightAppUnits);
   float oldWidthDevPixels = oldWidthAppUnits / float(mCurAppUnitsPerDevPixel);
   float oldHeightDevPixels = oldHeightAppUnits / float(mCurAppUnitsPerDevPixel);
   if (mDeviceContext->SetPixelScale(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;
   mShell->GetViewManager()->
     SetWindowDimensions(NSToCoordRound(oldWidthDevPixels * AppUnitsPerDevPixel()),
                         NSToCoordRound(oldHeightDevPixels * AppUnitsPerDevPixel()));
   if (HasCachedStyleData()) {
     MediaFeatureValuesChanged(PR_TRUE);
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1448,17 +1448,17 @@ PRBool nsListControlFrame::CheckIfAllFra
 NS_IMETHODIMP
 nsListControlFrame::DoneAddingChildren(PRBool aIsDone)
 {
   mIsAllContentHere = aIsDone;
   if (mIsAllContentHere) {
     // 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;
         ResetList(PR_TRUE);
       }
     }
   }
   return NS_OK;
--- a/layout/generic/nsImageMap.cpp
+++ b/layout/generic/nsImageMap.cpp
@@ -216,39 +216,39 @@ void Area::ParseCoords(const nsAString& 
        * Skip to the end of the separator, noting if we have a
        * comma.
        */
       has_comma = PR_FALSE;
       while (is_space(*tptr) || *tptr == ',')
       {
         if (*tptr == ',')
         {
-          if (has_comma == PR_FALSE)
+          if (!has_comma)
           {
             has_comma = PR_TRUE;
           }
           else
           {
             break;
           }
         }
         tptr++;
       }
       /*
        * If this was trailing whitespace we skipped, we are done.
        */
-      if ((*tptr == '\0')&&(has_comma == PR_FALSE))
+      if ((*tptr == '\0') && !has_comma)
       {
         break;
       }
       /*
        * 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 = ',';
       }
 
       /*
        * count the entry skipped.
        */
       cnt++;
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -1353,17 +1353,17 @@ CSSParserImpl::GetURLInParens(nsString& 
   }
 
   return PR_TRUE;
 }
 
 void
 CSSParserImpl::UngetToken()
 {
-  NS_PRECONDITION(mHavePushBack == PR_FALSE, "double pushback");
+  NS_PRECONDITION(!mHavePushBack, "double pushback");
   mHavePushBack = PR_TRUE;
 }
 
 PRBool
 CSSParserImpl::ExpectSymbol(PRUnichar aSymbol,
                             PRBool aSkipWS)
 {
   if (!GetToken(aSkipWS)) {
--- a/layout/svg/base/src/nsSVGClipPathFrame.h
+++ b/layout/svg/base/src/nsSVGClipPathFrame.h
@@ -94,17 +94,17 @@ public:
   // automatically sets and clears the mInUse flag on the clip path frame
   // (to prevent nasty reference loops). It's easy to mess this up
   // and break things, so this helper makes the code far more robust.
   class AutoClipPathReferencer
   {
   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() {
       mFrame->mInUse = PR_FALSE;
     }
   private:
     nsSVGClipPathFrame *mFrame;
   };
--- a/layout/svg/base/src/nsSVGMaskFrame.h
+++ b/layout/svg/base/src/nsSVGMaskFrame.h
@@ -89,17 +89,17 @@ private:
   // automatically sets and clears the mInUse flag on the mask frame
   // (to prevent nasty reference loops). It's easy to mess this up
   // and break things, so this helper makes the code far more robust.
   class AutoMaskReferencer
   {
   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() {
       mFrame->mInUse = PR_FALSE;
     }
   private:
     nsSVGMaskFrame *mFrame;
   };
--- a/netwerk/cache/src/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/src/nsDiskCacheStreams.cpp
@@ -742,17 +742,17 @@ nsDiskCacheStreamIO::FlushBufferToFile()
     return NS_OK;
 }
 
 
 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;
         mBufEnd = 0;
         mBufSize = 0;
     }
 }
 
--- a/netwerk/cache/src/nsMemoryCacheDevice.cpp
+++ b/netwerk/cache/src/nsMemoryCacheDevice.cpp
@@ -102,17 +102,17 @@ nsMemoryCacheDevice::Shutdown()
     mMemCacheEntries.Shutdown();
 
     // evict all entries
     nsCacheEntry * entry, * next;
 
     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);
         
             // update statistics
             PRInt32 memoryRecovered = (PRInt32)entry->Size();
             mTotalSize    -= memoryRecovered;
             mInactiveSize -= memoryRecovered;
             --mEntryCount;
--- a/netwerk/streamconv/converters/nsDirIndexParser.cpp
+++ b/netwerk/streamconv/converters/nsDirIndexParser.cpp
@@ -310,17 +310,17 @@ nsDirIndexParser::ParseData(nsIDirIndex 
             success = PR_TRUE;
           }
           NS_Free(result);
         } else {
           NS_WARNING("UnEscapeAndConvert error");
         }
       }
       
-      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?
         // when can we fail to get the service, anyway? - bbaetz
         aIdx->SetLocation(filename.get());
         if (!mHasDescription) {
           aIdx->SetDescription(NS_ConvertUTF8toUTF16(value).get());
         }
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp
+++ b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp
@@ -80,17 +80,17 @@ nsHTTPCompressConv::~nsHTTPCompressConv(
     if (mInpBuffer)
         nsMemory::Free(mInpBuffer);
 
     if (mOutBuffer)
         nsMemory::Free(mOutBuffer);
 
     // 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);
 }
 
 NS_IMETHODIMP
 nsHTTPCompressConv::AsyncConvertData(const char *aFromType, 
                                      const char *aToType, 
                                      nsIStreamListener *aListener, 
                                      nsISupports *aCtxt)
--- a/netwerk/wifi/src/nsWifiScannerMac.cpp
+++ b/netwerk/wifi/src/nsWifiScannerMac.cpp
@@ -123,17 +123,17 @@ nsWifiMonitor::DoScanWithCoreWLAN()
     }
 
     // wait for some reasonable amount of time.  pref?
     LOG(("waiting on monitor\n"));
     
     nsAutoMonitor mon(mMonitor);
     mon.Wait(PR_SecondsToInterval(60));
   }
-  while (mKeepGoing == PR_TRUE);
+  while (mKeepGoing);
   
   return NS_OK;
 }
 
 nsresult
 nsWifiMonitor::DoScanOld()
 {
   void *apple_80211_library = dlopen(
@@ -259,17 +259,17 @@ nsWifiMonitor::DoScanOld()
     }
 
     // wait for some reasonable amount of time.  pref?
     LOG(("waiting on monitor\n"));
     
     nsAutoMonitor mon(mMonitor);
     mon.Wait(PR_SecondsToInterval(60));
   }
-  while (mKeepGoing == PR_TRUE);
+  while (mKeepGoing);
   
   (*WirelessDetach_function_)(wifi_context_);
   
   dlclose(apple_80211_library);
   
   return NS_OK;
 }
 
--- a/netwerk/wifi/src/nsWifiScannerUnix.cpp
+++ b/netwerk/wifi/src/nsWifiScannerUnix.cpp
@@ -156,17 +156,17 @@ nsWifiMonitor::DoScan()
     return NS_ERROR_FAILURE;
   }
 
   nsCOMArray<nsWifiAccessPoint> lastAccessPoints;
   nsCOMArray<nsWifiAccessPoint> accessPoints;
 
   char* args[] = {(char*) &accessPoints, (char*) iw_stats, nsnull };
  
-  while (mKeepGoing == PR_TRUE) {
+  while (mKeepGoing) {
 
     accessPoints.Clear();
 
     (*iw_enum)(skfd, &scan_wifi, args, 1);
     
     PRBool accessPointsChanged = !AccessPointsEqual(accessPoints, lastAccessPoints);
     nsCOMArray<nsIWifiListener> currentListeners;
 
--- a/netwerk/wifi/src/nsWifiScannerWin.cpp
+++ b/netwerk/wifi/src/nsWifiScannerWin.cpp
@@ -540,17 +540,17 @@ nsWifiMonitor::DoScan()
     }
     
     // wait for some reasonable amount of time.  pref?
     LOG(("waiting on monitor\n"));
     
     nsAutoMonitor mon(mMonitor);
     mon.Wait(PR_SecondsToInterval(60));
   }
-  while (mKeepGoing == PR_TRUE);
+  while (mKeepGoing);
 
 
 
 #ifdef WINCE
     //Clean up
     CloseHandle(ndis_handle);
 #else
   }
@@ -697,13 +697,13 @@ nsWifiMonitor::DoScan()
       }
       
       // wait for some reasonable amount of time.  pref?
       LOG(("waiting on monitor\n"));
       
       nsAutoMonitor mon(mMonitor);
       mon.Wait(PR_SecondsToInterval(60));
     }
-    while (mKeepGoing == PR_TRUE);
+    while (mKeepGoing);
   }
 #endif
   return NS_OK;
 }
--- a/rdf/base/src/nsCompositeDataSource.cpp
+++ b/rdf/base/src/nsCompositeDataSource.cpp
@@ -261,17 +261,17 @@ CompositeEnumeratorImpl::HasMoreElements
             // "Peek" ahead and pull out the next target.
             nsCOMPtr<nsISupports> result;
             rv = mCurrent->GetNext(getter_AddRefs(result));
             if (NS_FAILED(rv)) return rv;
 
             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;
                 for (i = mNext - 1; i >= 0; --i)
                 {
                     nsIRDFDataSource* datasource =
                         mCompositeDataSource->mDataSources[i];
 
@@ -285,47 +285,47 @@ CompositeEnumeratorImpl::HasMoreElements
                 // if so, we've gotta keep looking
                 if (hasNegation)
                 {
                     NS_RELEASE(mResult);
                     continue;
                 }
             }
 
-            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?
                 PRBool alreadyReturned = PR_FALSE;
                 for (i = mAlreadyReturned.Length() - 1; i >= 0; --i)
                 {
                     if (mAlreadyReturned[i] == mResult)
                     {
                         alreadyReturned = PR_TRUE;
                         break;
                     }
                 }
-                if (alreadyReturned == PR_TRUE)
+                if (alreadyReturned)
                 {
                     NS_RELEASE(mResult);
                     continue;
                 }
             }
 
             // If we get here, then we've really found one. It'll
             // remain cached in mResult until GetNext() sucks it out.
             *aResult = PR_TRUE;
 
             // Remember that we returned it, so we don't return duplicates.
 
             // XXX I wonder if we should make unique-checking be
             // 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);
             }
 
             return NS_OK;
         } while (1);
     }
 
@@ -681,29 +681,29 @@ CompositeDataSourceImpl::GetURI(char* *u
 }
 
 NS_IMETHODIMP
 CompositeDataSourceImpl::GetSource(nsIRDFResource* property,
                                    nsIRDFNode* target,
                                    PRBool tv,
                                    nsIRDFResource** source)
 {
-	if ((mAllowNegativeAssertions == PR_FALSE) && (tv == PR_FALSE))
+	if (!mAllowNegativeAssertions && !tv)
 		return(NS_RDF_NO_VALUE);
 
     PRInt32 count = mDataSources.Count();
     for (PRInt32 i = 0; i < count; ++i) {
         nsresult rv;
         rv = mDataSources[i]->GetSource(property, target, tv, source);
         if (NS_FAILED(rv)) return rv;
 
         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
         if (!HasAssertionN(count-1, *source, property, target, !tv)) 
             return NS_OK;
 
         NS_RELEASE(*source);
         return NS_RDF_NO_VALUE;
@@ -724,17 +724,17 @@ CompositeDataSourceImpl::GetSources(nsIR
     NS_PRECONDITION(aTarget != nsnull, "null ptr");
     if (! aTarget)
         return NS_ERROR_NULL_POINTER;
 
     NS_PRECONDITION(aResult != nsnull, "null ptr");
     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,
                                                         this, nsnull, aProperty,
                                                         aTarget, aTruthValue,
                                                         mAllowNegativeAssertions,
                                                         mCoalesceDuplicateArcs);
 
@@ -758,32 +758,32 @@ CompositeDataSourceImpl::GetTarget(nsIRD
     NS_PRECONDITION(aProperty != nsnull, "null ptr");
     if (! aProperty)
         return NS_ERROR_NULL_POINTER;
 
     NS_PRECONDITION(aResult != nsnull, "null ptr");
     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();
     for (PRInt32 i = 0; i < count; ++i) {
         nsresult rv;
         rv = mDataSources[i]->GetTarget(aSource, aProperty, aTruthValue,
                                         aResult);
         if (NS_FAILED(rv))
             return rv;
 
         if (rv == NS_OK) {
             // 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);
                     return NS_RDF_NO_VALUE;
                 }
             }
             return NS_OK;
         }
@@ -830,17 +830,17 @@ CompositeDataSourceImpl::GetTargets(nsIR
     NS_PRECONDITION(aProperty != nsnull, "null ptr");
     if (! aProperty)
         return NS_ERROR_NULL_POINTER;
 
     NS_PRECONDITION(aResult != nsnull, "null ptr");
     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, this,
                                                  aSource, aProperty, nsnull,
                                                  aTruthValue,
                                                  mAllowNegativeAssertions,
                                                  mCoalesceDuplicateArcs);
@@ -865,17 +865,17 @@ CompositeDataSourceImpl::Assert(nsIRDFRe
     NS_PRECONDITION(aProperty != nsnull, "null ptr");
     if (! aProperty)
         return NS_ERROR_NULL_POINTER;
 
     NS_PRECONDITION(aTarget != nsnull, "null ptr");
     if (! aTarget)
         return NS_ERROR_NULL_POINTER;
 
-    if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE))
+    if (! mAllowNegativeAssertions && ! aTruthValue)
         return(NS_RDF_ASSERTION_REJECTED);
 
     nsresult rv;
 
     // XXX Need to add back the stuff for unblocking ...
 
     // We iterate backwards from the last data source which was added
     // ("the most remote") to the first ("the most local"), trying to
@@ -1061,17 +1061,17 @@ CompositeDataSourceImpl::HasAssertion(ns
     NS_PRECONDITION(aProperty != nsnull, "null ptr");
     if (! aProperty)
         return NS_ERROR_NULL_POINTER;
 
     NS_PRECONDITION(aResult != nsnull, "null ptr");
     if (! aResult)
         return NS_ERROR_NULL_POINTER;
 
-    if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE))
+    if (! mAllowNegativeAssertions && ! aTruthValue)
     {
         *aResult = PR_FALSE;
         return(NS_OK);
     }
 
     nsresult rv;
 
     // Otherwise, look through all the data sources to see if anyone
@@ -1080,17 +1080,17 @@ CompositeDataSourceImpl::HasAssertion(ns
     for (PRInt32 i = 0; i < count; ++i) {
         nsIRDFDataSource* datasource = mDataSources[i];
         rv = datasource->HasAssertion(aSource, aProperty, aTarget, aTruthValue, aResult);
         if (NS_FAILED(rv)) return rv;
 
         if (*aResult)
             return NS_OK;
 
-        if (mAllowNegativeAssertions == PR_TRUE)
+        if (mAllowNegativeAssertions)
         {
             PRBool hasNegation;
             rv = datasource->HasAssertion(aSource, aProperty, aTarget, !aTruthValue, &hasNegation);
             if (NS_FAILED(rv)) return rv;
 
             if (hasNegation)
             {
                 *aResult = PR_FALSE;
@@ -1133,32 +1133,32 @@ NS_IMETHODIMP
 CompositeDataSourceImpl::HasArcIn(nsIRDFNode *aNode, nsIRDFResource *aArc, PRBool *result)
 {
     nsresult rv;
     *result = PR_FALSE;
     PRInt32 count = mDataSources.Count();
     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;
 }
 
 NS_IMETHODIMP 
 CompositeDataSourceImpl::HasArcOut(nsIRDFResource *aSource, nsIRDFResource *aArc, PRBool *result)
 {
     nsresult rv;
     *result = PR_FALSE;
     PRInt32 count = mDataSources.Count();
     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;
 }
 
 NS_IMETHODIMP
 CompositeDataSourceImpl::ArcLabelsIn(nsIRDFNode* aTarget, nsISimpleEnumerator** aResult)
 {
@@ -1230,17 +1230,18 @@ CompositeDataSourceImpl::GetAllCmds(nsIR
     for (PRInt32 i = 0; i < mDataSources.Count(); i++)
     {
         nsCOMPtr<nsISimpleEnumerator> dsCmds;
 
         rv = mDataSources[i]->GetAllCmds(source, getter_AddRefs(dsCmds));
         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))))
                 {
                     // rjc: do NOT strip out duplicate commands here
                     // (due to items such as separators, it is done at a higher level)
                     cmdArray->AppendElement(item);
                 }
@@ -1392,17 +1393,17 @@ CompositeDataSourceImpl::OnAssert(nsIRDF
     // datasource.
     //
     // XXX We could make this more efficient if we knew _which_
     // datasource actually served up the OnAssert(): we could use
     // HasAssertionN() to only search datasources _before_ the
     // 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);
 		if (NS_FAILED(rv)) return rv;
 
 		if (! hasAssertion)
 			return(NS_OK);
 	}
@@ -1423,17 +1424,17 @@ CompositeDataSourceImpl::OnUnassert(nsIR
     // same assertion in a different datasource.
     //
     // XXX We could make this more efficient if we knew _which_
     // datasource actually served up the OnAssert(): we could use
     // HasAssertionN() to only search datasources _before_ the
     // datasource that coughed up the assertion.
     nsresult rv;
 
-	if (mAllowNegativeAssertions == PR_TRUE)
+	if (mAllowNegativeAssertions)
 	{   
 		PRBool hasAssertion;
 		rv = HasAssertion(aSource, aProperty, aTarget, PR_TRUE, &hasAssertion);
 		if (NS_FAILED(rv)) return rv;
 
 		if (hasAssertion)
 			return NS_OK;
 	}
--- a/rdf/base/src/nsRDFContainer.cpp
+++ b/rdf/base/src/nsRDFContainer.cpp
@@ -536,17 +536,17 @@ RDFContainerImpl::Renumber(PRInt32 aStar
     // enabling notifications
     nsCOMPtr<nsIRDFPropagatableDataSource> propagatable =
         do_QueryInterface(mDataSource);
     if (propagatable) {
         propagatable->SetPropagateChanges(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;
         rv = gRDFContainerUtils->IndexToOrdinalResource(i, getter_AddRefs(oldOrdinal));
         if (NS_FAILED(rv))
         {
             err = PR_TRUE;
             continue;
         }
@@ -615,17 +615,17 @@ RDFContainerImpl::Renumber(PRInt32 aStar
                 err = PR_TRUE;
                 break;
             }
         }
 
         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
         // until this point, we'll want people to be able to find
         // things that are still "at the end".
         rv = SetNextValue(count + aIncrement + 1);
         if (NS_FAILED(rv))
         {
@@ -633,17 +633,17 @@ RDFContainerImpl::Renumber(PRInt32 aStar
         }
     }
 
     // Note: MUST enable notifications before exiting this method
     if (propagatable) {
         propagatable->SetPropagateChanges(PR_TRUE);
     }
 
-    if (err == PR_TRUE) return(rv);
+    if (err) return(rv);
 
     return NS_OK;
 }
 
 
 
 nsresult
 RDFContainerImpl::SetNextValue(PRInt32 aIndex)
--- a/rdf/base/src/nsRDFContainerUtils.cpp
+++ b/rdf/base/src/nsRDFContainerUtils.cpp
@@ -434,17 +434,17 @@ RDFContainerUtilsImpl::MakeContainer(nsI
     nsresult rv;
 
     // Check to see if somebody has already turned it into a container; if so
     // don't try to do it again.
     PRBool isContainer;
     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;
 
 	rv = aDataSource->Assert(aResource, kRDF_nextVal, kOne, PR_TRUE);
 	if (NS_FAILED(rv)) return rv;
     }
 
--- a/rdf/datasource/src/nsFileSystemDataSource.cpp
+++ b/rdf/datasource/src/nsFileSystemDataSource.cpp
@@ -134,17 +134,17 @@ FileSystemDataSource::isDirURI(nsIRDFRes
 
 #ifdef  XP_MAC
     // Hide directory structure of packages under Mac OS 9/X
     nsCOMPtr<nsILocalFileMac>   aMacFile = do_QueryInterface(aDir);
     if (aMacFile)
     {
         PRBool isPackageFlag = PR_FALSE;
         rv = aMacFile->IsPackage(&isPackageFlag);
-        if (NS_SUCCEEDED(rv) && (isPackageFlag == PR_TRUE))
+        if (NS_SUCCEEDED(rv) && isPackageFlag)
         {
             isDirFlag = PR_FALSE;
         }
     }
 #endif
 
     return(isDirFlag);
 }
@@ -793,17 +793,17 @@ FileSystemDataSource::ArcLabelsOut(nsIRD
     {
         nsCOMPtr<nsISupportsArray> array;
         rv = NS_NewISupportsArray(getter_AddRefs(array));
         if (NS_FAILED(rv)) return rv;
 
         if (isDirURI(source))
         {
 #ifdef  XP_WIN
-            if (isValidFolder(source) == PR_TRUE)
+            if (isValidFolder(source))
             {
                 array->AppendElement(mNC_Child);
             }
 #else
             array->AppendElement(mNC_Child);
 #endif
             array->AppendElement(mNC_pulse);
         }
@@ -978,17 +978,17 @@ FileSystemDataSource::isValidFolder(nsIR
     {
         isValid = PR_FALSE;
 
         nsCOMPtr<nsISimpleEnumerator>   folderEnum;
         if (NS_SUCCEEDED(rv = GetFolderList(source, PR_TRUE, PR_FALSE, getter_AddRefs(folderEnum))))
         {
             PRBool      hasAny = PR_FALSE, hasMore;
             while (NS_SUCCEEDED(folderEnum->HasMoreElements(&hasMore)) &&
-                    (hasMore == PR_TRUE))
+                   hasMore)
             {
                 hasAny = PR_TRUE;
 
                 nsCOMPtr<nsISupports>       isupports;
                 if (NS_FAILED(rv = folderEnum->GetNext(getter_AddRefs(isupports))))
                     break;
                 nsCOMPtr<nsIRDFResource>    res = do_QueryInterface(isupports);
                 if (!res)   break;
@@ -1005,17 +1005,17 @@ FileSystemDataSource::isValidFolder(nsIR
                 // An empty folder, or a folder that contains just "desktop.ini",
                 // is considered to be a IE Favorite; otherwise, its a folder
                 if (!name.LowerCaseEqualsLiteral("desktop.ini"))
                 {
                     isValid = PR_TRUE;
                     break;
                 }
             }
-            if (hasAny == PR_FALSE) isValid = PR_TRUE;
+            if (!hasAny) isValid = PR_TRUE;
         }
     }
     return(isValid);
 }
 #endif
 
 
 
@@ -1060,32 +1060,32 @@ FileSystemDataSource::GetFolderList(nsIR
     nsCOMPtr<nsISimpleEnumerator>   dirContents;
     if (NS_FAILED(rv = aDir->GetDirectoryEntries(getter_AddRefs(dirContents))))
         return(rv);
     if (!dirContents)
         return(NS_ERROR_UNEXPECTED);
 
     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))))
             break;
 
         nsCOMPtr<nsIFile>   aFile = do_QueryInterface(isupports);
         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;
         }
 
         nsAutoString leafStr;
         if (NS_FAILED(rv = aFile->GetLeafName(leafStr)))
             break;
         if (leafStr.IsEmpty())
             continue;
@@ -1115,27 +1115,27 @@ FileSystemDataSource::GetFolderList(nsIR
             leaf.Insert("%2F", (PRUint32)aOffset);
         }
 
         // append the encoded name
         fullURI.Append(leaf);
 
         PRBool          dirFlag = PR_FALSE;
         rv = aFile->IsDirectory(&dirFlag);
-        if (NS_SUCCEEDED(rv) && (dirFlag == PR_TRUE))
+        if (NS_SUCCEEDED(rv) && dirFlag)
         {
             fullURI.Append('/');
         }
 
         nsCOMPtr<nsIRDFResource>    fileRes;
         mRDFService->GetResource(fullURI, getter_AddRefs(fileRes));
 
         nameArray->AppendElement(fileRes);
 
-        if (onlyFirst == PR_TRUE)
+        if (onlyFirst)
             break;
     }
 
     return NS_NewArrayEnumerator(aResult, nameArray);
 }
 
 nsresult
 FileSystemDataSource::GetLastMod(nsIRDFResource *source, nsIRDFDate **aResult)
@@ -1217,17 +1217,17 @@ FileSystemDataSource::GetFileSize(nsIRDF
     nsCOMPtr<nsILocalFile>  aFileLocal = do_QueryInterface(aFile);
     if (aFileLocal)
         aFileLocal->SetFollowLinks(PR_FALSE);
 
     // don't do anything with directories
     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;
 #ifdef  XP_MAC
     // on Mac, get total file size (data + resource fork)
     nsCOMPtr<nsILocalFileMac>   aMacFile = do_QueryInterface(aFile);
     if (!aMacFile)
         return(NS_ERROR_UNEXPECTED);
@@ -1287,17 +1287,17 @@ FileSystemDataSource::GetName(nsIRDFReso
         return(NS_ERROR_UNEXPECTED);
 
 #ifdef  XP_MAC
     nsCOMPtr<nsILocalFileMac>   aMacFile = do_QueryInterface(aFile);
     if (aMacFile)
     {
         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();
             if (name.RFind(".app", PR_TRUE) == len - 4)
             {
                 name.SetLength(len-4);
             }
         }
--- a/tools/trace-malloc/spacecategory.c
+++ b/tools/trace-malloc/spacecategory.c
@@ -752,17 +752,17 @@ walkTree(STCategoryNode * root, STCatego
 
     nodes[0] = root;
     begin = 0;
     end = 1;
     ncurdepth = 1;
     while (begin != end) {
         node = nodes[begin];
         ret = (*func) (inRequest, inOptions, inContext, clientData, node);
-        if (ret == PR_FALSE) {
+        if (!ret) {
             /* Abort */
             break;
         }
         begin = MODINC(begin, 1024);
         for (i = 0; i < node->nchildren; i++) {
             nodes[end] = node->children[i];
             end = MODINC(end, 1024);
         }
--- a/widget/src/beos/nsDragService.cpp
+++ b/widget/src/beos/nsDragService.cpp
@@ -342,17 +342,17 @@ nsDragService::EndDragSession(PRBool aDo
 //
 // We overwrite this so we can log it
 //
 //-------------------------------------------------------------------------
 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);
 }
 
 
 //-------------------------------------------------------------------------
 //
 // nsIDragSession : GetCanDrop
 //
@@ -645,17 +645,17 @@ nsDragService::CreateDragMessage()
     }
     
     if (addedType)
     {
         returnMsg->AddString("be:types", B_FILE_MIME_TYPE);
     }
     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;
 }
 
 //-------------------------------------------------------------------------
 //
 // nsIDragSessionBeOS : UpdateDragMessageIfNeeded
 //
 // Updates the drag message from the old one if we enter a mozilla view with
--- a/widget/src/beos/nsPopupWindow.cpp
+++ b/widget/src/beos/nsPopupWindow.cpp
@@ -169,15 +169,15 @@ nsresult nsPopupWindow::StandardWindowCr
 	w->Run();	
 	DispatchStandardEvent(NS_CREATE);
 	return NS_OK;
 }
 
 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);
 }
 
 
--- a/widget/src/beos/nsToolkit.cpp
+++ b/widget/src/beos/nsToolkit.cpp
@@ -163,17 +163,17 @@ void nsToolkit::CreateUIThread()
                                    RunPump,
                                    (void*)ti,
                                    PR_PRIORITY_HIGH,
                                    PR_LOCAL_THREAD,
                                    PR_UNJOINABLE_THREAD,
                                    0);
 
     // wait for the gui thread to start
-    while(gThreadState == PR_FALSE)
+    while(!gThreadState)
     {
       PR_Wait(monitor, PR_INTERVAL_NO_TIMEOUT);
     }
   }
     
   // at this point the thread is running
   PR_ExitMonitor(monitor);
   PR_DestroyMonitor(monitor);
--- a/widget/src/beos/nsWindow.cpp
+++ b/widget/src/beos/nsWindow.cpp
@@ -674,17 +674,17 @@ NS_METHOD nsWindow::Show(PRBool bState)
 	if (!mView || !mView->LockLooper())
 		return NS_OK;
 		
 	//We need to do the IsHidden() checks
 	//because BeOS counts no of Hide()
 	//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();
 	}
 	else
 	{
 		if (mView->Window() && mView->Window()->IsHidden())
 			mView->Window()->Show();
@@ -1089,17 +1089,17 @@ NS_METHOD nsWindow::SetFocus(PRBool aRai
 	
 	// Don't set focus on disabled widgets or popups
 	if (!mEnabled || eWindowType_popup == mWindowType)
 		return NS_OK;
 		
 	if (mView && mView->LockLooper())
 	{
 		if (mView->Window() && 
-		    aRaise == PR_TRUE &&
+		    aRaise &&
 		    eWindowType_popup != mWindowType && 
 			  !mView->Window()->IsActive() && 
 			  gLastActiveWindow != mView->Window())
 			mView->Window()->Activate(true);
 			
 		mView->MakeFocus(true);
 		mView->UnlockLooper();
 	}
--- a/widget/src/gtk2/nsDeviceContextSpecG.cpp
+++ b/widget/src/gtk2/nsDeviceContextSpecG.cpp
@@ -1013,17 +1013,17 @@ void GlobalPrinters::FreeGlobalPrinters(
   }  
 }
 
 void 
 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();
     if (NS_FAILED(rv)) {
       return;
     }
   }
   NS_ASSERTION(GlobalPrinters::GetInstance()->PrintersAreAllocated(), "no GlobalPrinters");
--- a/widget/src/gtk2/nsDragService.cpp
+++ b/widget/src/gtk2/nsDragService.cpp
@@ -831,37 +831,37 @@ nsDragService::IsDataFlavorSupported(con
         name = gdk_atom_name(atom);
         PR_LOG(sDragLm, PR_LOG_DEBUG,
                ("checking %s against %s\n", name, aDataFlavor));
         if (name && (strcmp(name, aDataFlavor) == 0)) {
             PR_LOG(sDragLm, PR_LOG_DEBUG, ("good!\n"));
             *_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)) {
             PR_LOG(sDragLm, PR_LOG_DEBUG,
                    ("good! ( it's text/uri-list and \
                    we're checking against text/x-moz-url )\n"));
             *_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)) {
             PR_LOG(sDragLm, PR_LOG_DEBUG,
                    ("good! ( it's _NETSCAPE_URL and \
                    we're checking against text/x-moz-url )\n"));
             *_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) ||
              (strcmp(aDataFlavor, kFileMime) == 0))) {
             PR_LOG(sDragLm, PR_LOG_DEBUG,
                    ("good! ( it's text plain and we're checking \
                    against text/unicode or application/x-moz-file)\n"));
             *_retval = PR_TRUE;
--- a/widget/src/windows/nsFilePicker.cpp
+++ b/widget/src/windows/nsFilePicker.cpp
@@ -290,17 +290,17 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt1
       MessageBoxW(ofn.hwndOwner,
                   0,
                   L"The filepicker was unexpectedly closed by Windows.",
                   MB_ICONERROR);
       result = PR_FALSE;
     }
 #endif
   
-    if (result == PR_TRUE) {
+    if (result) {
       // Remember what filter type the user selected
       mSelectedType = (PRInt16)ofn.nFilterIndex;
 
       // Set user-selected location of file or directory
       if (mMode == modeOpenMultiple) {
         
         // from msdn.microsoft.com, "Open and Save As Dialog Boxes" section:
         // If you specify OFN_EXPLORER,
--- a/widget/src/windows/nsToolkit.cpp
+++ b/widget/src/windows/nsToolkit.cpp
@@ -289,17 +289,17 @@ void nsToolkit::CreateUIThread()
                                     RunPump,
                                     (void*)ti,
                                     PR_PRIORITY_NORMAL,
                                     PR_LOCAL_THREAD,
                                     PR_UNJOINABLE_THREAD,
                                     0);
 
     // wait for the gui thread to start
-    while(gThreadState == PR_FALSE) {
+    while(!gThreadState) {
         ::PR_Wait(monitor, PR_INTERVAL_NO_TIMEOUT);
     }
 
     // at this point the thread is running
     ::PR_ExitMonitor(monitor);
     ::PR_DestroyMonitor(monitor);
 }
 
--- a/xpcom/io/nsLocalFileOS2.cpp
+++ b/xpcom/io/nsLocalFileOS2.cpp
@@ -1482,17 +1482,17 @@ nsLocalFile::CopyMove(nsIFile *aParentDi
         rv = newParentDir->Create(DIRECTORY_TYPE, 0644);  // TODO, what permissions should we use
         if (NS_FAILED(rv))
             return rv;
     }
     else
     {
         PRBool isDir;
         newParentDir->IsDirectory(&isDir);
-        if (isDir == PR_FALSE)
+        if (!isDir)
         {
             return NS_ERROR_FILE_DESTINATION_NOT_DIR;
         }
     }
 
     // Try different ways to move/copy files/directories
     PRBool done = PR_FALSE;
     PRBool isDir;
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -1535,17 +1535,17 @@ nsLocalFile::CopyMove(nsIFile *aParentDi
         rv = newParentDir->Create(DIRECTORY_TYPE, 0644);  // TODO, what permissions should we use
         if (NS_FAILED(rv))
             return rv;
     }
     else
     {
         PRBool isDir;
         newParentDir->IsDirectory(&isDir);
-        if (isDir == PR_FALSE)
+        if (!isDir)
         {
             if (followSymlinks)
             {
                 PRBool isLink;
                 newParentDir->IsSymlink(&isLink);
                 if (isLink)
                 {
                     nsAutoString target;
--- a/xpcom/io/nsPipe3.cpp
+++ b/xpcom/io/nsPipe3.cpp
@@ -1006,17 +1006,17 @@ nsPipeOutputStream::Wait()
     nsAutoMonitor mon(mPipe->mMonitor);
 
     if (NS_SUCCEEDED(mPipe->mStatus) && !mWritable) {
         LOG(("OOO pipe output: waiting for space\n"));
         mBlocked = PR_TRUE;
         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;
 }
 
 PRBool
 nsPipeOutputStream::OnOutputWritable(nsPipeEvents &events)
 {
--- a/xpcom/tests/RegFactory.cpp
+++ b/xpcom/tests/RegFactory.cpp
@@ -105,17 +105,17 @@ int ProcessArgs(nsIComponentRegistrar* r
           gUnreg = PR_TRUE;
           break;
         default:
           cerr << "Unknown option '" << argv[i][j] << "'\n";
         }
       }
       i++;
     } else {
-      if (gUnreg == PR_TRUE) {
+      if (gUnreg) {
         res = Unregister(argv[i]);
         if (NS_SUCCEEDED(res)) {
           cout << "Successfully unregistered: " << argv[i] << "\n";
         } else {
           cerr << "Unregister failed (";
           print_err(res);
           cerr << "): " << argv[i] << "\n";
         }
--- a/xpcom/tests/nsIFileEnumerator.cpp
+++ b/xpcom/tests/nsIFileEnumerator.cpp
@@ -37,17 +37,17 @@ PRBool LoopInDir(nsILocalFile* file)
         printf("%s\n", name.get());
         rv = file->IsDirectory(&isDir);
         if (NS_FAILED(rv))
 		{
 			printf("IsDirectory Failed!!!\n");
 				return PR_FALSE;
 		}
 
-		if (isDir == PR_TRUE)
+		if (isDir)
         {
            nsCOMPtr<nsILocalFile> lfile = do_QueryInterface(file);
            LoopInDir(lfile);   
         }        
     }
     return PR_TRUE;
 }
 
--- a/xpcom/tests/windows/TestCOM.cpp
+++ b/xpcom/tests/windows/TestCOM.cpp
@@ -109,17 +109,17 @@ public:
   }
   
   NS_IMETHOD CreateInstance(nsISupports *aOuter,
                             const nsIID &aIID,
                             void **aResult);
 
   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;
   }
 };
 
 NS_IMPL_ISUPPORTS1(nsTestComFactory, nsIFactory)
 
 nsresult nsTestComFactory::CreateInstance(nsISupports *aOuter,