Bug 811199 - Port |Bug 794510 - Build with NO_NSPR_10_SUPPORT| to SeaMonkey (part 2) r=Mnyromyr
authorEdmund Wong <ewong@pw-wspx.org>
Sat, 26 Jan 2013 09:50:55 +0800
changeset 14750 d3a3f3f73bcc8429eb0910dfef058df4cb09a27d
parent 14749 4653f81112f94219ebcb0631e37d6f3450b28414
child 14751 8f5c72e852c6ed7906e45ae1881c21a3ef2fcae2
push id867
push userbugzilla@standard8.plus.com
push dateMon, 01 Apr 2013 20:44:27 +0000
treeherdercomm-beta@797726b8d244 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMnyromyr
bugs811199, 794510
Bug 811199 - Port |Bug 794510 - Build with NO_NSPR_10_SUPPORT| to SeaMonkey (part 2) r=Mnyromyr
ldap/xpcom/src/nsLDAPUtils.h
mailnews/Makefile.in
mailnews/base/public/msgCore.h
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/imap/src/nsIMAPGenericParser.cpp
mailnews/imap/src/nsIMAPGenericParser.h
mailnews/imap/src/nsIMAPHostSessionList.cpp
mailnews/imap/src/nsImapFlagAndUidState.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsImapSearchResults.cpp
mailnews/mime/src/mimetpfl.cpp
--- a/ldap/xpcom/src/nsLDAPUtils.h
+++ b/ldap/xpcom/src/nsLDAPUtils.h
@@ -15,17 +15,17 @@
 #define LdapCompressWhitespace(str) \
         (str).CompressWhitespace()
 
 #else // MOZILLA_INTERNAL_API
 /* Frozen linkage helper functions */
 
 /* This macro has been copied from msgcore.h */
 #define IS_SPACE(VAL) \
-  (((((intn)(VAL)) & 0x7f) == ((intn)(VAL))) && isspace((intn)(VAL)))
+  (((((PRIntn)(VAL)) & 0x7f) == ((PRIntn)(VAL))) && isspace((PRIntn)(VAL)))
 
 /* This function has been copied from nsMsgUtils.cpp */
 inline void LdapCompressWhitespace(nsCString& aString)
 {
   // This code is frozen linkage specific
   aString.Trim(" \f\n\r\t\v");
 
   char *start, *end;
--- a/mailnews/Makefile.in
+++ b/mailnews/Makefile.in
@@ -40,16 +40,17 @@ endif
 endif
 
 DIRS += build
 
 PREF_JS_EXPORTS = $(srcdir)/mailnews.js
 
 DEFINES += -DOS_ARCH=$(OS_ARCH) \
            -DMOZ_WIDGET_TOOLKIT=$(MOZ_WIDGET_TOOLKIT) \
+           -DNO_NSPR_10_SUPPORT \
            $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef ENABLE_TESTS
 libs::
 	$(INSTALL) $(wildcard $(srcdir)/test/resources/*.js) $(MOZDEPTH)/_tests/xpcshell/mailnews/resources
 	$(DIR_INSTALL) $(wildcard $(srcdir)/test/data/*) $(MOZDEPTH)/_tests/xpcshell/mailnews/data
--- a/mailnews/base/public/msgCore.h
+++ b/mailnews/base/public/msgCore.h
@@ -5,16 +5,17 @@
 
 /* Include files we are going to want available to all files....these files include
    NSPR, memory, and string header files among others */
 
 #ifndef msgCore_h__
 #define msgCore_h__
 
 #include "nscore.h"
+#include "nspr.h"
 #include "plstr.h"
 #include "nsCRTGlue.h"
 
 class nsIMsgDBHdr;
 class nsIMsgFolder;
 
 // include common interfaces such as the service manager and the repository....
 #include "nsIServiceManager.h"
@@ -62,17 +63,17 @@ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODUL
 #define NS_MSG_GENERATE_FAILURE(value) \
 NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_MAILNEWS, value)
 
 /* these are shortcuts to generate simple errors with a zero value */
 #define NS_MSG_SUCCESS NS_MSG_GENERATE_SUCCESS(0)
 #define NS_MSG_FAILURE NS_MSG_GENERATE_FAILURE(0)
 
 #define IS_SPACE(VAL) \
-  (((((intn)(VAL)) & 0x7f) == ((intn)(VAL))) && isspace((intn)(VAL)))
+  (((((PRIntn)(VAL)) & 0x7f) == ((PRIntn)(VAL))) && isspace((PRIntn)(VAL)))
 
 #define IS_DIGIT(i)   ((((unsigned int) (i)) > 0x7f) ? (int) 0 : isdigit(i))
 #if defined(XP_WIN) || defined(XP_OS2)
 #define IS_ALPHA(VAL) (isascii((int)(VAL)) && isalpha((int)(VAL)))
 #else
 #define IS_ALPHA(VAL) ((((unsigned int) (VAL)) > 0x7f) ? (int) 0 : isalpha((int)(VAL)))
 #endif
 
--- a/mailnews/base/search/src/nsMsgSearchTerm.cpp
+++ b/mailnews/base/search/src/nsMsgSearchTerm.cpp
@@ -272,17 +272,17 @@ nsresult NS_MsgGetStringForOperator(int1
       *string = SearchOperatorEntryTable[idxOp].opName;
       break;
     }
   }
 
   return (found) ? NS_OK : NS_ERROR_INVALID_ARG;
 }
 
-void NS_MsgGetUntranslatedStatusName (uint32 s, nsCString *outName)
+void NS_MsgGetUntranslatedStatusName (uint32_t s, nsCString *outName)
 {
   const char *tmpOutName = NULL;
 #define MSG_STATUS_MASK (nsMsgMessageFlags::Read | nsMsgMessageFlags::Replied |\
   nsMsgMessageFlags::Forwarded | nsMsgMessageFlags::New | nsMsgMessageFlags::Marked)
   uint32_t maskOut = (s & MSG_STATUS_MASK);
 
   // diddle the flags to pay attention to the most important ones first, if multiple
   // flags are set. Should remove this code from the winfe.
@@ -916,17 +916,17 @@ nsresult nsMsgSearchTerm::MatchBody (nsI
     length = PL_strlen (m_value.string);
 
   nsMsgBodyHandler * bodyHan  = new nsMsgBodyHandler (scope, length, msg, db);
   if (!bodyHan)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsAutoCString buf;
   bool endOfFile = false;  // if retValue == 0, we've hit the end of the file
-  uint32 lines = 0;
+  uint32_t lines = 0;
 
   // Change the sense of the loop so we don't bail out prematurely
   // on negative terms. i.e. opDoesntContain must look at all lines
   bool boolContinueLoop;
   GetMatchAllBeforeDeciding(&boolContinueLoop);
   result = boolContinueLoop;
 
   // If there's a '=' in the search term, then we're not going to do
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -3542,17 +3542,17 @@ nsMsgDBView::PerformActionsOnJunkMsgs(bo
                                        nullptr, PR_TRUE);
 
     }
     else if (mDeleteModel == nsMsgImapDeleteModels::IMAPDelete)
     {
       nsCOMPtr<nsIMsgImapMailFolder> imapFolder(do_QueryInterface(srcFolder));
       nsTArray<nsMsgKey> imapUids;
       imapUids.SetLength(numJunkHdrs);
-      for (uint32 i = 0; i < numJunkHdrs; i++)
+      for (uint32_t i = 0; i < numJunkHdrs; i++)
       {
         nsCOMPtr<nsIMsgDBHdr> msgHdr = do_QueryElementAt(mJunkHdrs, i);
         msgHdr->GetMessageKey(&imapUids[i]);
       }
 
       imapFolder->StoreImapFlags(kImapMsgDeletedFlag, false, imapUids.Elements(),
                                  imapUids.Length(), nullptr);
     }
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -283,17 +283,17 @@ nsresult NS_MsgGetUntranslatedPriorityNa
 /* this used to be XP_StringHash2 from xp_hash.c */
 /* phong's linear congruential hash  */
 static uint32_t StringHash(const char *ubuf, int32_t len = -1)
 {
   unsigned char * buf = (unsigned char*) ubuf;
   uint32_t h=1;
   unsigned char *end = buf + (len == -1 ? strlen(ubuf) : len);
   while(buf < end) {
-    h = 0x63c63cd9*h + 0x9c39c33d + (int32)*buf;
+    h = 0x63c63cd9*h + 0x9c39c33d + (int32_t)*buf;
     buf++;
   }
   return h;
 }
 
 inline uint32_t StringHash(const nsAutoString& str)
 {
     return StringHash(reinterpret_cast<const char*>(str.get()),
--- a/mailnews/imap/src/nsIMAPGenericParser.cpp
+++ b/mailnews/imap/src/nsIMAPGenericParser.cpp
@@ -169,17 +169,17 @@ void nsIMAPGenericParser::AdvanceToNextL
      while (*firstToken && (*firstToken == WHITESPACE[0] ||
             *firstToken == WHITESPACE[1] || *firstToken == WHITESPACE[2]))
        firstToken++;
      fAtEndOfLine = (*firstToken == '\0');
   }
 }
 
 // advances |fLineOfTokens| by |bytesToAdvance| bytes
-void nsIMAPGenericParser::AdvanceTokenizerStartingPoint(int32 bytesToAdvance)
+void nsIMAPGenericParser::AdvanceTokenizerStartingPoint(int32_t bytesToAdvance)
 {
   NS_PRECONDITION(bytesToAdvance>=0, "bytesToAdvance must not be negative");
   if (!fStartOfLineOfTokens)
   {
     AdvanceToNextToken();  // the tokenizer was not yet initialized, do it now
     if (!fStartOfLineOfTokens)
       return;
   }
@@ -191,17 +191,17 @@ void nsIMAPGenericParser::AdvanceTokeniz
   if (fCurrentTokenPlaceHolder)
   {
     int endTokenOffset = fCurrentTokenPlaceHolder - fStartOfLineOfTokens - 1;
     if (endTokenOffset >= 0)
       fStartOfLineOfTokens[endTokenOffset] = fCurrentLine[endTokenOffset];
   }
 
   NS_ASSERTION(bytesToAdvance + (fLineOfTokens-fStartOfLineOfTokens) <=
-    (int32)strlen(fCurrentLine), "cannot advance beyond end of fLineOfTokens");
+    (int32_t)strlen(fCurrentLine), "cannot advance beyond end of fLineOfTokens");
   fLineOfTokens += bytesToAdvance;
   fCurrentTokenPlaceHolder = fLineOfTokens;
 }
 
 // RFC3501:  astring = 1*ASTRING-CHAR / string
 //           string  = quoted / literal
 // This function leaves us off with fCurrentTokenPlaceHolder immediately after
 // the end of the Astring.  Call AdvanceToNextToken() to get the token after it.
@@ -345,31 +345,31 @@ char *nsIMAPGenericParser::CreateQuoted(
 // the end of the literal string.  Call AdvanceToNextToken() to get the token
 // after the literal string.
 // RFC3501:  literal = "{" number "}" CRLF *CHAR8
 //                       ; Number represents the number of CHAR8s
 //           CHAR8   = %x01-ff
 //                       ; any OCTET except NUL, %x00
 char *nsIMAPGenericParser::CreateLiteral()
 {
-  int32 numberOfCharsInMessage = atoi(fNextToken + 1);
-  uint32 numBytes = numberOfCharsInMessage + 1;
+  int32_t numberOfCharsInMessage = atoi(fNextToken + 1);
+  uint32_t numBytes = numberOfCharsInMessage + 1;
   NS_ASSERTION(numBytes, "overflow!");
   if (!numBytes)
     return nullptr;
   char *returnString = (char *)PR_Malloc(numBytes);
   if (!returnString)
   {
     HandleMemoryFailure();
     return nullptr;
   }
 
-  int32 currentLineLength = 0;
-  int32 charsReadSoFar = 0;
-  int32 bytesToCopy = 0;
+  int32_t currentLineLength = 0;
+  int32_t charsReadSoFar = 0;
+  int32_t bytesToCopy = 0;
   while (charsReadSoFar < numberOfCharsInMessage)
   {
     AdvanceToNextLine();
     if (!ContinueParse())
       break;
     
     currentLineLength = strlen(fCurrentLine);
     bytesToCopy = (currentLineLength > numberOfCharsInMessage - charsReadSoFar ?
--- a/mailnews/imap/src/nsIMAPGenericParser.h
+++ b/mailnews/imap/src/nsIMAPGenericParser.h
@@ -49,17 +49,17 @@ protected:
   char *CreateLiteral();
   char *CreateAtom(bool isAstring = false);
   char *CreateQuoted(bool skipToEnd = true);
   char *CreateParenGroup();
   virtual void SetSyntaxError(bool error, const char *msg);
 
   void AdvanceToNextToken();
   void AdvanceToNextLine();
-  void AdvanceTokenizerStartingPoint(int32 bytesToAdvance);
+  void AdvanceTokenizerStartingPoint(int32_t bytesToAdvance);
   void ResetLexAnalyzer();
 
 protected:
 	// use with care
   const char     *fNextToken;
   char           *fCurrentLine;
 	char					 *fLineOfTokens;
   char           *fStartOfLineOfTokens;
--- a/mailnews/imap/src/nsIMAPHostSessionList.cpp
+++ b/mailnews/imap/src/nsIMAPHostSessionList.cpp
@@ -537,17 +537,17 @@ NS_IMETHODIMP nsIMAPHostSessionList::Com
       case 3:
         type = kOtherUsersNamespace;
         break;
       default:
         type = kPersonalNamespace;
         break;
       }
 
-      int32 numInNS = host->fNamespaceList->GetNumberOfNamespaces(type);
+      int32_t numInNS = host->fNamespaceList->GetNumberOfNamespaces(type);
       if (numInNS == 0)
         SetNamespacesPrefForHost(aHost, type, "");
       else if (numInNS >= 1)
       {
         char *pref = PR_smprintf("");
         for (int count = 1; count <= numInNS; count++)
         {
           nsIMAPNamespace *ns = host->fNamespaceList->GetNamespaceNumber(count, type);
--- a/mailnews/imap/src/nsImapFlagAndUidState.cpp
+++ b/mailnews/imap/src/nsImapFlagAndUidState.cpp
@@ -97,24 +97,24 @@ nsImapFlagAndUidState::nsImapFlagAndUidS
 
 nsImapFlagAndUidState::~nsImapFlagAndUidState()
 {
   if (m_customFlagsHash.IsInitialized())
     m_customFlagsHash.EnumerateRead(FreeCustomFlags, nullptr);
 }
 
 NS_IMETHODIMP
-nsImapFlagAndUidState::OrSupportedUserFlags(uint16 flags)
+nsImapFlagAndUidState::OrSupportedUserFlags(uint16_t flags)
 {
   fSupportedUserFlags |= flags;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsImapFlagAndUidState::GetSupportedUserFlags(uint16 *aFlags)
+nsImapFlagAndUidState::GetSupportedUserFlags(uint16_t *aFlags)
 {
   NS_ENSURE_ARG_POINTER(aFlags);
   *aFlags = fSupportedUserFlags;
   return NS_OK;
 }
 
 // we need to reset our flags, (re-read all) but chances are the memory allocation needed will be
 // very close to what we were already using
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -2784,17 +2784,17 @@ void nsImapProtocol::ProcessSelectedStat
             HandleMemoryFailure();
         }
         break;
       case nsIImapUrl::nsImapDeleteFolderAndMsgs:
         DeleteFolderAndMsgs(mailboxName.get());
         break;
       case nsIImapUrl::nsImapDeleteAllMsgs:
         {
-          uint32 numberOfMessages = GetServerStateParser().NumberOfMessages();
+          uint32_t numberOfMessages = GetServerStateParser().NumberOfMessages();
           if (numberOfMessages)
           {
             Store(NS_LITERAL_CSTRING("1:*"), "+FLAGS.SILENT (\\Deleted)",
               false);  // use sequence #'s
 
             if (GetServerStateParser().LastCommandSuccessful())
               Expunge();      // expunge messages with deleted flag
             if (GetServerStateParser().LastCommandSuccessful())
@@ -3210,17 +3210,17 @@ void nsImapProtocol::Bodystructure(const
 }
 
 void nsImapProtocol::PipelinedFetchMessageParts(const char *uid, nsIMAPMessagePartIDArray *parts)
 {
   // assumes no chunking
 
   // build up a string to fetch
   nsCString stringToFetch, what;
-  int32 currentPartNum = 0;
+  int32_t currentPartNum = 0;
   while ((parts->GetNumParts() > currentPartNum) && !DeathSignalReceived())
   {
     nsIMAPMessagePartID *currentPart = parts->GetPart(currentPartNum);
     if (currentPart)
     {
       // Do things here depending on the type of message part
       // Append it to the fetch string
       if (currentPartNum > 0)
@@ -3637,17 +3637,17 @@ void nsImapProtocol::FetchTryChunking(co
 void nsImapProtocol::PipelinedFetchMessageParts(nsCString &uid, nsIMAPMessagePartIDArray *parts)
 {
   // assumes no chunking
 
   // build up a string to fetch
   nsCString stringToFetch;
   nsCString what;
 
-  int32 currentPartNum = 0;
+  int32_t currentPartNum = 0;
   while ((parts->GetNumParts() > currentPartNum) && !DeathSignalReceived())
   {
     nsIMAPMessagePartID *currentPart = parts->GetPart(currentPartNum);
     if (currentPart)
     {
       // Do things here depending on the type of message part
       // Append it to the fetch string
       if (currentPartNum > 0)
@@ -6981,17 +6981,17 @@ void nsImapProtocol::OnDeleteFolder(cons
       deleted = DeleteMailboxRespectingSubscriptions(sourceMailbox);
     if (deleted)
       FolderDeleted(sourceMailbox);
   }
 }
 
 void nsImapProtocol::RemoveMsgsAndExpunge()
 {
-  uint32 numberOfMessages = GetServerStateParser().NumberOfMessages();
+  uint32_t numberOfMessages = GetServerStateParser().NumberOfMessages();
   if (numberOfMessages)
   {
     // Remove all msgs and expunge the folder (ie, compact it).
     Store(NS_LITERAL_CSTRING("1:*"), "+FLAGS.SILENT (\\Deleted)", false);  // use sequence #'s
     if (GetServerStateParser().LastCommandSuccessful())
       Expunge();
   }
 }
@@ -8053,18 +8053,18 @@ void nsImapProtocol::SetupMessageFlagsSt
 
 void nsImapProtocol::ProcessStoreFlags(const nsCString &messageIdsString,
                                                  bool idsAreUids,
                                                  imapMessageFlagsType flags,
                                                  bool addFlags)
 {
   nsCString flagString;
 
-  uint16 userFlags = GetServerStateParser().SupportsUserFlags();
-  uint16 settableFlags = GetServerStateParser().SettablePermanentFlags();
+  uint16_t userFlags = GetServerStateParser().SupportsUserFlags();
+  uint16_t settableFlags = GetServerStateParser().SettablePermanentFlags();
 
   if (!addFlags && (flags & userFlags) && !(flags & settableFlags))
   {
     if (m_runningUrl)
       m_runningUrl->SetExtraStatus(nsIImapUrl::ImapStatusFlagsNotSettable);
     return;         // if cannot set any of the flags bail out
   }
 
--- a/mailnews/imap/src/nsImapSearchResults.cpp
+++ b/mailnews/imap/src/nsImapSearchResults.cpp
@@ -68,17 +68,17 @@ void  nsImapSearchResultIterator::ResetI
 {
   fSequenceIndex = 0;
   fCurrentLine = (char *) fSequence.SafeElementAt(fSequenceIndex);
   fPositionInCurrentLine = fCurrentLine;
 }
 
 int32_t nsImapSearchResultIterator::GetNextMessageNumber()
 {
-  int32 returnValue = 0;
+  int32_t returnValue = 0;
   if (fPositionInCurrentLine)
   {	
     returnValue = atoi(fPositionInCurrentLine);
     
     // eat the current number
     while (isdigit(*++fPositionInCurrentLine))
       ;
     
@@ -88,10 +88,8 @@ int32_t nsImapSearchResultIterator::GetN
       fPositionInCurrentLine = fCurrentLine;
     }
     else	// eat the space
       fPositionInCurrentLine++;
   }
   
   return returnValue;
 }
-
-
--- a/mailnews/mime/src/mimetpfl.cpp
+++ b/mailnews/mime/src/mimetpfl.cpp
@@ -269,17 +269,17 @@ MimeInlineTextPlainFlowed_parse_line (co
     exdata = exdata->next;
   }
 
   NS_ASSERTION(exdata, "The extra data has disappeared!");
 
   NS_ASSERTION(length > 0, "zero length");
   if (length <= 0) return 0;
 
-  uint32 linequotelevel = 0;
+  uint32_t linequotelevel = 0;
   nsAutoCString real_line(aLine, length);
   char *line = real_line.BeginWriting();
   const char *linep = real_line.BeginReading();
   // Space stuffed?
   if(' ' == *linep) {
     linep++;
   } else {
     // count '>':s before the first non-'>'
@@ -381,17 +381,17 @@ MimeInlineTextPlainFlowed_parse_line (co
   {
     CopyUTF8toUTF16(nsDependentCString(line, length), lineResult);
     status = 0;
   }
 
   nsAutoCString preface;
 
   /* Correct number of blockquotes */
-  int32 quoteleveldiff=linequotelevel - exdata->quotelevel;
+  int32_t quoteleveldiff=linequotelevel - exdata->quotelevel;
   if((quoteleveldiff != 0) && flowed && exdata->inflow) {
     // From RFC 2646 4.5
     // The receiver SHOULD handle this error by using the 'quote-depth-wins' rule,
     // which is to ignore the flowed indicator and treat the line as fixed.  That
     // is, the change in quote depth ends the paragraph.
 
     // We get that behaviour by just going on.
   }