Bug 675485 - Fix PRBool misuses found in a debug build, r=bz,taras
authorMichael Wu <mwu@mozilla.com>
Mon, 01 Aug 2011 18:20:52 -0700
changeset 74425 d11aaaf51059dc7cd2857b7067faa8c8a101c5f0
parent 74424 74f0c17ba7b36c304bcb109d1a8285eeda44c065
child 74426 f43cd1c730f899c4c79a57b4934f1b2c3d9760d1
push id235
push userbzbarsky@mozilla.com
push dateTue, 27 Sep 2011 17:13:04 +0000
treeherdermozilla-beta@2d1e082d176a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, taras
bugs675485
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 675485 - Fix PRBool misuses found in a debug build, r=bz,taras
layout/generic/nsFrame.cpp
startupcache/StartupCache.cpp
tools/trace-malloc/leaksoup.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -198,22 +198,22 @@ PRBool nsFrame::GetShowEventTargetFrameB
 /**
  * Note: the log module is created during library initialization which
  * means that you cannot perform logging before then.
  */
 static PRLogModuleInfo* gLogModule;
 
 static PRLogModuleInfo* gStyleVerifyTreeLogModuleInfo;
 
-static PRBool gStyleVerifyTreeEnable = PRBool(0x55);
+static PRUint32 gStyleVerifyTreeEnable = 0x55;
 
 PRBool
 nsFrame::GetVerifyStyleTreeEnable()
 {
-  if (gStyleVerifyTreeEnable == PRBool(0x55)) {
+  if (gStyleVerifyTreeEnable == 0x55) {
     if (nsnull == gStyleVerifyTreeLogModuleInfo) {
       gStyleVerifyTreeLogModuleInfo = PR_NewLogModule("styleverifytree");
       gStyleVerifyTreeEnable = 0 != gStyleVerifyTreeLogModuleInfo->level;
     }
   }
   return gStyleVerifyTreeEnable;
 }
 
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -505,17 +505,17 @@ StartupCacheDebugOutputStream::CheckRefe
   nsCOMPtr<nsIClassInfo> classInfo = do_QueryInterface(aObject);
   if (!classInfo) {
     NS_ERROR("aObject must implement nsIClassInfo");
     return PR_FALSE;
   }
   
   PRUint32 flags;
   rv = classInfo->GetFlags(&flags);
-  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ENSURE_SUCCESS(rv, PR_FALSE);
   if (flags & nsIClassInfo::SINGLETON)
     return PR_TRUE;
   
   nsISupportsHashKey* key = mObjectMap->GetEntry(aObject);
   if (key) {
     NS_ERROR("non-singleton aObject is referenced multiple times in this" 
                   "serialization, we don't support that.");
     return PR_FALSE;
--- a/tools/trace-malloc/leaksoup.cpp
+++ b/tools/trace-malloc/leaksoup.cpp
@@ -335,17 +335,17 @@ int main(int argc, char **argv)
                count, num_root_nodes, num_sccs);
 
         for (size_t i = 0; i < count; ++i) {
             nodes[i].reached = PR_FALSE;
         }
 
         // Loop over the sorted nodes twice, first printing the roots
         // and then the non-roots.
-        for (PRBool root_type = PR_TRUE;
+        for (PRInt32 root_type = PR_TRUE;
              root_type == PR_TRUE || root_type == PR_FALSE; --root_type) {
             if (root_type) {
                 printf("\n\n"
                        "<div class=\"root\">\n"
                        "<h1 id=\"root\">Root components</h1>\n");
             } else {
                 printf("\n\n"
                        "<div class=\"nonroot\">\n"