Bug 1317040 - Port Bug 1315812 to Mailnews, suppress deprecation warning for nsISupportsArray. rs=bustage-fix draft
authorJorg K <jorgk@jorgk.com>
Sat, 12 Nov 2016 22:04:37 +0100
changeset 46013 d93da49f4f9995ddbf572effc04e200d0d1c7be5
parent 46002 82f47febc327f5487158ed2a09331e195ba71ae2
child 46014 f64b2d92e7971d0eab071e122195d0f2f8ff0a4f
push id3978
push usermozilla@jorgk.com
push dateSat, 12 Nov 2016 21:10:14 +0000
treeherdertry-comm-central@f64b2d92e797 [default view] [failures only]
reviewersbustage-fix
bugs1317040, 1315812
Bug 1317040 - Port Bug 1315812 to Mailnews, suppress deprecation warning for nsISupportsArray. rs=bustage-fix
mailnews/base/search/src/nsMsgImapSearch.cpp
mailnews/base/search/src/nsMsgLocalSearch.cpp
mailnews/base/search/src/nsMsgSearchAdapter.cpp
mailnews/base/search/src/nsMsgSearchNews.cpp
mailnews/base/search/src/nsMsgSearchSession.h
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgFolderDataSource.h
mailnews/base/util/nsMsgUtils.cpp
mailnews/base/util/nsMsgUtils.h
mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
mailnews/extensions/mailviews/src/nsMsgMailViewList.h
--- a/mailnews/base/search/src/nsMsgImapSearch.cpp
+++ b/mailnews/base/search/src/nsMsgImapSearch.cpp
@@ -5,16 +5,25 @@
 #include "msgCore.h"
 #include "nsMsgSearchAdapter.h"
 #include "nsMsgSearchScopeTerm.h"
 #include "nsMsgResultElement.h"
 #include "nsMsgSearchTerm.h"
 #include "nsIMsgHdr.h"
 #include "nsMsgSearchImap.h"
 #include "prmem.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 // Implementation of search for IMAP mail folders
 
 
 nsMsgSearchOnlineMail::nsMsgSearchOnlineMail (nsMsgSearchScopeTerm *scope, nsISupportsArray *termList) : nsMsgSearchAdapter (scope, termList)
 {
 }
 
@@ -990,8 +999,15 @@ nsMsgSearchValidityManager::InitOnlineMa
   m_onlineManualFilterTable->SetEnabled(nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::Isnt, 1);
   m_onlineManualFilterTable->SetAvailable(nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::BeginsWith, 1);
   m_onlineManualFilterTable->SetEnabled(nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::BeginsWith, 1);
   m_onlineManualFilterTable->SetAvailable(nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::EndsWith, 1);
   m_onlineManualFilterTable->SetEnabled(nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::EndsWith, 1);
 
   return rv;
 }
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
+
--- a/mailnews/base/search/src/nsMsgLocalSearch.cpp
+++ b/mailnews/base/search/src/nsMsgLocalSearch.cpp
@@ -9,16 +9,25 @@
 #include "nsIMsgDatabase.h"
 #include "nsMsgSearchCore.h"
 #include "nsMsgLocalSearch.h"
 #include "nsIStreamListener.h"
 #include "nsMsgSearchBoolExpression.h"
 #include "nsMsgSearchTerm.h"
 #include "nsMsgResultElement.h"
 #include "nsIDBFolderInfo.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 #include "nsMsgBaseCID.h"
 #include "nsMsgSearchValue.h"
 #include "nsIMsgLocalMailFolder.h"
 #include "nsIMsgWindow.h"
 #include "nsIMsgHdr.h"
 #include "nsIMsgFilterPlugin.h"
 #include "nsMsgMessageFlags.h"
@@ -1008,8 +1017,15 @@ nsresult nsMsgSearchValidityManager::Ini
   nsresult rv = NewTable(getter_AddRefs(m_localNewsJunkBodyTable));
   NS_ENSURE_SUCCESS(rv, rv);
   rv = SetLocalNews(m_localNewsJunkBodyTable);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = SetJunk(m_localNewsJunkBodyTable);
   NS_ENSURE_SUCCESS(rv, rv);
   return SetBody(m_localNewsJunkBodyTable);
 }
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
+
--- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp
+++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp
@@ -19,16 +19,25 @@
 #include "prprf.h"
 #include "mozilla/UniquePtr.h"
 #include "prmem.h"
 #include "MailNewsTypes.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsMemory.h"
 #include "nsMsgMessageFlags.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 #include "nsAlgorithm.h"
 #include <algorithm>
 #include "mozilla/Attributes.h"
 
 // This stuff lives in the base class because the IMAP search syntax
 // is used by the Dredd SEARCH command as well as IMAP itself
 
@@ -1318,8 +1327,15 @@ nsMsgSearchValidityManager::SetUpABTable
   rv = EnableDirectoryAttribute(aTable, nsMsgSearchAttrib::Pager);
   NS_ENSURE_SUCCESS(rv,rv);
 
   rv = EnableDirectoryAttribute(aTable, nsMsgSearchAttrib::Mobile);
   NS_ENSURE_SUCCESS(rv,rv);
 
   return rv;
 }
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
+
--- a/mailnews/base/search/src/nsMsgSearchNews.cpp
+++ b/mailnews/base/search/src/nsMsgSearchNews.cpp
@@ -10,16 +10,25 @@
 #include "nsMsgSearchTerm.h"
 #include "nsIMsgHdr.h"
 #include "nsMsgSearchNews.h"
 #include "nsIDBFolderInfo.h"
 #include "prprf.h"
 #include "nsIMsgDatabase.h"
 #include "nsMemory.h"
 #include <ctype.h>
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 
 // Implementation of search for IMAP mail folders
 
 
 // Implementation of search for newsgroups
 
 
@@ -497,8 +506,15 @@ nsresult nsMsgSearchValidityManager::Ini
     m_newsFilterTable->SetAvailable (nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::BeginsWith, 1);
     m_newsFilterTable->SetEnabled   (nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::BeginsWith, 1);
     m_newsFilterTable->SetAvailable (nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::EndsWith, 1);
     m_newsFilterTable->SetEnabled   (nsMsgSearchAttrib::OtherHeader, nsMsgSearchOp::EndsWith, 1);
   }
 
   return rv;
 }
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
+
--- a/mailnews/base/search/src/nsMsgSearchSession.h
+++ b/mailnews/base/search/src/nsMsgSearchSession.h
@@ -7,16 +7,25 @@
 #define nsMsgSearchSession_h___
 
 #include "nscore.h"
 #include "nsMsgSearchCore.h"
 #include "nsIMsgSearchSession.h"
 #include "nsIUrlListener.h"
 #include "nsIMsgWindow.h"
 #include "nsITimer.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 #include "nsCOMArray.h"
 #include "nsWeakReference.h"
 #include "nsTObserverArray.h"
 
 class nsMsgSearchAdapter;
 class nsMsgSearchBoolExpression;
 class nsMsgSearchScopeTerm;
@@ -83,9 +92,15 @@ protected:
   nsMsgSearchType m_searchType;
   bool m_handlingError;
   nsCString m_runningUrl;     // The url for the current search
   nsCOMPtr <nsITimer> m_backgroundTimer;
   bool m_searchPaused;
   nsMsgSearchBoolExpression *m_expressionTree;
 };
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
 #endif
+
+#endif
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -4,16 +4,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * The account manager service - manages all accounts, servers, and identities
  */
 
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 #include "nsIArray.h"
 #include "nsArrayUtils.h"
 #include "nsMsgAccountManager.h"
 #include "nsMsgBaseCID.h"
 #include "nsMsgCompCID.h"
 #include "nsMsgDBCID.h"
 #include "prmem.h"
@@ -3694,8 +3703,15 @@ nsMsgAccountManager::GetSortOrder(nsIMsg
   if (NS_FAILED(rv)) {
     *aSortOrder = 999999999;
   } else {
     *aSortOrder = sortOrder + serverIndex;
   }
 
   return NS_OK;
 }
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
+
--- a/mailnews/base/src/nsMsgFolderDataSource.h
+++ b/mailnews/base/src/nsMsgFolderDataSource.h
@@ -8,17 +8,27 @@
 #include "nsIRDFService.h"
 
 #include "nsIFolderListener.h"
 #include "nsMsgRDFDataSource.h"
 
 #include "nsITransactionManager.h"
 #include "nsCOMArray.h"
 #include "nsIMutableArray.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
+
 /**
  * The mail data source.
  */
 class nsMsgFolderDataSource : public nsMsgRDFDataSource,
                               public nsIFolderListener
 {
 public:
   
@@ -342,8 +352,14 @@ public:
                     nsIRDFNode *oldNode) override;
   NS_IMETHOD OnItemAdded(nsIMsgFolder *parentItem, nsISupports *item) override;
   virtual void Cleanup() override;
 protected:
   virtual void EnsureFolders() override;
   uint32_t m_cutOffDate;
   uint32_t m_maxNumFolders;
 };
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -53,16 +53,25 @@
 #include "nsIMsgDatabase.h"
 #include "nsIMutableArray.h"
 #include "nsIMsgMailNewsUrl.h"
 #include "nsArrayUtils.h"
 #include "nsIStringBundle.h"
 #include "nsIMsgWindow.h"
 #include "nsIWindowWatcher.h"
 #include "nsIPrompt.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 #include "nsIMsgSearchTerm.h"
 #include "nsTextFormatter.h"
 #include "nsIAtomService.h"
 #include "nsIStreamListener.h"
 #include "nsReadLine.h"
 #include "nsICharsetDetectionObserver.h"
 #include "nsICharsetDetector.h"
@@ -2522,8 +2531,15 @@ NS_MSG_BASE nsMsgKey msgKeyFromInt(uint3
   return aValue;
 }
 
 NS_MSG_BASE nsMsgKey msgKeyFromInt(uint64_t aValue)
 {
   NS_ASSERTION(aValue <= PR_UINT32_MAX, "Msg key value too big!");
   return aValue;
 }
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
+
--- a/mailnews/base/util/nsMsgUtils.h
+++ b/mailnews/base/util/nsMsgUtils.h
@@ -9,16 +9,25 @@
 #include "nsIURL.h"
 #include "nsStringGlue.h"
 #include "msgCore.h"
 #include "nsCOMPtr.h"
 #include "MailNewsTypes2.h"
 #include "nsTArray.h"
 #include "nsInterfaceRequestorAgg.h"
 #include "nsILoadGroup.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 #include "nsIAtom.h"
 #include "nsINetUtil.h"
 #include "nsIRequest.h"
 #include "nsILoadInfo.h"
 #include "nsServiceManagerUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsIFile.h"
@@ -550,16 +559,22 @@ NS_MSG_BASE nsMsgKey msgKeyFromInt(uint6
     return NS_OK; \
   } \
   NS_IMETHODIMP clazz::Set##attr(type aValue) \
   { \
     member = aValue; \
     return NS_OK; \
   }
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
+  
 #endif
 
  /**
  * Macro and helper function for reporting an error, warning or
  * informational message to the Error Console
  *
  * This will require the inclusion of the following files in the source file
  * #include "nsIScriptError.h"
--- a/mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
+++ b/mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
@@ -1,14 +1,23 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsMsgMailViewList.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 #include "nsIFileChannel.h"
 #include "nsIMsgFilterService.h"
 #include "nsIMsgMailSession.h"
 #include "nsIMsgSearchTerm.h"
 #include "nsMsgBaseCID.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
@@ -298,8 +307,14 @@ nsresult nsMsgMailViewList::ConvertFilte
         NS_ENSURE_SUCCESS(rv, rv);
 
         // now append this new mail view to our global list view
         m_mailViews.AppendElement(newMailView);
     }
 
     return rv;
 }
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
+#endif
--- a/mailnews/extensions/mailviews/src/nsMsgMailViewList.h
+++ b/mailnews/extensions/mailviews/src/nsMsgMailViewList.h
@@ -6,16 +6,25 @@
 
 #ifndef _nsMsgMailViewList_H_
 #define _nsMsgMailViewList_H_
 
 #include "nscore.h"
 #include "nsIMsgMailViewList.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
+// Disable deprecation warnings generated by nsISupportsArray and associated
+// classes.
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4996)
+#endif
 #include "nsISupportsArray.h"
 #include "nsIStringBundle.h"
 #include "nsStringGlue.h"
 #include "nsIMsgFilterList.h"
 
 // a mail View is just a name and an array of search terms
 class nsMsgMailView : public nsIMsgMailView
 {
@@ -46,9 +55,15 @@ protected:
   nsresult LoadMailViews(); // reads in user defined mail views from our default file
   nsresult ConvertFilterListToMailViews();
   nsresult ConvertMailViewListToFilterList();
 
   nsCOMArray<nsIMsgMailView> m_mailViews;
   nsCOMPtr<nsIMsgFilterList> mFilterList; // our internal filter list representation
 };
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+#pragma warning (pop)
 #endif
+
+#endif