Bug 794186 - remove remaining PRInt32/PRUint32 usages in comm-central. r=standard8
authoraceman <acelists@atlas.sk>
Thu, 27 Sep 2012 21:41:16 +0100
changeset 11143 b25b81b354c2989183c5241453440651ef86e195
parent 11142 bb45e728a12eb5e62ad4886ffe589364bbf7445a
child 11144 d8e9fe83bd2bdd70839d681f36ede0b8c3d1be97
push id8358
push userbugzilla@standard8.plus.com
push dateThu, 27 Sep 2012 20:41:46 +0000
treeherdercomm-central@b25b81b354c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstandard8
bugs794186
Bug 794186 - remove remaining PRInt32/PRUint32 usages in comm-central. r=standard8
mailnews/base/src/nsMsgAccount.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/news/src/nsNewsFolder.cpp
--- a/mailnews/base/src/nsMsgAccount.cpp
+++ b/mailnews/base/src/nsMsgAccount.cpp
@@ -255,17 +255,17 @@ nsMsgAccount::GetDefaultIdentity(nsIMsgI
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgAccount::SetDefaultIdentity(nsIMsgIdentity *aDefaultIdentity)
 {
   NS_ENSURE_TRUE(m_identities, NS_ERROR_FAILURE);
 
-  PRInt32 position = m_identities->IndexOf(aDefaultIdentity);
+  int32_t position = m_identities->IndexOf(aDefaultIdentity);
   NS_ASSERTION(position != -1, "Where did that identity come from?!");
   NS_ENSURE_TRUE(position != -1, NS_ERROR_UNEXPECTED);
 
   // The passed in identity is in the list, so we have at least one element.
   m_identities->MoveElement(position, 0);
 
   return saveIdentitiesPref();
 }
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -385,34 +385,34 @@ nsMsgAccountManager::GetUniqueServerKey(
     if (NS_FAILED(rv))
       usePrefsScan = false;
   }
 
   if (usePrefsScan)
   {
     nsAutoCString type;
     nsAutoCString typeKey;
-    for (PRInt32 lastKey = 1; ; lastKey++)
+    for (uint32_t lastKey = 1; ; lastKey++)
     {
       aResult.AssignLiteral(SERVER_PREFIX);
       aResult.AppendInt(lastKey);
       typeKey.Assign(aResult);
       typeKey.AppendLiteral(".type");
       prefBranchServer->GetCharPref(typeKey.get(), getter_Copies(type));
       if (type.IsEmpty()) // a server slot with no type is considered empty
         return;
     }
   }
   else
   {
     // If pref service fails, try to find a free serverX key
     // by checking which keys exist.
     nsAutoCString internalResult;
     nsCOMPtr<nsIMsgIncomingServer> server;
-    PRInt32 i = 1;
+    uint32_t i = 1;
     do {
       aResult.AssignLiteral(SERVER_PREFIX);
       aResult.AppendInt(i++);
       m_incomingServers.Get(aResult, getter_AddRefs(server));
     } while (server);
     return;
   }
 }
@@ -1472,18 +1472,18 @@ nsMsgAccountManager::LoadAccounts()
 
     // See nsIMsgAccount.idl for a description of the secondsToLeaveUnavailable
     //  and timeFoundUnavailable preferences
     nsAutoCString toLeavePref(PREF_MAIL_SERVER_PREFIX);
     toLeavePref.Append(serverKey);
     nsAutoCString unavailablePref(toLeavePref); // this is the server-specific prefix
     unavailablePref.AppendLiteral(".timeFoundUnavailable");
     toLeavePref.AppendLiteral(".secondsToLeaveUnavailable");
-    PRInt32 secondsToLeave = 0;
-    PRInt32 timeUnavailable = 0;
+    int32_t secondsToLeave = 0;
+    int32_t timeUnavailable = 0;
 
     m_prefs->GetIntPref(toLeavePref.get(), &secondsToLeave);
 
     // force load of accounts (need to find a better way to do this)
     nsCOMPtr<nsISupportsArray> identities;
     account->GetIdentities(getter_AddRefs(identities));
 
     rv = account->CreateServer();
@@ -1497,29 +1497,29 @@ nsMsgAccountManager::LoadAccounts()
       }
       // NS_ERROR_NOT_AVAILABLE signifies a server that could not be
       // instantiated, presumably because of an invalid type.
       else if (rv == NS_ERROR_NOT_AVAILABLE)
       {
         m_prefs->GetIntPref(unavailablePref.get(), &timeUnavailable);
         if (!timeUnavailable)
         { // we need to set it, this must be the first time unavailable
-          PRUint32 nowSeconds;
+          uint32_t nowSeconds;
           PRTime2Seconds(PR_Now(), &nowSeconds);
           m_prefs->SetIntPref(unavailablePref.get(), nowSeconds);
           deleteAccount = false;
         }
       }
     }
 
     if (rv == NS_ERROR_NOT_AVAILABLE && timeUnavailable != 0)
     { // Our server is still unavailable. Have we timed out yet?
-      PRUint32 nowSeconds;
+      uint32_t nowSeconds;
       PRTime2Seconds(PR_Now(), &nowSeconds);
-      if ((PRInt32)nowSeconds < timeUnavailable + secondsToLeave)
+      if ((int32_t)nowSeconds < timeUnavailable + secondsToLeave)
         deleteAccount = false;
     }
 
     if (deleteAccount)
     {
       dupAccounts.AppendObject(account);
       m_accounts->RemoveElement(account);
     }
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -806,17 +806,17 @@ nsMsgNewsFolder::UpdateSummaryFromNNTPIn
     // we should handle it gracefully.
     unread = 0;
 
   if (unread > total)
   {
     /* This can happen when the newsrc file shows more unread than exist in the group (total is not necessarily `end - start'.) */
     unread = total;
     int32_t deltaInDB = mNumTotalMessages - mNumUnreadMessages;
-    //PRint32 deltaInDB = m_totalInDB - m_unreadInDB;
+    //int32_t deltaInDB = m_totalInDB - m_unreadInDB;
     /* if we know there are read messages in the db, subtract that from the unread total */
     if (deltaInDB > 0)
       unread -= deltaInDB;
   }
 
   bool dbWasOpen = mDatabase != nullptr;
   int32_t pendingUnreadDelta = unread - mNumUnreadMessages - mNumPendingUnreadMessages;
   int32_t pendingTotalDelta = total - mNumTotalMessages - mNumPendingTotalMessages;