Bug 1294260 - Part 3: fix some compile warnings in mailnews that look syntactic only (hints and help from aleth and jorgk). r=jorgk, r=aleth CLOSED TREE
authoraceman <acelists@atlas.sk>
Sun, 14 Aug 2016 10:21:26 +0200
changeset 19694 28876b046ec271296611b271d6329937889dc694
parent 19693 be4c5a82c1c04686dedf282cc9fca2168c361b8b
child 19695 3e4c9e3a9099b0bb077255abb75463784ee929e5
push id1771
push userclokep@gmail.com
push dateMon, 14 Nov 2016 17:47:53 +0000
treeherdercomm-esr52@a887f81f6aea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, aleth
bugs1294260
Bug 1294260 - Part 3: fix some compile warnings in mailnews that look syntactic only (hints and help from aleth and jorgk). r=jorgk, r=aleth CLOSED TREE
ldap/xpcom/src/nsLDAPService.cpp
mail/components/migration/src/nsNetscapeProfileMigratorBase.h
mail/components/migration/src/nsSeamonkeyProfileMigrator.h
mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
mailnews/addrbook/src/nsVCard.cpp
mailnews/base/search/src/nsMsgFilter.cpp
mailnews/base/search/src/nsMsgFilterService.cpp
mailnews/base/search/src/nsMsgLocalSearch.cpp
mailnews/base/search/src/nsMsgSearchAdapter.cpp
mailnews/base/search/src/nsMsgSearchSession.cpp
mailnews/base/src/nsMsgAccountManagerDS.h
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/src/nsMsgFolderCompactor.cpp
mailnews/base/src/nsMsgFolderCompactor.h
mailnews/base/src/nsMsgGroupView.cpp
mailnews/base/src/nsMsgGroupView.h
mailnews/base/src/nsMsgPurgeService.cpp
mailnews/base/src/nsMsgQuickSearchDBView.h
mailnews/base/src/nsMsgSearchDBView.h
mailnews/base/src/nsMsgSpecialViews.h
mailnews/base/src/nsMsgThreadedDBView.cpp
mailnews/base/src/nsMsgThreadedDBView.h
mailnews/base/src/nsMsgXFVirtualFolderDBView.h
mailnews/base/test/TestMailCookie.cpp
mailnews/base/util/nsMsgProtocol.cpp
mailnews/base/util/nsMsgReadStateTxn.h
mailnews/base/util/nsMsgUtils.cpp
mailnews/compose/src/nsComposeStrings.cpp
mailnews/compose/src/nsMsgAppleCodes.h
mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
mailnews/compose/src/nsMsgAppleEncode.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/compose/src/nsMsgSendReport.cpp
mailnews/compose/src/nsSmtpProtocol.cpp
mailnews/db/msgdb/src/nsMsgDatabase.cpp
mailnews/db/msgdb/src/nsMsgHdr.cpp
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
mailnews/imap/src/nsImapIncomingServer.h
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapMailFolder.h
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsImapProtocol.h
mailnews/imap/src/nsImapServerResponseParser.cpp
mailnews/imap/src/nsImapUrl.cpp
mailnews/import/src/nsImportAddressBooks.cpp
mailnews/import/src/nsImportMail.cpp
mailnews/import/src/nsImportService.cpp
mailnews/import/text/src/nsTextImport.cpp
mailnews/import/vcard/src/nsVCardImport.cpp
mailnews/jsaccount/src/JaIncomingServer.h
mailnews/jsaccount/src/JaMsgFolder.h
mailnews/jsaccount/src/JaUrl.h
mailnews/local/src/nsMailboxUrl.h
mailnews/local/src/nsMsgLocalStoreUtils.cpp
mailnews/local/src/nsParseMailbox.cpp
mailnews/local/src/nsParseMailbox.h
mailnews/local/src/nsPop3Protocol.cpp
mailnews/mime/src/mimemsig.cpp
mailnews/mime/src/nsCMS.h
mailnews/mime/src/nsSimpleMimeConverterStub.cpp
mailnews/news/src/nsNNTPProtocol.cpp
mailnews/news/src/nsNNTPProtocol.h
mailnews/news/src/nsNntpIncomingServer.h
mailnews/news/src/nsNntpUrl.h
--- a/ldap/xpcom/src/nsLDAPService.cpp
+++ b/ldap/xpcom/src/nsLDAPService.cpp
@@ -204,26 +204,21 @@ NS_IMETHODIMP nsLDAPService::AddServer(n
         NS_ERROR("nsLDAPService::AddServer: null pointer ");
         return NS_ERROR_NULL_POINTER;
     }
 
     // Set up the hash key for the server entry
     //
     rv = aServer->GetKey(getter_Copies(key));
     if (NS_FAILED(rv)) {
-        switch (rv) {
         // Only pass along errors we are aware of
-        //
-        case NS_ERROR_OUT_OF_MEMORY:
-        case NS_ERROR_NULL_POINTER:
+        if ((rv == NS_ERROR_OUT_OF_MEMORY) || (rv == NS_ERROR_NULL_POINTER))
             return rv;
-
-        default:
+        else
             return NS_ERROR_FAILURE;
-        }
     }
 
     // Create the new service server entry, and add it into the hash table
     //
     entry = new nsLDAPServiceEntry;
     if (!entry) {
         NS_ERROR("nsLDAPService::AddServer: out of memory ");
         return NS_ERROR_OUT_OF_MEMORY;
@@ -715,27 +710,23 @@ nsLDAPService::EstablishConnection(nsLDA
     }
 
     // Start a bind operation 
     //
     // Here we need to support the password, see bug #75990
     // 
     rv = operation->SimpleBind(password);
     if (NS_FAILED(rv)) {
-        switch (rv) {
         // Only pass along errors we are aware of
-        //
-        case NS_ERROR_LDAP_ENCODING_ERROR:
-        case NS_ERROR_FAILURE:
-        case NS_ERROR_OUT_OF_MEMORY:
+        if ((rv == NS_ERROR_LDAP_ENCODING_ERROR) ||
+            (rv == NS_ERROR_FAILURE) ||
+            (rv == NS_ERROR_OUT_OF_MEMORY))
             return rv;
-
-        default:
+        else
             return NS_ERROR_UNEXPECTED;
-        }
     }
 
     return NS_OK;
 }
 
 /* AString createFilter (in unsigned long aMaxSize, in AString aPattern, in AString aPrefix, in AString aSuffix, in AString aAttr, in AString aValue); */
 NS_IMETHODIMP nsLDAPService::CreateFilter(uint32_t aMaxSize, 
                                           const nsACString & aPattern,
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.h
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.h
@@ -36,18 +36,18 @@ class nsNetscapeProfileMigratorBase : pu
 
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
 
   nsNetscapeProfileMigratorBase();
 
-  NS_IMETHOD GetSourceHasMultipleProfiles(bool* aResult);
-  NS_IMETHOD GetSourceExists(bool* aResult);
+  NS_IMETHOD GetSourceHasMultipleProfiles(bool* aResult) override;
+  NS_IMETHOD GetSourceExists(bool* aResult) override;
 
   struct PrefTransform;
   typedef nsresult(*prefConverter)(PrefTransform*, nsIPrefBranch*);
 
   struct PrefTransform {
     const char*   sourcePrefName;
     const char*   targetPrefName;
     prefConverter prefGetterFunc;
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.h
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.h
@@ -17,20 +17,20 @@ class nsSeamonkeyProfileMigrator : publi
 {
 public:
   NS_DECL_ISUPPORTS
 
   nsSeamonkeyProfileMigrator();
 
   // nsIMailProfileMigrator methods
   NS_IMETHOD Migrate(uint16_t aItems, nsIProfileStartup* aStartup,
-                        const char16_t* aProfile);
+                        const char16_t* aProfile) override;
   NS_IMETHOD GetMigrateData(const char16_t* aProfile, bool aReplace,
-                            uint16_t* aResult);
-  NS_IMETHOD GetSourceProfiles(nsIArray** aResult);
+                            uint16_t* aResult) override;
+  NS_IMETHOD GetSourceProfiles(nsIArray** aResult) override;
 
 protected:
   virtual ~nsSeamonkeyProfileMigrator();
   nsresult FillProfileDataFromSeamonkeyRegistry();
   nsresult GetSourceProfile(const char16_t* aProfile);
 
   nsresult CopyPreferences(bool aReplace);
   nsresult TransformPreferences(const nsAString& aSourcePrefFileName,
--- a/mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
@@ -30,24 +30,24 @@ public:
                                 const nsACString &newBaseDN,
                                 nsILDAPURL* directoryUrl,
                                 nsILDAPConnection* connection,
                                 nsIMutableArray* serverSearchControls,
                                 nsIMutableArray* clientSearchControls,
                                 const nsACString &login,
                                 const int32_t timeOut = 0);
   // nsILDAPMessageListener
-  NS_IMETHOD OnLDAPMessage(nsILDAPMessage *aMessage);
+  NS_IMETHOD OnLDAPMessage(nsILDAPMessage *aMessage) override;
 
 protected:
   virtual ~nsAbModifyLDAPMessageListener();
 
   nsresult Cancel();
-  virtual void InitFailed(bool aCancelled = false);
-  virtual nsresult DoTask();
+  virtual void InitFailed(bool aCancelled = false) override;
+  virtual nsresult DoTask() override;
   nsresult DoMainTask();
   nsresult OnLDAPMessageModifyResult(nsILDAPMessage *aMessage);
   nsresult OnLDAPMessageRenameResult(nsILDAPMessage *aMessage);
 
   int32_t mType;
   nsCString mCardDN;
   nsCOMPtr<nsIArray> mModification;
   nsCString mNewRDN;
--- a/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
@@ -41,28 +41,28 @@ public:
                                nsIMutableArray* serverSearchControls,
                                nsIMutableArray* clientSearchControls,
                                const nsACString &login,
                                const nsACString &mechanism,
                                const int32_t resultLimit = -1,
                                const int32_t timeOut = 0);
 
   // nsILDAPMessageListener
-  NS_IMETHOD OnLDAPMessage(nsILDAPMessage *aMessage);
+  NS_IMETHOD OnLDAPMessage(nsILDAPMessage *aMessage) override;
 
 protected:
   virtual ~nsAbQueryLDAPMessageListener ();
   nsresult OnLDAPMessageSearchEntry(nsILDAPMessage *aMessage);
   nsresult OnLDAPMessageSearchResult(nsILDAPMessage *aMessage);
 
   friend class nsAbLDAPDirectoryQuery;
 
   nsresult Cancel();
-  virtual nsresult DoTask();
-  virtual void InitFailed(bool aCancelled = false);
+  virtual nsresult DoTask() override;
+  virtual void InitFailed(bool aCancelled = false) override;
 
   nsCOMPtr<nsILDAPURL> mSearchUrl;
   nsIAbDirectoryQueryResultListener *mResultListener;
   int32_t mContextID;
   nsCOMPtr<nsIAbDirectoryQueryArguments> mQueryArguments;
   int32_t mResultLimit;
 
   bool mFinished;
@@ -169,16 +169,17 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListen
     case nsILDAPMessage::RES_SEARCH_ENTRY:
       if (!mFinished && !mWaitingForPrevQueryToFinish)
         rv = OnLDAPMessageSearchEntry(aMessage);
       break;
     case nsILDAPMessage::RES_SEARCH_RESULT:
       mWaitingForPrevQueryToFinish = false;
       rv = OnLDAPMessageSearchResult(aMessage);
       NS_ENSURE_SUCCESS(rv, rv);
+      break;
     default:
       break;
     }
   }
   else
   {
     if (mOperation)
       rv = mOperation->AbandonExt();
--- a/mailnews/addrbook/src/nsVCard.cpp
+++ b/mailnews/addrbook/src/nsVCard.cpp
@@ -1215,19 +1215,19 @@ void mime_error(const char *s)
 
 /*#line 1221 "y_tab.c"*/
 #define YYABORT goto yyabort
 #define YYACCEPT goto yyaccept
 #define YYERROR goto yyerrlab
 int
 yyparse()
 {
-    register int yym, yyn, yystate;
+    int yym, yyn, yystate;
 #if YYDEBUG
-    register char *yys;
+    char *yys;
     extern char *getenv();
 
     if (yys = getenv("YYDEBUG"))
     {
         yyn = *yys;
         if (yyn >= '0' && yyn <= '9')
             yydebug = yyn - '0';
     }
--- a/mailnews/base/search/src/nsMsgFilter.cpp
+++ b/mailnews/base/search/src/nsMsgFilter.cpp
@@ -167,17 +167,19 @@ NS_IMETHODIMP nsMsgRuleAction::GetCustom
 }
 
 nsMsgFilter::nsMsgFilter():
     m_temporary(false),
     m_unparseable(false),
     m_filterList(nullptr),
     m_expressionTree(nullptr)
 {
-  NS_NewISupportsArray(getter_AddRefs(m_termList));
+  nsresult rv = NS_NewISupportsArray(getter_AddRefs(m_termList));
+  if (NS_FAILED(rv))
+    NS_ASSERTION(false, "Failed to allocate a nsISupportsArray for nsMsgFilter");
 
   m_type = nsMsgFilterType::InboxRule | nsMsgFilterType::Manual;
 }
 
 nsMsgFilter::~nsMsgFilter()
 {
   delete m_expressionTree;
 }
--- a/mailnews/base/search/src/nsMsgFilterService.cpp
+++ b/mailnews/base/search/src/nsMsgFilterService.cpp
@@ -41,16 +41,17 @@
 #include "nsMsgMessageFlags.h"
 #include "nsIMsgWindow.h"
 #include "nsIMsgSearchCustomTerm.h"
 #include "nsIMsgSearchTerm.h"
 #include "nsIMsgThread.h"
 #include "nsAutoPtr.h"
 #include "nsIMsgFilter.h"
 #include "nsIMsgOperationListener.h"
+#include "mozilla/Attributes.h"
 
 #define BREAK_IF_FAILURE(_rv, _text) if (NS_FAILED(_rv)) { \
   NS_WARNING(_text); \
   mFinalResult = _rv; \
   break; \
 }
 
 #define CONTINUE_IF_FAILURE(_rv, _text) if (NS_FAILED(_rv)) { \
@@ -602,17 +603,17 @@ nsresult nsMsgFilterAfterTheFact::ApplyF
         m_nextAction = numActions;
         break;
 
       case nsMsgFilterAction::MoveToFolder:
         // Even if move fails we will not run additional actions, as they
         //   would not have run if move succeeded.
         m_nextAction = numActions;
         // Fall through to the copy case.
-
+        MOZ_FALLTHROUGH;
       case nsMsgFilterAction::CopyToFolder:
       {
         nsCString uri;
         m_curFolder->GetURI(uri);
         if (!actionTargetFolderUri.IsEmpty() &&
             !uri.Equals(actionTargetFolderUri))
         {
           nsCOMPtr<nsIRDFService> rdf = do_GetService("@mozilla.org/rdf/rdf-service;1",&rv);
--- a/mailnews/base/search/src/nsMsgLocalSearch.cpp
+++ b/mailnews/base/search/src/nsMsgLocalSearch.cpp
@@ -266,43 +266,40 @@ nsresult nsMsgSearchOfflineMail::OpenSum
     err = m_scope->GetFolder(getter_AddRefs(scopeFolder));
     if (NS_SUCCEEDED(err) && scopeFolder)
     {
       err = scopeFolder->GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(m_db));
     }
     else
       return err; // not sure why m_folder wouldn't be set.
 
-    switch (err)
+    if (NS_SUCCEEDED(err))
+      return NS_OK;
+
+    if ((err == NS_MSG_ERROR_FOLDER_SUMMARY_MISSING) ||
+        (err == NS_MSG_ERROR_FOLDER_SUMMARY_OUT_OF_DATE))
     {
-        case NS_OK:
-            break;
-        case NS_MSG_ERROR_FOLDER_SUMMARY_MISSING:
-        case NS_MSG_ERROR_FOLDER_SUMMARY_OUT_OF_DATE:
-          {
             nsCOMPtr<nsIMsgLocalMailFolder> localFolder = do_QueryInterface(scopeFolder, &err);
             if (NS_SUCCEEDED(err) && localFolder)
             {
               nsCOMPtr<nsIMsgSearchSession> searchSession;
               m_scope->GetSearchSession(getter_AddRefs(searchSession));
               if (searchSession)
               {
                 nsCOMPtr <nsIMsgWindow> searchWindow;
 
                 searchSession->GetWindow(getter_AddRefs(searchWindow));
                 searchSession->PauseSearch();
                 localFolder->ParseFolder(searchWindow, this);
               }
             }
-          }
-            break;
-        default:
-        {
-          NS_ASSERTION(false, "unexpected error opening db");
-        }
+    }
+    else
+    {
+      NS_ASSERTION(false, "unexpected error opening db");
     }
 
     return err;
 }
 
 
 nsresult
 nsMsgSearchOfflineMail::MatchTermsForFilter(nsIMsgDBHdr *msgToMatch,
--- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp
+++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp
@@ -22,16 +22,17 @@
 #include "MailNewsTypes.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsMemory.h"
 #include "nsMsgMessageFlags.h"
 #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
 
 // km - the NOT and HEADER strings are not encoded with a trailing
 //      <space> because they always precede a mnemonic that has a
 //      preceding <space> and double <space> characters cause some
 //    imap servers to return an error.
@@ -321,16 +322,17 @@ nsresult nsMsgSearchAdapter::EncodeImapT
   nsMsgSearchAttribValue attrib;
   term->GetAttrib(&attrib);
 
   switch (attrib)
   {
   case nsMsgSearchAttrib::ToOrCC:
     orHeaderMnemonic = m_kImapCC;
     // fall through to case nsMsgSearchAttrib::To:
+    MOZ_FALLTHROUGH;
   case nsMsgSearchAttrib::To:
     whichMnemonic = m_kImapTo;
     break;
   case nsMsgSearchAttrib::CC:
     whichMnemonic = m_kImapCC;
     break;
   case nsMsgSearchAttrib::Sender:
     whichMnemonic = m_kImapFrom;
--- a/mailnews/base/search/src/nsMsgSearchSession.cpp
+++ b/mailnews/base/search/src/nsMsgSearchSession.cpp
@@ -27,17 +27,19 @@ NS_IMPL_ISUPPORTS(nsMsgSearchSession, ns
 
 nsMsgSearchSession::nsMsgSearchSession()
 {
   m_sortAttribute = nsMsgSearchAttrib::Sender;
   m_idxRunningScope = 0;
   m_handlingError = false;
   m_expressionTree = nullptr;
   m_searchPaused = false;
-  NS_NewISupportsArray(getter_AddRefs(m_termList));
+  nsresult rv = NS_NewISupportsArray(getter_AddRefs(m_termList));
+  if (NS_FAILED(rv))
+    NS_ASSERTION(false, "Failed to allocate a nsISupportsArray for nsMsgFilter");
 }
 
 nsMsgSearchSession::~nsMsgSearchSession()
 {
   InterruptSearch();
   delete m_expressionTree;
   DestroyScopeList();
   DestroyTermList();
--- a/mailnews/base/src/nsMsgAccountManagerDS.h
+++ b/mailnews/base/src/nsMsgAccountManagerDS.h
@@ -42,17 +42,17 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIFOLDERLISTENER
   NS_DECL_NSIINCOMINGSERVERLISTENER
   NS_DECL_NSIOBSERVER
   // RDF datasource methods
   NS_IMETHOD GetTarget(nsIRDFResource *source,
                        nsIRDFResource *property,
                        bool aTruthValue,
-                       nsIRDFNode **_retval);
+                       nsIRDFNode **_retval) override;
   NS_IMETHOD GetTargets(nsIRDFResource *source,
                         nsIRDFResource *property,
                         bool aTruthValue,
                         nsISimpleEnumerator **_retval) override;
   NS_IMETHOD ArcLabelsOut(nsIRDFResource *source,
                           nsISimpleEnumerator **_retval) override;
 
   NS_IMETHOD HasAssertion(nsIRDFResource *aSource, nsIRDFResource *aProperty,
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -43,16 +43,17 @@
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsMemory.h"
 #include "nsAlgorithm.h"
 #include "nsIAbManager.h"
 #include "nsIAbDirectory.h"
 #include "nsIAbCard.h"
 #include "mozilla/Services.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/mailnews/MimeHeaderParser.h"
 #include "nsTArray.h"
 #include <algorithm>
 
 using namespace mozilla::mailnews;
 nsrefcnt nsMsgDBView::gInstanceCount  = 0;
 
 nsIAtom * nsMsgDBView::kJunkMsgAtom = nullptr;
@@ -2086,16 +2087,17 @@ NS_IMETHODIMP nsMsgDBView::CellTextForCo
   case 'i': // id
     {
       nsAutoString keyString;
       nsMsgKey key;
       msgHdr->GetMessageKey(&key);
       keyString.AppendInt((int64_t)key);
       aValue.Assign(keyString);
     }
+    break;
   default:
     break;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBView::SetTree(nsITreeBoxObject *tree)
@@ -6652,16 +6654,17 @@ nsresult nsMsgDBView::NavigateFromPos(ns
             break;
         case nsMsgNavigationType::firstNew:
             rv = FindFirstNew(pResultIndex);
             if (IsValidIndex(*pResultIndex))
                 *pResultKey = m_keys[*pResultIndex];
             break;
         case nsMsgNavigationType::firstUnreadMessage:
             startIndex = nsMsgViewIndex_None;        // note fall thru - is this motion ever used?
+            MOZ_FALLTHROUGH;
         case nsMsgNavigationType::nextUnreadMessage:
             for (curIndex = (startIndex == nsMsgViewIndex_None) ? 0 : startIndex; curIndex <= lastIndex && lastIndex != nsMsgViewIndex_None; curIndex++) {
                 uint32_t flags = m_flags[curIndex];
 
                 // don't return start index since navigate should move
                 if (!(flags & (nsMsgMessageFlags::Read | MSG_VIEW_FLAG_DUMMY)) && (curIndex != startIndex))
                 {
                     *pResultIndex = curIndex;
--- a/mailnews/base/src/nsMsgFolderCompactor.cpp
+++ b/mailnews/base/src/nsMsgFolderCompactor.cpp
@@ -492,17 +492,17 @@ nsFolderCompactState::FinishCompact()
 
   nsCOMPtr <nsIDBFolderInfo> transferInfo;
   m_folder->GetDBTransferInfo(getter_AddRefs(transferInfo));
 
   // close down database of the original folder
   m_folder->ForceDBClosed();
 
   nsCOMPtr<nsIFile> cloneFile;
-  int64_t fileSize;
+  int64_t fileSize = 0;
   rv = m_file->Clone(getter_AddRefs(cloneFile));
   if (NS_SUCCEEDED(rv))
     rv = cloneFile->GetFileSize(&fileSize);
   bool tempFileRightSize = ((uint64_t)fileSize == m_totalMsgSize);
   NS_WARN_IF_FALSE(tempFileRightSize, "temp file not of expected size in compact");
 
   bool folderRenameSucceeded = false;
   bool msfRenameSucceeded = false;
--- a/mailnews/base/src/nsMsgFolderCompactor.h
+++ b/mailnews/base/src/nsMsgFolderCompactor.h
@@ -96,17 +96,17 @@ class nsOfflineStoreCompactState : publi
 public:
 
   nsOfflineStoreCompactState(void);
   virtual ~nsOfflineStoreCompactState(void);
   NS_IMETHOD OnStopRequest(nsIRequest *request, nsISupports *ctxt,
                                     nsresult status) override;
   NS_IMETHODIMP OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
                                 nsIInputStream *inStr,
-                                uint64_t sourceOffset, uint32_t count);
+                                uint64_t sourceOffset, uint32_t count) override;
 
 protected:
     nsresult         CopyNextMessage(bool &done);
     virtual nsresult InitDB(nsIMsgDatabase *db) override;
     virtual nsresult StartCompacting() override;
     virtual nsresult FinishCompact() override;
 
     uint32_t m_offlineMsgSize;
old mode 100755
new mode 100644
--- a/mailnews/base/src/nsMsgGroupView.cpp
+++ b/mailnews/base/src/nsMsgGroupView.cpp
@@ -9,16 +9,17 @@
 #include "nsIMsgHdr.h"
 #include "nsIMsgThread.h"
 #include "nsIDBFolderInfo.h"
 #include "nsIMsgSearchSession.h"
 #include "nsMsgGroupThread.h"
 #include "nsITreeColumns.h"
 #include "nsMsgMessageFlags.h"
 #include <plhash.h>
+#include "mozilla/Attributes.h"
 
 #define MSGHDR_CACHE_LOOK_AHEAD_SIZE  25    // Allocate this more to avoid reallocation on new mail.
 #define MSGHDR_CACHE_MAX_SIZE         8192  // Max msghdr cache entries.
 #define MSGHDR_CACHE_DEFAULT_SIZE     100
 
 nsMsgGroupView::nsMsgGroupView()
 {
   m_dayChanged = false;
@@ -221,16 +222,17 @@ nsresult nsMsgGroupView::HashHdr(nsIMsgD
       {
         uint32_t status = 0;
         GetStatusSortValue(msgHdr, &status);
         aHashKey.AppendInt(status);
       }
       break;
     case nsMsgViewSortType::byReceived:
       rcvDate = true;
+      MOZ_FALLTHROUGH;
     case nsMsgViewSortType::byDate:
     {
       uint32_t ageBucket;
       rv = GetAgeBucketValue(msgHdr, &ageBucket, rcvDate);
       if (NS_SUCCEEDED(rv))
         aHashKey.AppendInt(ageBucket);
       break;
     }
@@ -792,16 +794,17 @@ NS_IMETHODIMP nsMsgGroupView::CellTextFo
       bool rcvDate = false;
       msgHdr->GetFlags(&flags);
       aValue.Truncate();
       nsString tmp_str;
       switch (m_sortType)
       {
         case nsMsgViewSortType::byReceived:
           rcvDate = true;
+          MOZ_FALLTHROUGH;
         case nsMsgViewSortType::byDate:
         {
           uint32_t ageBucket = 0;
           GetAgeBucketValue(msgHdr, &ageBucket, rcvDate);
           switch (ageBucket)
           {
           case 1:
             if (m_kTodayString.IsEmpty())
old mode 100755
new mode 100644
--- a/mailnews/base/src/nsMsgGroupView.h
+++ b/mailnews/base/src/nsMsgGroupView.h
@@ -17,35 +17,37 @@ class nsMsgGroupThread;
 // you will most likely want to check the m_viewFlags to see if
 // we're grouping, and if not, call the base class implementation.
 class nsMsgGroupView : public nsMsgDBView
 {
 public:
   nsMsgGroupView();
   virtual ~nsMsgGroupView();
 
-  NS_IMETHOD Open(nsIMsgFolder *folder, nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder, nsMsgViewFlagsTypeValue viewFlags, int32_t *pCount);
-  NS_IMETHOD OpenWithHdrs(nsISimpleEnumerator *aHeaders, nsMsgViewSortTypeValue aSortType, 
-                                        nsMsgViewSortOrderValue aSortOrder, nsMsgViewFlagsTypeValue aViewFlags, 
-                                        int32_t *aCount);
-  NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType);
+  NS_IMETHOD Open(nsIMsgFolder *folder, nsMsgViewSortTypeValue sortType,
+                  nsMsgViewSortOrderValue sortOrder, nsMsgViewFlagsTypeValue viewFlags,
+                  int32_t *pCount) override;
+  NS_IMETHOD OpenWithHdrs(nsISimpleEnumerator *aHeaders, nsMsgViewSortTypeValue aSortType,
+                                        nsMsgViewSortOrderValue aSortOrder, nsMsgViewFlagsTypeValue aViewFlags,
+                                        int32_t *aCount) override;
+  NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType) override;
   NS_IMETHOD CopyDBView(nsMsgDBView *aNewMsgDBView, nsIMessenger *aMessengerInstance,
                         nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater);
-  NS_IMETHOD Close();
+  NS_IMETHOD Close() override;
   NS_IMETHOD OnHdrDeleted(nsIMsgDBHdr *aHdrDeleted, nsMsgKey aParentKey, int32_t aFlags, 
                           nsIDBChangeListener *aInstigator) override;
   NS_IMETHOD OnHdrFlagsChanged(nsIMsgDBHdr *aHdrChanged, uint32_t aOldFlags, 
                                uint32_t aNewFlags, nsIDBChangeListener *aInstigator) override;
 
-  NS_IMETHOD LoadMessageByViewIndex(nsMsgViewIndex aViewIndex);
+  NS_IMETHOD LoadMessageByViewIndex(nsMsgViewIndex aViewIndex) override;
   NS_IMETHOD GetCellProperties(int32_t aRow, nsITreeColumn *aCol, nsAString& aProperties) override;
   NS_IMETHOD GetRowProperties(int32_t aRow, nsAString& aProperties) override;
   NS_IMETHOD CellTextForColumn(int32_t aRow, const char16_t *aColumnName,
-                               nsAString &aValue);
-  NS_IMETHOD GetThreadContainingMsgHdr(nsIMsgDBHdr *msgHdr, nsIMsgThread **pThread);
+                               nsAString &aValue) override;
+  NS_IMETHOD GetThreadContainingMsgHdr(nsIMsgDBHdr *msgHdr, nsIMsgThread **pThread) override;
   NS_IMETHOD AddColumnHandler(const nsAString& column, nsIMsgCustomColumnHandler* handler) override;
 
 protected:
   virtual void InternalClose();
   nsMsgGroupThread *AddHdrToThread(nsIMsgDBHdr *msgHdr, bool *pNewThread);
   virtual nsresult HashHdr(nsIMsgDBHdr *msgHdr, nsString& aHashKey);
   nsresult GetAgeBucketValue(nsIMsgDBHdr *aMsgHdr, uint32_t * aAgeBucket, bool rcvDate = false); // helper function to get the age bucket for a hdr, useful when grouped by date
   nsresult OnNewHeader(nsIMsgDBHdr *newHdr, nsMsgKey aParentKey, bool /*ensureListed*/) override;
--- a/mailnews/base/src/nsMsgPurgeService.cpp
+++ b/mailnews/base/src/nsMsgPurgeService.cpp
@@ -457,17 +457,17 @@ NS_IMETHODIMP nsMsgPurgeService::OnSearc
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgPurgeService::OnSearchDone(nsresult status)
 {
   if (NS_SUCCEEDED(status))
   {
-    uint32_t count;
+    uint32_t count = 0;
     if (mHdrsToDelete)
       mHdrsToDelete->GetLength(&count);
     MOZ_LOG(MsgPurgeLogModule, mozilla::LogLevel::Info, ("%d messages to delete", count));
 
     if (count > 0) {
       MOZ_LOG(MsgPurgeLogModule, mozilla::LogLevel::Info, ("delete messages"));
       if (mSearchFolder)
         mSearchFolder->DeleteMessages(mHdrsToDelete, nullptr, false /*delete storage*/, false /*isMove*/, nullptr, false /*allowUndo*/);
--- a/mailnews/base/src/nsMsgQuickSearchDBView.h
+++ b/mailnews/base/src/nsMsgQuickSearchDBView.h
@@ -34,28 +34,28 @@ public:
   NS_IMETHOD CloneDBView(nsIMessenger *aMessengerInstance,
                          nsIMsgWindow *aMsgWindow,
                          nsIMsgDBViewCommandUpdater *aCommandUpdater,
                          nsIMsgDBView **_retval) override;
   NS_IMETHOD CopyDBView(nsMsgDBView *aNewMsgDBView,
                         nsIMessenger *aMessengerInstance,
                         nsIMsgWindow *aMsgWindow,
                         nsIMsgDBViewCommandUpdater *aCmdUpdater) override;
-  NS_IMETHOD DoCommand(nsMsgViewCommandTypeValue aCommand);
+  NS_IMETHOD DoCommand(nsMsgViewCommandTypeValue aCommand) override;
   NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType) override;
-  NS_IMETHOD SetViewFlags(nsMsgViewFlagsTypeValue aViewFlags);
-  NS_IMETHOD SetSearchSession(nsIMsgSearchSession *aSearchSession);
-  NS_IMETHOD GetSearchSession(nsIMsgSearchSession* *aSearchSession);
+  NS_IMETHOD SetViewFlags(nsMsgViewFlagsTypeValue aViewFlags) override;
+  NS_IMETHOD SetSearchSession(nsIMsgSearchSession *aSearchSession) override;
+  NS_IMETHOD GetSearchSession(nsIMsgSearchSession* *aSearchSession) override;
   NS_IMETHOD OnHdrFlagsChanged(nsIMsgDBHdr *aHdrChanged, uint32_t aOldFlags, 
                                uint32_t aNewFlags, nsIDBChangeListener *aInstigator) override;
   NS_IMETHOD OnHdrPropertyChanged(nsIMsgDBHdr *aHdrToChange, bool aPreChange, uint32_t *aStatus, 
                                   nsIDBChangeListener * aInstigator) override;
   NS_IMETHOD OnHdrDeleted(nsIMsgDBHdr *aHdrDeleted, nsMsgKey aParentKey,
                           int32_t aFlags, nsIDBChangeListener *aInstigator) override;
-  NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs);
+  NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs) override;
 
 protected:
   virtual ~nsMsgQuickSearchDBView();
   nsWeakPtr m_searchSession;
   nsTArray<nsMsgKey> m_origKeys;
   bool      m_usingCachedHits;
   bool      m_cacheEmpty;
   nsCOMArray <nsIMsgDBHdr> m_hdrHits;
--- a/mailnews/base/src/nsMsgSearchDBView.h
+++ b/mailnews/base/src/nsMsgSearchDBView.h
@@ -21,50 +21,50 @@ public:
 
   // these are tied together pretty intimately
   friend class nsMsgXFViewThread;
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIMSGSEARCHNOTIFY
   NS_DECL_NSIMSGCOPYSERVICELISTENER
 
-  NS_IMETHOD SetSearchSession(nsIMsgSearchSession *aSearchSession);
+  NS_IMETHOD SetSearchSession(nsIMsgSearchSession *aSearchSession) override;
 
-  virtual const char * GetViewName(void) {return "SearchView"; }
+  virtual const char *GetViewName(void) override { return "SearchView"; }
   NS_IMETHOD Open(nsIMsgFolder *folder, nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder, 
         nsMsgViewFlagsTypeValue viewFlags, int32_t *pCount) override;
   NS_IMETHOD CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow,
-                         nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval);
+                         nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval) override;
   NS_IMETHOD CopyDBView(nsMsgDBView *aNewMsgDBView, nsIMessenger *aMessengerInstance, 
                         nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater) override;
   NS_IMETHOD Close() override;
   NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType) override;
-  NS_IMETHOD Sort(nsMsgViewSortTypeValue sortType, 
-                  nsMsgViewSortOrderValue sortOrder);
+  NS_IMETHOD Sort(nsMsgViewSortTypeValue sortType,
+                  nsMsgViewSortOrderValue sortOrder) override;
   NS_IMETHOD GetCommandStatus(nsMsgViewCommandTypeValue command,
-                              bool *selectable_p, 
-                              nsMsgViewCommandCheckStateValue *selected_p);
-  NS_IMETHOD DoCommand(nsMsgViewCommandTypeValue command);
-  NS_IMETHOD DoCommandWithFolder(nsMsgViewCommandTypeValue command, nsIMsgFolder *destFolder);
-  NS_IMETHOD GetHdrForFirstSelectedMessage(nsIMsgDBHdr **hdr);
+                              bool *selectable_p,
+                              nsMsgViewCommandCheckStateValue *selected_p) override;
+  NS_IMETHOD DoCommand(nsMsgViewCommandTypeValue command) override;
+  NS_IMETHOD DoCommandWithFolder(nsMsgViewCommandTypeValue command, nsIMsgFolder *destFolder) override;
+  NS_IMETHOD GetHdrForFirstSelectedMessage(nsIMsgDBHdr **hdr) override;
   NS_IMETHOD OpenWithHdrs(nsISimpleEnumerator *aHeaders, 
                           nsMsgViewSortTypeValue aSortType,
                           nsMsgViewSortOrderValue aSortOrder, 
                           nsMsgViewFlagsTypeValue aViewFlags,
                           int32_t *aCount) override;
   NS_IMETHOD OnHdrDeleted(nsIMsgDBHdr *aHdrDeleted, nsMsgKey aParentKey, 
                           int32_t aFlags, nsIDBChangeListener *aInstigator) override;
   NS_IMETHOD OnHdrFlagsChanged(nsIMsgDBHdr *aHdrChanged, uint32_t aOldFlags,
                                uint32_t aNewFlags, nsIDBChangeListener *aInstigator) override;
-  NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs);
+  NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs) override;
   // override to get location
   NS_IMETHOD GetCellText(int32_t aRow, nsITreeColumn* aCol, nsAString& aValue) override;
   virtual nsresult GetMsgHdrForViewIndex(nsMsgViewIndex index, nsIMsgDBHdr **msgHdr) override;
   virtual nsresult OnNewHeader(nsIMsgDBHdr *newHdr, nsMsgKey parentKey, bool ensureListed) override;
-  NS_IMETHOD GetFolderForViewIndex(nsMsgViewIndex index, nsIMsgFolder **folder);
+  NS_IMETHOD GetFolderForViewIndex(nsMsgViewIndex index, nsIMsgFolder **folder) override;
 
   NS_IMETHOD OnAnnouncerGoingAway(nsIDBChangeAnnouncer *instigator) override;
 
   virtual nsCOMArray<nsIMsgFolder>* GetFolders() override;
   virtual nsresult GetFolderFromMsgURI(const char *aMsgURI, nsIMsgFolder **aFolder) override;
 
   NS_IMETHOD GetThreadContainingMsgHdr(nsIMsgDBHdr *msgHdr, nsIMsgThread **pThread) override;
 
--- a/mailnews/base/src/nsMsgSpecialViews.h
+++ b/mailnews/base/src/nsMsgSpecialViews.h
@@ -12,32 +12,34 @@
 class nsMsgThreadsWithUnreadDBView : public nsMsgThreadedDBView
 {
 public:
   nsMsgThreadsWithUnreadDBView();
   virtual ~nsMsgThreadsWithUnreadDBView();
   virtual const char * GetViewName(void) override {return "ThreadsWithUnreadView"; }
   NS_IMETHOD CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCommandUpdater, nsIMsgDBView **_retval) override;
   NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType) override;
-  NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs);
+  NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs) override;
 
 virtual bool WantsThisThread(nsIMsgThread *threadHdr) override;
 protected:
   virtual nsresult AddMsgToThreadNotInView(nsIMsgThread *threadHdr, nsIMsgDBHdr *msgHdr, bool ensureListed) override;
   uint32_t m_totalUnwantedMessagesInView;
 };
 
 class nsMsgWatchedThreadsWithUnreadDBView : public nsMsgThreadedDBView
 {
 public:
   nsMsgWatchedThreadsWithUnreadDBView ();
   NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType) override;
-  NS_IMETHOD CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCommandUpdater, nsIMsgDBView **_retval) override;
-  NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs);
-  virtual const char * GetViewName(void) override {return "WatchedThreadsWithUnreadView"; }
+  NS_IMETHOD CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow,
+                         nsIMsgDBViewCommandUpdater *aCommandUpdater,
+                         nsIMsgDBView **_retval) override;
+  NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs) override;
+  virtual const char *GetViewName(void) override { return "WatchedThreadsWithUnreadView"; }
   virtual bool WantsThisThread(nsIMsgThread *threadHdr) override;
 protected:
   virtual nsresult AddMsgToThreadNotInView(nsIMsgThread *threadHdr, nsIMsgDBHdr *msgHdr, bool ensureListed) override;
   uint32_t m_totalUnwantedMessagesInView;
 
 };
 #ifdef DOING_CACHELESS_VIEW
 // This view will initially be used for cacheless IMAP.
--- a/mailnews/base/src/nsMsgThreadedDBView.cpp
+++ b/mailnews/base/src/nsMsgThreadedDBView.cpp
@@ -674,16 +674,19 @@ nsresult nsMsgThreadedDBView::OnNewHeade
   return NS_OK;
 }
 
 
 NS_IMETHODIMP nsMsgThreadedDBView::OnParentChanged (nsMsgKey aKeyChanged, nsMsgKey oldParent, nsMsgKey newParent, nsIDBChangeListener *aInstigator)
 {
   // we need to adjust the level of the hdr whose parent changed, and invalidate that row,
   // iff we're in threaded mode.
+#if 0
+  // This code never runs due to the if (false) and Clang complains about it
+  // so it is ifdefed out for now.
   if (false && m_viewFlags & nsMsgViewFlagsType::kThreadedDisplay)
   {
     nsMsgViewIndex childIndex = FindViewIndex(aKeyChanged);
     if (childIndex != nsMsgViewIndex_None)
     {
       nsMsgViewIndex parentIndex = FindViewIndex(newParent);
       int32_t newParentLevel = (parentIndex == nsMsgViewIndex_None) ? -1 : m_levels[parentIndex];
       nsMsgViewIndex oldParentIndex = FindViewIndex(oldParent);
@@ -698,16 +701,17 @@ NS_IMETHODIMP nsMsgThreadedDBView::OnPar
         {
           m_levels[viewIndex] = m_levels[viewIndex] - parentDelta;
           NoteChange(viewIndex, 1, nsMsgViewNotificationCode::changed);
         }
       }
       NoteChange(childIndex, 1, nsMsgViewNotificationCode::changed);
     }
   }
+#endif
   return NS_OK;
 }
 
 
 nsMsgViewIndex nsMsgThreadedDBView::GetInsertInfoForNewHdr(nsIMsgDBHdr *newHdr, nsMsgViewIndex parentIndex, int32_t targetLevel)
 {
   uint32_t viewSize = GetSize();
   while (++parentIndex < viewSize)
--- a/mailnews/base/src/nsMsgThreadedDBView.h
+++ b/mailnews/base/src/nsMsgThreadedDBView.h
@@ -11,25 +11,25 @@
 
 class nsMsgThreadedDBView : public nsMsgGroupView
 {
 public:
   nsMsgThreadedDBView();
   virtual ~nsMsgThreadedDBView();
 
   NS_IMETHOD Open(nsIMsgFolder *folder, nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder, nsMsgViewFlagsTypeValue viewFlags, int32_t *pCount) override;
-  NS_IMETHOD CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCommandUpdater, nsIMsgDBView **_retval);
+  NS_IMETHOD CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCommandUpdater, nsIMsgDBView **_retval) override;
   NS_IMETHOD Close() override;
   int32_t AddKeys(nsMsgKey *pKeys, int32_t *pFlags, const char *pLevels, nsMsgViewSortTypeValue sortType, int32_t numKeysToAdd);
-  NS_IMETHOD Sort(nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder);
+  NS_IMETHOD Sort(nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder) override;
   NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType) override;
   NS_IMETHOD OnParentChanged (nsMsgKey aKeyChanged, nsMsgKey oldParent, nsMsgKey newParent, nsIDBChangeListener *aInstigator) override;
 
 protected:
-  virtual const char * GetViewName(void) {return "ThreadedDBView"; }
+  virtual const char *GetViewName(void) override { return "ThreadedDBView"; }
   nsresult InitThreadedView(int32_t *pCount);
   virtual nsresult OnNewHeader(nsIMsgDBHdr *newHdr, nsMsgKey aParentKey, bool ensureListed) override;
   virtual nsresult AddMsgToThreadNotInView(nsIMsgThread *threadHdr, nsIMsgDBHdr *msgHdr, bool ensureListed);
   nsresult ListThreadIds(nsMsgKey *startMsg, bool unreadOnly, nsMsgKey *pOutput, int32_t *pFlags, char *pLevels, 
                         int32_t numToList, int32_t *pNumListed, int32_t *pTotalHeaders);
   nsresult InitSort(nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder);
   virtual nsresult SortThreads(nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder);
   virtual void  OnExtraFlagChanged(nsMsgViewIndex index, uint32_t extraFlag) override;
--- a/mailnews/base/src/nsMsgXFVirtualFolderDBView.h
+++ b/mailnews/base/src/nsMsgXFVirtualFolderDBView.h
@@ -28,20 +28,20 @@ public:
         nsMsgViewFlagsTypeValue viewFlags, int32_t *pCount) override;
   NS_IMETHOD CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, 
                          nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval) override;
   NS_IMETHOD CopyDBView(nsMsgDBView *aNewMsgDBView, nsIMessenger *aMessengerInstance, 
                         nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater) override;
   NS_IMETHOD Close() override;
   NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType) override;
   NS_IMETHOD DoCommand(nsMsgViewCommandTypeValue command) override;
-  NS_IMETHOD SetViewFlags(nsMsgViewFlagsTypeValue aViewFlags);
+  NS_IMETHOD SetViewFlags(nsMsgViewFlagsTypeValue aViewFlags) override;
   NS_IMETHOD OnHdrPropertyChanged(nsIMsgDBHdr *aHdrToChange, bool aPreChange, uint32_t *aStatus, 
                                  nsIDBChangeListener * aInstigator) override;
-  NS_IMETHOD GetMsgFolder(nsIMsgFolder **aMsgFolder);
+  NS_IMETHOD GetMsgFolder(nsIMsgFolder **aMsgFolder) override;
 
   virtual nsresult OnNewHeader(nsIMsgDBHdr *newHdr, nsMsgKey parentKey, bool ensureListed) override;
   void UpdateCacheAndViewForPrevSearchedFolders(nsIMsgFolder *curSearchFolder);
   void UpdateCacheAndViewForFolder(nsIMsgFolder *folder, nsMsgKey *newHits, uint32_t numNewHits);
   void RemovePendingDBListeners();
 
 protected:
 
--- a/mailnews/base/test/TestMailCookie.cpp
+++ b/mailnews/base/test/TestMailCookie.cpp
@@ -22,17 +22,16 @@
 static NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID);
 static NS_DEFINE_CID(kPrefServiceCID,   NS_PREFSERVICE_CID);
 
 // various pref strings
 static const char kCookiesPermissions[] = "network.cookie.cookieBehavior";
 static const char kCookiesLifetimeEnabled[] = "network.cookie.lifetime.enabled";
 static const char kCookiesLifetimeDays[] = "network.cookie.lifetime.days";
 static const char kCookiesLifetimeCurrentSession[] = "network.cookie.lifetime.behavior";
-static const char kCookiesP3PString[] = "network.cookie.p3p";
 static const char kCookiesAskPermission[] = "network.cookie.warnAboutCookies";
 static const char kCookiesMaxPerHost[] = "network.cookie.maxPerHost";
 
 static char *sBuffer;
 
 nsresult
 SetACookie(nsICookieService *aCookieService, const char *aSpec1, const char *aSpec2, const char* aCookieString, const char *aServerTime)
 {
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -1007,17 +1007,17 @@ public:
     {
       mMsgProtocol = do_GetWeakReference(static_cast<nsIStreamListener*> (aProtInstance));
       mInStream = aInputStream;
     }
 
     //
     // nsIOutputStreamCallback implementation ...
     //
-    NS_IMETHODIMP OnOutputStreamReady(nsIAsyncOutputStream *aOutStream)
+    NS_IMETHODIMP OnOutputStreamReady(nsIAsyncOutputStream *aOutStream) override
     {
         NS_ASSERTION(mInStream, "not initialized");
 
         nsresult rv;
         uint64_t avail;
 
         // Write whatever is available in the pipe. If the pipe is empty, then
         // return NS_BASE_STREAM_WOULD_BLOCK; we will resume the write when there
--- a/mailnews/base/util/nsMsgReadStateTxn.h
+++ b/mailnews/base/util/nsMsgReadStateTxn.h
@@ -37,13 +37,12 @@ public:
   NS_IMETHOD RedoTransaction() override;
 
 protected:
   NS_IMETHOD MarkMessages(bool aAsRead);
 
 private:
   nsCOMPtr<nsIMsgFolder> mParentFolder;
   nsTArray<nsMsgKey>     mMarkedMessages;
-  bool                   mWasMarkedRead;
 };
 
 #endif  // nsMsgBaseUndoTxn_h_
 
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -2327,17 +2327,17 @@ MsgStreamMsgHeaders(nsIInputStream *aInp
   return pump->AsyncRead(aConsumer, nullptr);
 }
 
 class CharsetDetectionObserver : public nsICharsetDetectionObserver
 {
 public:
   NS_DECL_ISUPPORTS
   CharsetDetectionObserver() {};
-  NS_IMETHOD Notify(const char* aCharset, nsDetectionConfident aConf)
+  NS_IMETHOD Notify(const char* aCharset, nsDetectionConfident aConf) override
   {
     mCharset = aCharset;
     return NS_OK;
   };
   const char *GetDetectedCharset() { return mCharset.get(); }
 
 private:
   virtual ~CharsetDetectionObserver() {}
--- a/mailnews/compose/src/nsComposeStrings.cpp
+++ b/mailnews/compose/src/nsComposeStrings.cpp
@@ -1,16 +1,21 @@
 /* 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 "nsComposeStrings.h"
 
 const char16_t* errorStringNameForErrorCode(nsresult aCode)
 {
+#ifdef __GNUC__
+// Temporary workaroung until bug 783526 is fixed.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wswitch"
+#endif
   switch(aCode)
   {
     case NS_MSG_UNABLE_TO_OPEN_FILE:
       return u"unableToOpenFile";
     case NS_MSG_UNABLE_TO_OPEN_TMP_FILE:
       return u"unableToOpenTmpFile";
     case NS_MSG_UNABLE_TO_SAVE_TEMPLATE:
       return u"unableToSaveTemplate";
@@ -100,9 +105,12 @@ const char16_t* errorStringNameForErrorC
       return u"smtpAuthMechNotSupported";
     case NS_ERROR_SMTP_AUTH_NOT_SUPPORTED:
       return u"smtpAuthenticationNotSupported";
     case NS_ERROR_ILLEGAL_LOCALPART:
       return u"illegalLocalPart";
     default:
       return u"sendFailed";
   }
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
 }
--- a/mailnews/compose/src/nsMsgAppleCodes.h
+++ b/mailnews/compose/src/nsMsgAppleCodes.h
@@ -72,17 +72,17 @@ typedef struct myFInfo			/* the mac FInf
 	int16_t	fdFldr;	
 
 }	myFInfo;
 
 PR_BEGIN_EXTERN_C
 /*
 **	string utils.
 */
-int write_stream(appledouble_encode_object *p_ap_encode_obj,char *s,int	 len);
+int write_stream(appledouble_encode_object *p_ap_encode_obj, const char *s,int len);
 
 int fill_apple_mime_header(appledouble_encode_object *p_ap_encode_obj);
 int ap_encode_file_infor(appledouble_encode_object *p_ap_encode_obj);
 int ap_encode_header(appledouble_encode_object* p_ap_encode_obj, bool firstTime);
 int ap_encode_data(  appledouble_encode_object* p_ap_encode_obj, bool firstTime);
 
 /*
 **	the prototypes for the ap_decoder.
--- a/mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
+++ b/mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
@@ -139,19 +139,19 @@ int ap_encode_next(
 	p_ap_encode_obj->s_outbuff 	 = buff_size;
 	p_ap_encode_obj->pos_outbuff = 0;
 	
 	/*
 	**	first copy the outstandind data in the overflow buff to the out buffer. 
 	*/
 	if (p_ap_encode_obj->s_overflow)
 	{
-		status = write_stream(p_ap_encode_obj, 
-								p_ap_encode_obj->b_overflow,
-								p_ap_encode_obj->s_overflow);
+		status = write_stream(p_ap_encode_obj,
+		                      (const char*)(p_ap_encode_obj->b_overflow),
+		                      p_ap_encode_obj->s_overflow);
 		if (status != noErr)
 			return status;
 				
 		p_ap_encode_obj->s_overflow = 0;
 	}
 
 	/*
 	** go the next processing stage based on the current state. 
--- a/mailnews/compose/src/nsMsgAppleEncode.cpp
+++ b/mailnews/compose/src/nsMsgAppleEncode.cpp
@@ -39,18 +39,18 @@ static int finish64(appledouble_encode_o
 
 #define BUFF_LEFT(p)	((p)->s_outbuff - (p)->pos_outbuff)	
 
 /*
 **	write_stream.
 */
 int write_stream(
 	appledouble_encode_object *p_ap_encode_obj,
-	char 	*out_string,
-	int	 	len)			
+	const char *out_string,
+	int len)
 {	
 	if (p_ap_encode_obj->pos_outbuff + len < p_ap_encode_obj->s_outbuff)
 	{
 		memcpy(p_ap_encode_obj->outbuff + p_ap_encode_obj->pos_outbuff, 
 		       out_string, 
 		       len);
 		p_ap_encode_obj->pos_outbuff += len;
 		return noErr;
@@ -85,36 +85,32 @@ int fill_apple_mime_header(
 //	status = write_stream(p_ap_encode_env, 
 //						tmpstr,
 //						strlen(tmpstr));
 //	if (status != noErr)
 //		return status;
 
 	PR_snprintf(tmpstr, sizeof(tmpstr),
 			"Content-Type: multipart/appledouble; boundary=\"=\"; name=\"");
-	status = write_stream(p_ap_encode_obj, 
-						tmpstr,
-						strlen(tmpstr));
+	status = write_stream(p_ap_encode_obj, (const char*)tmpstr, strlen(tmpstr));
 	if (status != noErr)
 		return status;
 		
 	status = write_stream(p_ap_encode_obj,
 						p_ap_encode_obj->fname,
 						strlen(p_ap_encode_obj->fname));
 	if (status != noErr)
 		return status;
 		
 	PR_snprintf(tmpstr, sizeof(tmpstr),
 			"\"\r\nContent-Disposition: inline; filename=\"%s\"\r\n\r\n\r\n--=\r\n",
 			p_ap_encode_obj->fname);
 #endif /* 0 */
 	PR_snprintf(tmpstr, sizeof(tmpstr), "--%s" CRLF, p_ap_encode_obj->boundary);
-	status = write_stream(p_ap_encode_obj, 
-						tmpstr, 
-						strlen(tmpstr));
+	status = write_stream(p_ap_encode_obj, (const char*)tmpstr, strlen(tmpstr));
 	return status;
 } 
 
 int ap_encode_file_infor(
 	appledouble_encode_object *p_ap_encode_obj)
 {
 	ap_header	head;
 	ap_entry 	entries[NUM_ENTRIES];
@@ -281,19 +277,17 @@ int ap_encode_header(
 	OSErr	retval = noErr;
 	int    	status;
     ByteCount inCount;
 	
 	if (firstime)
 	{
     PL_strcpy(rd_buff, 
 			"Content-Type: application/applefile\r\nContent-Transfer-Encoding: base64\r\n\r\n");
-		status = write_stream(p_ap_encode_obj,
-			 				rd_buff, 
-			 				strlen(rd_buff)); 
+		status = write_stream(p_ap_encode_obj, (const char*)rd_buff, strlen(rd_buff));
 		if (status != noErr)
 			return status;
 			
 		status = ap_encode_file_infor(p_ap_encode_obj); 
 		if (status != noErr)
 			return status;
 		
 		/*
@@ -345,58 +339,59 @@ int ap_encode_header(
 		
 		/*
 		** write out the boundary 
 		*/
 		PR_snprintf(rd_buff, sizeof(rd_buff),
 						CRLF "--%s" CRLF, 
 						p_ap_encode_obj->boundary);
 					
-		status = write_stream(p_ap_encode_obj,
-						rd_buff,
-						strlen(rd_buff));
+		status = write_stream(p_ap_encode_obj, (const char*)rd_buff, strlen(rd_buff));
 		if (status == noErr)
 			status = errDone;
 	}
 	return status;
 }
 
+#if 0
+// This is unused for now and Clang complains about that is it is ifdefed out
 static void replace(char *p, int len, char frm, char to)
 {
 	for (; len > 0; len--, p++)
 		if (*p == frm)	*p = to;
 }
+#endif
 
 /* Description of the various file formats and their magic numbers 		*/
-struct magic 
+struct magic
 {
-    char 	*name;			/* Name of the file format 					*/
-    char 	*num;			/* The magic number 						*/
-    int 	len;			/* Length (0 means strlen(magicnum)) 		*/
+    const char *name;			/* Name of the file format */
+    const char *num;			/* The magic number */
+    int        len;			/* Length (0 means strlen(magicnum)) */
 };
 
 /* The magic numbers of the file formats we know about */
-static struct magic magic[] = 
+static struct magic magic[] =
 {
     { "image/gif", 	"GIF", 			  0 },
     { "image/jpeg", "\377\330\377",   0 },
     { "video/mpeg", "\0\0\001\263",	  4 },
     { "application/postscript", "%!", 0 },
 };
-static int 	num_magic = (sizeof(magic)/sizeof(magic[0]));
+static int num_magic = MOZ_ARRAY_LENGTH(magic);
 
-static char *text_type    = TEXT_PLAIN;					/* the text file type.	*/		
-static char *default_type = APPLICATION_OCTET_STREAM;
+static const char *text_type    = TEXT_PLAIN;					/* the text file type. */
+static const char *default_type = APPLICATION_OCTET_STREAM;
 
 
 /*
  * Determins the format of the file "inputf".  The name
  * of the file format (or NULL on error) is returned.
  */
-static char *magic_look(char *inbuff, int numread)
+static const char *magic_look(char *inbuff, int numread)
 {
     int i, j;
 
 	for (i=0; i<num_magic; i++) 
 	{
 	   	if (magic[i].len == 0) 
 	   		magic[i].len = strlen(magic[i].num);
 	}
@@ -432,17 +427,17 @@ int ap_encode_data(
 	char   		rd_buff[256];
     FSIORefNum fileId;
 	OSErr		retval = noErr;
     ByteCount in_count;
 	int			status;
 	
 	if (firstime)
 	{	
-		char* magic_type;
+		const char* magic_type;
 			
 		/*
 		** preparing to encode the data fork.
 		*/
         nsCOMPtr <nsIFile> resFile;
         NS_NewNativeLocalFile(nsDependentCString(p_ap_encode_obj->fname), true,
                               getter_AddRefs(resFile));
         if (!resFile)
@@ -488,33 +483,33 @@ int ap_encode_data(
         nsAutoCString leafName;
         resFile->GetNativeLeafName(leafName);
 		PR_snprintf(rd_buff, sizeof(rd_buff),
 			"Content-Type: %s; name=\"%s\"" CRLF "Content-Transfer-Encoding: base64" CRLF "Content-Disposition: inline; filename=\"%s\"" CRLF CRLF,
 			magic_type,
 			leafName.get(),
 			leafName.get());
 			
-		status = write_stream(p_ap_encode_obj, 
-					rd_buff, 
-					strlen(rd_buff)); 
+		status = write_stream(p_ap_encode_obj, (const char*)rd_buff, strlen(rd_buff));
 		if (status != noErr)
 			return status;
 	}
 	
 	while (retval == noErr)
 	{
 		if (BUFF_LEFT(p_ap_encode_obj) < 400)
 			break;
 			
         in_count = 0;
         retval = ::FSReadFork(p_ap_encode_obj->fileId, fsAtMark, 0, 256, rd_buff, &in_count);
 		if (in_count)
 		{
+#if 0
 /*			replace(rd_buff, in_count, '\r', '\n');	 						*/
+#endif
 /* ** may be need to do character set conversion here for localization.	**  */		
 			status = to64(p_ap_encode_obj,
 						rd_buff,
 						in_count);
 			if (status != noErr)
 				return status;
 		}
 	}
@@ -529,19 +524,17 @@ int ap_encode_data(
 			return status;
 		
 		/* write out the boundary 	*/
 		
 		PR_snprintf(rd_buff, sizeof(rd_buff),
 						CRLF "--%s--" CRLF CRLF, 
 						p_ap_encode_obj->boundary);
 	
-		status = write_stream(p_ap_encode_obj,
-						rd_buff,
-						strlen(rd_buff));
+		status = write_stream(p_ap_encode_obj, (const char*)rd_buff, strlen(rd_buff));
 	
 		if (status == noErr)				
 			status = errDone;
 	}
 	return status;
 }
 
 static char basis_64[] =
@@ -701,12 +694,10 @@ static int output64chunk(
         *p++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)];
         *p++ = '=';
     } 
     else 
     {
         *p++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)];
         *p++ = basis_64[c3 & 0x3F];
     }
-	return write_stream(p_ap_encode_obj,
-						tmpstr,
-						p-tmpstr);
+    return write_stream(p_ap_encode_obj, (const char*) tmpstr, p-tmpstr);
 }
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -70,16 +70,17 @@
 #include "nsIMsgHdr.h"
 #include "nsIMsgFolder.h"
 #include "nsComposeStrings.h"
 #include "nsStringGlue.h"
 #include "nsMsgUtils.h"
 #include "nsIArray.h"
 #include "nsArrayUtils.h"
 #include "mozilla/Services.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/mailnews/MimeEncoder.h"
 #include "mozilla/mailnews/MimeHeaderParser.h"
 #include "nsIMutableArray.h"
 #include "nsIMsgFilterService.h"
 #include "nsIMsgProtocolInfo.h"
 #include "mozIDOMWindow.h"
 
 using namespace mozilla::mailnews;
@@ -167,17 +168,17 @@ static nsresult StripOutGroupNames(char 
 
       case ';':
         if (quoted || !group)
           break;
         else
           group = false;
           //end of the group, act like a recipient separator now...
         /* NO BREAK */
-
+        MOZ_FALLTHROUGH;
       case ',':
         if (!quoted)
         {
           atFound = false;
           //let check if we already have a comma separator in the output string
           if (writePtr > addresses && *(writePtr - 1) == ',')
             writePtr --;
           *writePtr = ',';
@@ -3160,16 +3161,21 @@ NS_IMETHODIMP nsMsgComposeAndSend::SendD
         aExitCode = NS_ERROR_POST_FAILED;
 
     DeliverAsNewsExit(aUrl, aExitCode);
   }
   else
   {
     if (NS_FAILED(aExitCode))
     {
+#ifdef __GNUC__
+// Temporary workaroung until bug 783526 is fixed.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wswitch"
+#endif
       switch (aExitCode)
       {
         case NS_ERROR_UNKNOWN_HOST:
         case NS_ERROR_UNKNOWN_PROXY_HOST:
           aExitCode = NS_ERROR_SMTP_SEND_FAILED_UNKNOWN_SERVER;
           break;
         case NS_ERROR_CONNECTION_REFUSED:
         case NS_ERROR_PROXY_CONNECTION_REFUSED:
@@ -3185,16 +3191,19 @@ NS_IMETHODIMP nsMsgComposeAndSend::SendD
         case NS_ERROR_SMTP_PASSWORD_UNDEFINED:
             // nothing to do, just keep the code
           break;
         default:
           if (aExitCode != NS_ERROR_ABORT && !NS_IS_MSG_ERROR(aExitCode))
             aExitCode = NS_ERROR_SMTP_SEND_FAILED_UNKNOWN_REASON;
           break;
       }
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
     }
     DeliverAsMailExit(aUrl, aExitCode);
   }
 
   return aExitCode;
 }
 
 nsresult
--- a/mailnews/compose/src/nsMsgSendReport.cpp
+++ b/mailnews/compose/src/nsMsgSendReport.cpp
@@ -269,32 +269,40 @@ NS_IMETHODIMP nsMsgSendReport::DisplayRe
   {
     //TODO display a success error message
     return NS_OK;
   }
 
   //Do we have an explanation of the error? if no, try to build one...
   if (currMessage.IsEmpty())
   {
+#ifdef __GNUC__
+// Temporary workaroung until bug 783526 is fixed.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wswitch"
+#endif
     switch (currError)
     {
       case NS_BINDING_ABORTED:
       case NS_ERROR_SEND_FAILED:
       case NS_ERROR_SEND_FAILED_BUT_NNTP_OK:
       case NS_MSG_FAILED_COPY_OPERATION:
       case NS_MSG_UNABLE_TO_SEND_LATER:
       case NS_MSG_UNABLE_TO_SAVE_DRAFT:
       case NS_MSG_UNABLE_TO_SAVE_TEMPLATE:
         //Ignore, don't need to repeat ourself.
         break;
       default:
         const char16_t* errorString = errorStringNameForErrorCode(currError);
         nsMsgGetMessageByName(errorString, currMessage);
         break;
     }
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
   }
 
   if (mDeliveryMode == nsIMsgCompDeliverMode::Now || mDeliveryMode == nsIMsgCompDeliverMode::SendUnsent)
   {
     // SMTP is taking care of it's own error message and will return NS_ERROR_BUT_DONT_SHOW_ALERT as error code.
     // In that case, we must not show an alert ourself.
     if (currError == NS_ERROR_BUT_DONT_SHOW_ALERT)
     {
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -35,16 +35,17 @@
 #include "nsComposeStrings.h"
 #include "nsIStringBundle.h"
 #include "nsMsgCompUtils.h"
 #include "nsIMsgWindow.h"
 #include "MailNewsTypes2.h" // for nsMsgSocketType and nsMsgAuthMethod
 #include "nsIIDNService.h"
 #include "mozilla/mailnews/MimeHeaderParser.h"
 #include "mozilla/Services.h"
+#include "mozilla/Attributes.h"
 #include "nsINetAddr.h"
 #include "nsIProxyInfo.h"
 
 #ifndef XP_UNIX
 #include <stdarg.h>
 #endif /* !XP_UNIX */
 
 #undef PostMessage // avoid to collision with WinUser.h
@@ -88,16 +89,21 @@ nsresult nsExplainErrorDetails(nsISmtpUr
   nsresult rv = bundleService->CreateBundle(
     "chrome://messenger/locale/messengercompose/composeMsgs.properties",
     getter_AddRefs(bundle));
   NS_ENSURE_SUCCESS(rv, rv);
 
   va_start (args, aCode);
 
   const char16_t* exitString;
+#ifdef __GNUC__
+// Temporary workaroung until bug 783526 is fixed.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wswitch"
+#endif
   switch (aCode)
   {
     case NS_ERROR_ILLEGAL_LOCALPART:
       bundle->GetStringFromName(u"errorIllegalLocalPart",
                                 getter_Copies(eMsg));
       msg = nsTextFormatter::vsmprintf(eMsg.get(), args);
       break;
     case NS_ERROR_SMTP_SERVER_ERROR:
@@ -115,16 +121,19 @@ nsresult nsExplainErrorDetails(nsISmtpUr
       msg = nsTextFormatter::vsmprintf(eMsg.get(), args);
       break;
     default:
       NS_WARNING("falling to default error code");
       bundle->GetStringFromName(u"communicationsError", getter_Copies(eMsg));
       msg = nsTextFormatter::smprintf(eMsg.get(), aCode);
       break;
   }
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
 
   if (msg)
   {
     rv = dialog->Alert(nullptr, msg);
     nsTextFormatter::smprintf_free(msg);
   }
 
   va_end (args);
@@ -892,16 +901,17 @@ void nsSmtpProtocol::InitPrefAuthMethods
           SMTP_AUTH_EXTERNAL_ENABLED; // TODO: Expose EXTERNAL? How?
       break;
     default:
       NS_ASSERTION(false, "SMTP: authMethod pref invalid");
       // TODO log to error console
       MOZ_LOG(SMTPLogModule, mozilla::LogLevel::Error,
           ("SMTP: bad pref authMethod = %d\n", authMethodPrefValue));
       // fall to any
+      MOZ_FALLTHROUGH;
     case nsMsgAuthMethod::anything:
       m_prefAuthMethods =
           SMTP_AUTH_LOGIN_ENABLED | SMTP_AUTH_PLAIN_ENABLED |
           SMTP_AUTH_CRAM_MD5_ENABLED | SMTP_AUTH_GSSAPI_ENABLED |
           SMTP_AUTH_NTLM_ENABLED | SMTP_AUTH_MSN_ENABLED |
           SMTP_AUTH_OAUTH2_ENABLED |
           SMTP_AUTH_EXTERNAL_ENABLED;
       break;
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -1030,17 +1030,17 @@ public:
   NS_IMETHOD GetName(nsACString &aName)
   {
     aName.AssignLiteral("msg-database-objects");
     return NS_OK;
   }
 
   NS_IMETHOD CollectReports(nsIMemoryReporterCallback*aCb,
                             nsISupports* aClosure,
-                            bool aAnonymize)
+                            bool aAnonymize) override
   {
     nsCString path;
     GetPath(path, aAnonymize);
     return aCb->Callback(EmptyCString(), path,
                          nsIMemoryReporter::KIND_HEAP,
                          nsIMemoryReporter::UNITS_BYTES,
                          mDatabase->SizeOfIncludingThis(GetMallocSize),           
                          NS_LITERAL_CSTRING("Memory used for the folder database."),
--- a/mailnews/db/msgdb/src/nsMsgHdr.cpp
+++ b/mailnews/db/msgdb/src/nsMsgHdr.cpp
@@ -6,16 +6,17 @@
 #include "msgCore.h"
 #include "mozilla/mailnews/MimeHeaderParser.h"
 #include "nsMsgHdr.h"
 #include "nsMsgDatabase.h"
 #include "nsMsgUtils.h"
 #include "nsIMsgThread.h"
 #include "nsMsgMimeCID.h"
 #include "nsIMimeConverter.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla::mailnews;
 
 NS_IMPL_ISUPPORTS(nsMsgHdr, nsIMsgDBHdr)
 
 #define FLAGS_INITED 0x1
 #define CACHED_VALUES_INITED 0x2
 #define REFERENCES_INITED 0x4
@@ -764,16 +765,17 @@ const char *nsMsgHdr::GetNextReference(c
         // do nothing, make default case mean you didn't get whitespace
         break;
       case '<':
         firstMessageIdChar = ++ptr; // skip over the '<'
         foundLessThan = true; // (flag to stop)
         // intentional fallthrough so whitespaceEndedAt will definitely have
         //  a non-NULL value, just in case the message-id is not valid (no '>')
         //  and the old-school support is desired.
+        MOZ_FALLTHROUGH;
       default:
         if (!whitespaceEndedAt)
             whitespaceEndedAt = ptr;
         break;
     }
   }
 
   // keep going until we hit a '>' or hit the end of the string 
--- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
+++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
@@ -39,16 +39,17 @@ using namespace mozilla;
 #include "nsIParserUtils.h"
 #include "nsIDocumentEncoder.h"
 
 #include "nsIncompleteGamma.h"
 #include <math.h>
 #include <prmem.h>
 #include "nsIMsgTraitService.h"
 #include "mozilla/Services.h"
+#include "mozilla/Attributes.h"
 #include <cstdlib> // for std::abs(int/long)
 #include <cmath> // for std::abs(float/double)
 
 static PRLogModuleInfo *BayesianFilterLogModule = nullptr;
 
 #define kDefaultJunkThreshold .99 // we override this value via a pref
 static const char* kBayesianFilterTokenDelimiters = " \t\n\r\f.";
 static unsigned int kMinLengthForToken = 3; // lower bound on the number of characters in a word before we treat it as a token
@@ -541,16 +542,17 @@ void Tokenizer::tokenizeHeaders(nsIUTF8S
 
         // important: leave out sender field. Too strong of an indicator
         break;
     case 'x': // (2) X-Mailer / user-agent works best if it is untokenized, just fold the case and any leading/trailing white space
         // all headers beginning with x-mozilla are being changed by us, so ignore
         if (Substring(headerName, 0, 9).Equals("x-mozilla"))
           break;
         // fall through
+        MOZ_FALLTHROUGH;
     case 'u':
         addTokenForHeader(headerName.get(), headerValue);
         break;
     default:
         addTokenForHeader(headerName.get(), headerValue);
         break;
     } // end switch
 
--- a/mailnews/imap/src/nsImapIncomingServer.h
+++ b/mailnews/imap/src/nsImapIncomingServer.h
@@ -67,17 +67,17 @@ public:
   NS_IMETHOD OnUserOrHostNameChanged(const nsACString& oldName,
                                      const nsACString& newName,
                                      bool hostnameChanged) override;
   NS_IMETHOD GetNumIdleConnections(int32_t *aNumIdleConnections);
   NS_IMETHOD ForgetSessionPassword() override;
   NS_IMETHOD GetMsgFolderFromURI(nsIMsgFolder *aFolderResource,
                                  const nsACString& aURI,
                                  nsIMsgFolder **aFolder) override;
-  NS_IMETHOD SetSocketType(int32_t aSocketType);
+  NS_IMETHOD SetSocketType(int32_t aSocketType) override;
   NS_IMETHOD VerifyLogon(nsIUrlListener *aUrlListener, nsIMsgWindow *aMsgWindow,
                          nsIURI **aURL) override;
 
 protected:
   virtual ~nsImapIncomingServer();
   nsresult GetFolder(const nsACString& name, nsIMsgFolder** pFolder);
   virtual nsresult CreateRootFolderFromUri(const nsCString &serverUri,
                                            nsIMsgFolder **rootFolder) override;
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -89,16 +89,17 @@
 #include "nsIMsgFilterCustomAction.h"
 #include "nsMsgReadStateTxn.h"
 #include "nsIStringEnumerator.h"
 #include "nsIMsgStatusFeedback.h"
 #include "nsAlgorithm.h"
 #include "nsMsgLineBuffer.h"
 #include <algorithm>
 #include "mozilla/Logging.h"
+#include "mozilla/Attributes.h"
 #include "nsStringStream.h"
 #include "nsIStreamListener.h"
 
 static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
 static NS_DEFINE_CID(kParseMailMsgStateCID, NS_PARSEMAILMSGSTATE_CID);
 static NS_DEFINE_CID(kCImapHostSessionList, NS_IIMAPHOSTSESSIONLIST_CID);
 
 extern PRLogModuleInfo *gAutoSyncLog;
@@ -820,28 +821,27 @@ NS_IMETHODIMP nsImapMailFolder::UpdateFo
     }
     if (url)
     {
       nsCOMPtr <nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(url, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
       mailnewsUrl->RegisterListener(this);
       m_urlListener = aUrlListener;
     }
-    switch (rv)
-    {
-      case NS_MSG_ERROR_OFFLINE:
-        if (aMsgWindow)
-          AutoCompact(aMsgWindow);
-        // note fall through to next case.
-      case NS_BINDING_ABORTED:
-        rv = NS_OK;
-        NotifyFolderEvent(mFolderLoadedAtom);
-        break;
-      default:
-        break;
+
+    if (rv == NS_MSG_ERROR_OFFLINE)
+    {
+      if (aMsgWindow)
+        AutoCompact(aMsgWindow);
+    }
+
+    if (rv == NS_MSG_ERROR_OFFLINE || rv == NS_BINDING_ABORTED)
+    {
+      rv = NS_OK;
+      NotifyFolderEvent(mFolderLoadedAtom);
     }
   }
   else if (NS_SUCCEEDED(rv))  // tell the front end that the folder is loaded if we're not going to
   {                           // actually run a url.
     if (!m_updatingFolder)    // if we're already running an update url, we'll let that one send the folder loaded
       NotifyFolderEvent(mFolderLoadedAtom);
   }
   return rv;
@@ -3533,16 +3533,17 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
             mDatabase->MarkImapDeleted(msgKey, true, nullptr);
             StoreImapFlags(kImapMsgSeenFlag | kImapMsgDeletedFlag, true,
                            &msgKey, 1, nullptr);
             m_msgMovedByFilter = true; // this will prevent us from adding the header to the db.
           }
           msgIsNew = false;
         }
         // note that delete falls through to move.
+        MOZ_FALLTHROUGH;
         case nsMsgFilterAction::MoveToFolder:
         {
           // if moving to a different file, do it.
           nsCString uri;
           rv = GetURI(uri);
 
           if (!actionTargetFolderUri.Equals(uri))
           {
--- a/mailnews/imap/src/nsImapMailFolder.h
+++ b/mailnews/imap/src/nsImapMailFolder.h
@@ -205,17 +205,17 @@ public:
   // nsIMsgFolder methods:
   NS_IMETHOD GetSubFolders(nsISimpleEnumerator **aResult) override;
 
   NS_IMETHOD GetMessages(nsISimpleEnumerator* *result) override;
   NS_IMETHOD UpdateFolder(nsIMsgWindow *aWindow) override;
 
   NS_IMETHOD CreateSubfolder(const nsAString& folderName,nsIMsgWindow *msgWindow ) override;
   NS_IMETHOD AddSubfolder(const nsAString& aName, nsIMsgFolder** aChild) override;
-  NS_IMETHODIMP CreateStorageIfMissing(nsIUrlListener* urlListener);
+  NS_IMETHODIMP CreateStorageIfMissing(nsIUrlListener* urlListener) override;
 
   NS_IMETHOD Compact(nsIUrlListener *aListener, nsIMsgWindow *aMsgWindow) override;
   NS_IMETHOD CompactAll(nsIUrlListener *aListener, nsIMsgWindow *aMsgWindow,
                         bool aCompactOfflineAlso) override;
   NS_IMETHOD EmptyTrash(nsIMsgWindow *msgWindow, nsIUrlListener *aListener) override;
   NS_IMETHOD CopyDataToOutputStreamForAppend(nsIInputStream *aIStream,
                      int32_t aLength, nsIOutputStream *outputStream) override;
   NS_IMETHOD CopyDataDone() override;
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -70,16 +70,17 @@ PRLogModuleInfo *IMAP;
 #include "nsIProxyInfo.h"
 #include "nsISSLSocketControl.h"
 #include "nsProxyRelease.h"
 #include "nsDebug.h"
 #include "nsMsgCompressIStream.h"
 #include "nsMsgCompressOStream.h"
 #include "nsAlgorithm.h"
 #include "mozilla/Logging.h"
+#include "mozilla/Attributes.h"
 #include "nsIPrincipal.h"
 #include "nsContentSecurityManager.h"
 
 using namespace mozilla;
 
 #define ONE_SECOND ((uint32_t)1000)    // one second
 
 #define OUTPUT_BUFFER_SIZE (4096*2) // mscott - i should be able to remove this if I can use nsMsgLineBuffer???
@@ -2698,16 +2699,17 @@ void nsImapProtocol::ProcessSelectedStat
               }
             }
           }
         }
         break;
       case nsIImapUrl::nsImapExpungeFolder:
         Expunge();
         // note fall through to next cases.
+        MOZ_FALLTHROUGH;
       case nsIImapUrl::nsImapSelectFolder:
       case nsIImapUrl::nsImapSelectNoopFolder:
         if (!moreHeadersToDownload)
           ProcessMailboxUpdate(true);
         break;
       case nsIImapUrl::nsImapMsgHeader:
         {
           nsCString messageIds;
@@ -5523,16 +5525,17 @@ void nsImapProtocol::InitPrefAuthMethods
             kHasAuthNTLMCapability | kHasAuthMSNCapability;
         break;
       default:
         NS_ASSERTION(false, "IMAP: authMethod pref invalid");
         // TODO log to error console
         MOZ_LOG(IMAP, LogLevel::Error,
             ("IMAP: bad pref authMethod = %d\n", authMethodPrefValue));
         // fall to any
+        MOZ_FALLTHROUGH;
       case nsMsgAuthMethod::anything:
         m_prefAuthMethods = kHasAuthOldLoginCapability |
             kHasAuthLoginCapability | kHasAuthPlainCapability |
             kHasCRAMCapability | kHasAuthGssApiCapability |
             kHasAuthNTLMCapability | kHasAuthMSNCapability |
             kHasAuthExternalCapability | kHasXOAuth2Capability;
         break;
       case nsMsgAuthMethod::OAuth2:
--- a/mailnews/imap/src/nsImapProtocol.h
+++ b/mailnews/imap/src/nsImapProtocol.h
@@ -557,17 +557,17 @@ private:
 
   nsresult GlobalInitialization(nsIPrefBranch *aPrefBranch);
   nsresult Configure(int32_t TooFastTime, int32_t IdealTime,
     int32_t ChunkAddSize, int32_t ChunkSize, int32_t ChunkThreshold,
     bool FetchByChunks);
   nsresult GetMsgWindow(nsIMsgWindow ** aMsgWindow);
   // End Process AuthenticatedState Url helper methods
 
-  virtual char const *GetType() {return "imap";}
+  virtual char const *GetType() override {return "imap";}
 
   // Quota support
   void GetQuotaDataIfSupported(const char *aBoxName);
 
   // CondStore support - true if server supports it, and the user hasn't disabled it.
   bool UseCondStore();
   // false if pref "mail.server.serverxxx.use_condstore" is false;
   bool m_useCondStore; 
--- a/mailnews/imap/src/nsImapServerResponseParser.cpp
+++ b/mailnews/imap/src/nsImapServerResponseParser.cpp
@@ -236,17 +236,17 @@ void nsImapServerResponseParser::ParseIM
           response_tagged();
 
       } while (ContinueParse() && !inIdle && (numberOfTaggedResponsesReceived < fNumberOfTaggedResponsesExpected));
 
       // check and see if the server is waiting for more input
       // it's possible that we ate this + while parsing certain responses (like cram data),
       // in these cases, the parsing routine for that specific command will manually set
       // fWaitingForMoreClientInput so we don't lose that information....
-      if (fNextToken && (*fNextToken == '+') || inIdle)
+      if ((fNextToken && (*fNextToken == '+')) || inIdle)
       {
         fWaitingForMoreClientInput = true;
       }
       // if we aren't still waiting for more input....
       else if (!fWaitingForMoreClientInput && !aGreetingWithCapability)
       {
         if (ContinueParse())
           response_done();
--- a/mailnews/imap/src/nsImapUrl.cpp
+++ b/mailnews/imap/src/nsImapUrl.cpp
@@ -860,17 +860,17 @@ NS_IMETHODIMP nsImapUrl::AllocateServerP
     if (*src == '^')
       extra += 1; /* ^ -> ^^ */
     src++;
   }
   char* result = (char *)moz_xmalloc(len + extra + 1);
   if (!result)
     return NS_ERROR_OUT_OF_MEMORY;
 
-  register unsigned char* dst = (unsigned char *) result;
+  unsigned char* dst = (unsigned char *) result;
   src = sourcePath;
   for (i = 0; i < len; i++)
   {
     unsigned char c = *src++;
     if (c == '/')
       *dst++ = '^';
     else if (c == '^')
     {
@@ -882,18 +882,18 @@ NS_IMETHODIMP nsImapUrl::AllocateServerP
   }
   *dst = '\0';     /* tack on eos */
   *resultPath = result;
   return NS_OK;
 }
 
 /* static */ nsresult nsImapUrl::UnescapeSlashes(char *sourcePath)
 {
-    register char *src = sourcePath;
-    register char *dst = sourcePath;
+    char *src = sourcePath;
+    char *dst = sourcePath;
 
     while (*src)
     {
       if (*src == '^')
       {
         if (*(src + 1) == '^')
         {
           *dst++ = '^';
--- a/mailnews/import/src/nsImportAddressBooks.cpp
+++ b/mailnews/import/src/nsImportAddressBooks.cpp
@@ -39,31 +39,31 @@ class nsImportGenericAddressBooks : publ
 {
 public:
 
   nsImportGenericAddressBooks();
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   /* nsISupports GetData (in string dataId); */
-  NS_IMETHOD GetData(const char *dataId, nsISupports **_retval);
+  NS_IMETHOD GetData(const char *dataId, nsISupports **_retval) override;
 
-  NS_IMETHOD SetData(const char *dataId, nsISupports *pData);
+  NS_IMETHOD SetData(const char *dataId, nsISupports *pData) override;
 
-  NS_IMETHOD GetStatus(const char *statusKind, int32_t *_retval);
+  NS_IMETHOD GetStatus(const char *statusKind, int32_t *_retval) override;
 
-  NS_IMETHOD WantsProgress(bool *_retval);
+  NS_IMETHOD WantsProgress(bool *_retval) override;
 
-  NS_IMETHOD BeginImport(nsISupportsString *successLog, nsISupportsString *errorLog, bool *_retval) ;
+  NS_IMETHOD BeginImport(nsISupportsString *successLog, nsISupportsString *errorLog, bool *_retval) override;
 
-  NS_IMETHOD ContinueImport(bool *_retval);
+  NS_IMETHOD ContinueImport(bool *_retval) override;
 
-  NS_IMETHOD GetProgress(int32_t *_retval);
+  NS_IMETHOD GetProgress(int32_t *_retval) override;
 
-  NS_IMETHOD CancelImport(void);
+  NS_IMETHOD CancelImport(void) override;
 
 private:
   virtual ~nsImportGenericAddressBooks();
   void  GetDefaultLocation(void);
   void  GetDefaultBooks(void);
   void  GetDefaultFieldMap(void);
 
 public:
--- a/mailnews/import/src/nsImportMail.cpp
+++ b/mailnews/import/src/nsImportMail.cpp
@@ -50,31 +50,31 @@ class nsImportGenericMail : public nsIIm
 {
 public:
 
   nsImportGenericMail();
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   /* nsISupports GetData (in string dataId); */
-  NS_IMETHOD GetData(const char *dataId, nsISupports **_retval);
+  NS_IMETHOD GetData(const char *dataId, nsISupports **_retval) override;
 
-  NS_IMETHOD SetData(const char *dataId, nsISupports *pData);
+  NS_IMETHOD SetData(const char *dataId, nsISupports *pData) override;
 
-  NS_IMETHOD GetStatus(const char *statusKind, int32_t *_retval);
+  NS_IMETHOD GetStatus(const char *statusKind, int32_t *_retval) override;
 
-  NS_IMETHOD WantsProgress(bool *_retval);
+  NS_IMETHOD WantsProgress(bool *_retval) override;
 
-  NS_IMETHODIMP BeginImport(nsISupportsString *successLog, nsISupportsString *errorLog, bool *_retval) ;
+  NS_IMETHODIMP BeginImport(nsISupportsString *successLog, nsISupportsString *errorLog, bool *_retval) override;
 
-  NS_IMETHOD ContinueImport(bool *_retval);
+  NS_IMETHOD ContinueImport(bool *_retval) override;
 
-  NS_IMETHOD GetProgress(int32_t *_retval);
+  NS_IMETHOD GetProgress(int32_t *_retval) override;
 
-  NS_IMETHOD CancelImport(void);
+  NS_IMETHOD CancelImport(void) override;
 
 private:
   virtual ~nsImportGenericMail();
   bool    CreateFolder(nsIMsgFolder **ppFolder);
   void  GetDefaultMailboxes(void);
   void  GetDefaultLocation(void);
   void  GetDefaultDestination(void);
   void  GetMailboxName(uint32_t index, nsISupportsString *pStr);
--- a/mailnews/import/src/nsImportService.cpp
+++ b/mailnews/import/src/nsImportService.cpp
@@ -325,17 +325,18 @@ nsProxySendRunnable::nsProxySendRunnable
 
 NS_IMETHODIMP nsProxySendRunnable::Run()
 {
   nsresult rv;
   nsCOMPtr<nsIMsgSend> msgSend = do_CreateInstance(NS_MSGSEND_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsArray> supportsArray;
-  NS_NewISupportsArray(getter_AddRefs(supportsArray));
+  rv = NS_NewISupportsArray(getter_AddRefs(supportsArray));
+  NS_ENSURE_SUCCESS(rv, rv);
 
   if (m_embeddedAttachments) {
     nsCOMPtr<nsISimpleEnumerator> enumerator;
     m_embeddedAttachments->Enumerate(getter_AddRefs(enumerator));
 
     bool hasMore;
     while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMore)) && hasMore) {
       nsCOMPtr<nsISupports> item;
--- a/mailnews/import/text/src/nsTextImport.cpp
+++ b/mailnews/import/text/src/nsTextImport.cpp
@@ -55,42 +55,42 @@ public:
 
   static nsresult Create(nsIImportAddressBooks** aImport,
                          nsIStringBundle *aStringBundle);
 
     // nsISupports interface
     NS_DECL_THREADSAFE_ISUPPORTS
 
     // nsIImportAddressBooks interface
-    
-  NS_IMETHOD GetSupportsMultiple(bool *_retval) { *_retval = false; return NS_OK;}
 
-  NS_IMETHOD GetAutoFind(char16_t **description, bool *_retval);
+  NS_IMETHOD GetSupportsMultiple(bool *_retval) override { *_retval = false; return NS_OK;}
+
+  NS_IMETHOD GetAutoFind(char16_t **description, bool *_retval) override;
 
-  NS_IMETHOD GetNeedsFieldMap(nsIFile *location, bool *_retval);
+  NS_IMETHOD GetNeedsFieldMap(nsIFile *location, bool *_retval) override;
 
-  NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify);
+  NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify) override;
 
-  NS_IMETHOD FindAddressBooks(nsIFile *location, nsIArray **_retval);
+  NS_IMETHOD FindAddressBooks(nsIFile *location, nsIArray **_retval) override;
 
-  NS_IMETHOD InitFieldMap(nsIImportFieldMap *fieldMap);
+  NS_IMETHOD InitFieldMap(nsIImportFieldMap *fieldMap) override;
 
   NS_IMETHOD ImportAddressBook(nsIImportABDescriptor *source,
                                nsIAddrDatabase *destination,
                                nsIImportFieldMap *fieldMap,
                                nsISupports *aSupportService,
                                char16_t **errorLog,
                                char16_t **successLog,
-                               bool *fatalError);
+                               bool *fatalError) override;
 
-  NS_IMETHOD GetImportProgress(uint32_t *_retval);
+  NS_IMETHOD GetImportProgress(uint32_t *_retval) override;
 
-  NS_IMETHOD GetSampleData(int32_t index, bool *pFound, char16_t **pStr);
+  NS_IMETHOD GetSampleData(int32_t index, bool *pFound, char16_t **pStr) override;
 
-  NS_IMETHOD SetSampleLocation(nsIFile *);
+  NS_IMETHOD SetSampleLocation(nsIFile *) override;
 
 private:
   void ClearSampleFile(void);
   void SaveFieldMap(nsIImportFieldMap *pMap);
 
   static void ReportSuccess(nsString& name, nsString *pStream,
                             nsIStringBundle* pBundle);
   static void SetLogs(nsString& success, nsString& error, char16_t **pError,
--- a/mailnews/import/vcard/src/nsVCardImport.cpp
+++ b/mailnews/import/vcard/src/nsVCardImport.cpp
@@ -37,47 +37,47 @@ public:
 
   // nsISupports interface
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // nsIImportAddressBooks interface
 
   // TODO: support multiple vCard files in future - shouldn't be too hard,
   // since you just import each file in turn.
-  NS_IMETHOD GetSupportsMultiple(bool *_retval)
+  NS_IMETHOD GetSupportsMultiple(bool *_retval) override
   { *_retval = false; return NS_OK;}
 
-  NS_IMETHOD GetAutoFind(char16_t **description, bool *_retval);
+  NS_IMETHOD GetAutoFind(char16_t **description, bool *_retval) override;
 
-  NS_IMETHOD GetNeedsFieldMap(nsIFile *location, bool *_retval)
+  NS_IMETHOD GetNeedsFieldMap(nsIFile *location, bool *_retval) override
   { *_retval = false; return NS_OK;}
 
   NS_IMETHOD GetDefaultLocation(
-      nsIFile **location, bool *found, bool *userVerify);
+      nsIFile **location, bool *found, bool *userVerify) override;
 
-  NS_IMETHOD FindAddressBooks(nsIFile *location, nsIArray **_retval);
+  NS_IMETHOD FindAddressBooks(nsIFile *location, nsIArray **_retval) override;
 
-  NS_IMETHOD InitFieldMap(nsIImportFieldMap *fieldMap)
+  NS_IMETHOD InitFieldMap(nsIImportFieldMap *fieldMap) override
   { return NS_ERROR_FAILURE;}
 
   NS_IMETHOD ImportAddressBook(nsIImportABDescriptor *source,
                                nsIAddrDatabase *destination,
                                nsIImportFieldMap *fieldMap,
                                nsISupports *aSupportService,
                                char16_t **errorLog,
                                char16_t **successLog,
-                               bool *fatalError);
+                               bool *fatalError) override;
 
-  NS_IMETHOD GetImportProgress(uint32_t *_retval);
+  NS_IMETHOD GetImportProgress(uint32_t *_retval) override;
 
-  NS_IMETHOD GetSampleData(int32_t index, bool *pFound, char16_t **pStr)
+  NS_IMETHOD GetSampleData(int32_t index, bool *pFound, char16_t **pStr) override
   { return NS_ERROR_FAILURE;}
 
-  NS_IMETHOD SetSampleLocation(nsIFile *)
-  { return NS_ERROR_FAILURE; } 
+  NS_IMETHOD SetSampleLocation(nsIFile *) override
+  { return NS_ERROR_FAILURE; }
 
 private:
   virtual ~ImportVCardAddressImpl();
   static void ReportSuccess(
       nsString& name, nsString *pStream, nsIStringBundle* pBundle);
   static void SetLogs(
       nsString& success, nsString& error,
       char16_t **pError, char16_t **pSuccess);
--- a/mailnews/jsaccount/src/JaIncomingServer.h
+++ b/mailnews/jsaccount/src/JaIncomingServer.h
@@ -29,17 +29,17 @@ class JaBaseCppIncomingServer : public n
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIINTERFACEREQUESTOR
   JaBaseCppIncomingServer() { }
 
   // nsMsgIncomingServer overrides
   nsresult CreateRootFolderFromUri(const nsCString &serverUri,
-                                         nsIMsgFolder **rootFolder);
+                                         nsIMsgFolder **rootFolder) override;
 
 protected:
   virtual ~JaBaseCppIncomingServer() { }
 
 };
 
 class JaCppIncomingServerDelegator : public JaBaseCppIncomingServer,
                                      public msgIOverride
--- a/mailnews/jsaccount/src/JaMsgFolder.h
+++ b/mailnews/jsaccount/src/JaMsgFolder.h
@@ -30,18 +30,18 @@ class JaBaseCppMsgFolder : public nsMsgD
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIINTERFACEREQUESTOR
   JaBaseCppMsgFolder() { }
 
   // nsMsgDBFolder overrides
 
-  nsresult CreateChildFromURI(const nsCString &uri, nsIMsgFolder **folder);
-  nsresult GetDatabase();
+  nsresult CreateChildFromURI(const nsCString &uri, nsIMsgFolder **folder) override;
+  nsresult GetDatabase() override;
 
   // Local Utility Functions
 
   // Create a placeholder file to represent a folder.
   nsresult CreateDummyFile(nsIMsgFolder* aMailFolder);
 
 protected:
   virtual ~JaBaseCppMsgFolder() { }
--- a/mailnews/jsaccount/src/JaUrl.h
+++ b/mailnews/jsaccount/src/JaUrl.h
@@ -34,18 +34,18 @@ class JaBaseCppUrl : public nsMsgMailNew
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIMSGMESSAGEURL
   NS_DECL_NSIINTERFACEREQUESTOR
   JaBaseCppUrl() { }
 
   // nsIMsgMailNewsUrl overrides
-  NS_IMETHOD GetFolder(nsIMsgFolder **aFolder);
-  NS_IMETHOD SetFolder(nsIMsgFolder *aFolder);
+  NS_IMETHOD GetFolder(nsIMsgFolder **aFolder) override;
+  NS_IMETHOD SetFolder(nsIMsgFolder *aFolder) override;
 
 protected:
   virtual ~JaBaseCppUrl() { }
 
   // nsIMsgMailUrl variables.
 
   nsCOMPtr<nsIMsgFolder> mFolder;
 
--- a/mailnews/local/src/nsMailboxUrl.h
+++ b/mailnews/local/src/nsMailboxUrl.h
@@ -37,33 +37,33 @@ public:
     *result = m_mailboxAction;
     return NS_OK;
   }
   NS_IMETHOD SetMailboxAction(nsMailboxAction aAction) override
   {
     m_mailboxAction = aAction;
     return NS_OK;
   }
-  NS_IMETHOD IsUrlType(uint32_t type, bool *isType);
+  NS_IMETHOD IsUrlType(uint32_t type, bool *isType) override;
   NS_IMETHOD SetMoveCopyMsgKeys(nsMsgKey *keysToFlag, int32_t numKeys) override;
   NS_IMETHOD GetMoveCopyMsgHdrForIndex(uint32_t msgIndex, nsIMsgDBHdr **msgHdr) override;
   NS_IMETHOD GetNumMoveCopyMsgs(uint32_t *numMsgs) override;
   NS_IMETHOD GetCurMoveCopyMsgIndex(uint32_t *result) override
   {
     NS_ENSURE_ARG_POINTER(result);
     *result = m_curMsgIndex;
     return NS_OK;
   }
   NS_IMETHOD SetCurMoveCopyMsgIndex(uint32_t aIndex) override
   {
     m_curMsgIndex = aIndex;
     return NS_OK;
   }
 
-  NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder);
+  NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder) override;
 
   // nsIMsgMailNewsUrl override
   NS_IMETHOD CloneInternal(uint32_t aRefHandlingMode,
                            const nsACString& newRef,
                            nsIURI **_retval) override;
 
   // nsMailboxUrl
   nsMailboxUrl();
--- a/mailnews/local/src/nsMsgLocalStoreUtils.cpp
+++ b/mailnews/local/src/nsMsgLocalStoreUtils.cpp
@@ -297,17 +297,17 @@ nsMsgLocalStoreUtils::UpdateFolderFlag(n
  */
 bool
 nsMsgLocalStoreUtils::DiskSpaceAvailableInStore(nsIFile *aFile, uint64_t aSpaceRequested)
 {
   int64_t diskFree;
   nsresult rv = aFile->GetDiskSpaceAvailable(&diskFree);
   if (NS_SUCCEEDED(rv)) {
 #ifdef DEBUG
-    printf("GetDiskSpaceAvailable returned: %lld bytes\n", diskFree);
+    printf("GetDiskSpaceAvailable returned: %lld bytes\n", (long long)diskFree);
 #endif
     // When checking for disk space available, take into consideration
     // possible database changes, therefore ask for a little more
     // (EXTRA_SAFETY_SPACE) than what the requested size is. Also, due to disk
     // sector sizes, allocation blocks, etc. The space "available" may be greater
     // than the actual space usable.
     return ((aSpaceRequested + EXTRA_SAFETY_SPACE) < (uint64_t) diskFree);
   } else if (rv == NS_ERROR_NOT_IMPLEMENTED) {
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -55,16 +55,17 @@
 #include "nsIMutableArray.h"
 #include "nsArrayUtils.h"
 #include "nsIMsgFilterCustomAction.h"
 #include <ctype.h>
 #include "nsIMsgPluggableStore.h"
 #include "mozilla/Services.h"
 #include "nsQueryObject.h"
 #include "nsIOutputStream.h"
+#include "mozilla/Attributes.h"
 
 static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
 
 /* the following macros actually implement addref, release and query interface for our component. */
 NS_IMPL_ISUPPORTS_INHERITED(nsMsgMailboxParser,
                              nsParseMailMessageState,
                              nsIStreamListener,
                              nsIRequestObserver)
@@ -2035,17 +2036,17 @@ NS_IMETHODIMP nsParseNewMailState::Apply
           if (NS_SUCCEEDED(rv) && trash)
             rv = trash->GetURI(actionTargetFolderUri);
 
           msgHdr->OrFlags(nsMsgMessageFlags::Read, &newFlags); // mark read in trash.
           msgIsNew = false;
         }
 
         // FALLTHROUGH
-
+        MOZ_FALLTHROUGH;
       case nsMsgFilterAction::MoveToFolder:
         // if moving to a different file, do it.
         if (actionTargetFolderUri.get() && !m_inboxUri.Equals(actionTargetFolderUri,
                                                               nsCaseInsensitiveCStringComparator()))
         {
           nsresult err;
           nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &err));
           NS_ENSURE_SUCCESS(err, err);
--- a/mailnews/local/src/nsParseMailbox.h
+++ b/mailnews/local/src/nsParseMailbox.h
@@ -148,17 +148,17 @@ public:
 
   // message socket libnet callbacks, which come through folder pane
   nsresult ProcessMailboxInputStream(nsIURI* aURL, nsIInputStream *aIStream, uint32_t aLength);
 
   virtual void  DoneParsingFolder(nsresult status);
   virtual void  AbortNewHeader();
 
   // for nsMsgLineBuffer
-  virtual nsresult HandleLine(const char *line, uint32_t line_length);
+  virtual nsresult HandleLine(const char *line, uint32_t line_length) override;
 
   void  UpdateDBFolderInfo();
   void  UpdateDBFolderInfo(nsIMsgDatabase *mailDB);
   void  UpdateStatusText(const char* stringName);
 
   // Update the progress bar based on what we know.
   virtual void    UpdateProgressPercent ();
   virtual void OnNewMessage(nsIMsgWindow *msgWindow);
--- a/mailnews/local/src/nsPop3Protocol.cpp
+++ b/mailnews/local/src/nsPop3Protocol.cpp
@@ -40,16 +40,17 @@
 #include "nsILineInputStream.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsMsgMessageFlags.h"
 #include "nsMsgBaseCID.h"
 #include "nsIProxyInfo.h"
 #include "nsCRT.h"
 #include "mozilla/Services.h"
 #include "mozilla/Logging.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 PRLogModuleInfo *POP3LOGMODULE = nullptr;
 #define POP3LOG(str) "%s: [this=%p] " str, POP3LOGMODULE->name, this
 
 static int
 net_pop3_remove_messages_marked_delete(PLHashEntry* he,
@@ -1624,16 +1625,17 @@ void nsPop3Protocol::InitPrefAuthMethods
           POP3_HAS_AUTH_NTLM | POP3_HAS_AUTH_MSN;
       break;
     default:
       NS_ASSERTION(false, "POP: authMethod pref invalid");
       // TODO log to error console
       MOZ_LOG(POP3LOGMODULE, LogLevel::Error,
               (POP3LOG("POP: bad pref authMethod = %d\n"), authMethodPrefValue));
       // fall to any
+      MOZ_FALLTHROUGH;
     case nsMsgAuthMethod::anything:
       m_prefAuthMethods = POP3_HAS_AUTH_USER |
           POP3_HAS_AUTH_LOGIN | POP3_HAS_AUTH_PLAIN |
           POP3_HAS_AUTH_CRAM_MD5 | POP3_HAS_AUTH_APOP |
           POP3_HAS_AUTH_GSSAPI |
           POP3_HAS_AUTH_NTLM | POP3_HAS_AUTH_MSN;
       // TODO needed?
       break;
@@ -1786,16 +1788,17 @@ int32_t nsPop3Protocol::ProcessAuth()
         m_pop3ConData->next_state = POP3_AUTH_GSSAPI;
         break;
       case POP3_HAS_AUTH_APOP:
         MOZ_LOG(POP3LOGMODULE, LogLevel::Debug, (POP3LOG("POP APOP")));
         m_pop3ConData->next_state = POP3_SEND_PASSWORD;
         break;
       case POP3_HAS_AUTH_CRAM_MD5:
         MOZ_LOG(POP3LOGMODULE, LogLevel::Debug, (POP3LOG("POP CRAM")));
+        MOZ_FALLTHROUGH;
       case POP3_HAS_AUTH_PLAIN:
       case POP3_HAS_AUTH_USER:
         MOZ_LOG(POP3LOGMODULE, LogLevel::Debug, (POP3LOG("POP username")));
         m_pop3ConData->next_state = POP3_SEND_USERNAME;
         break;
       case POP3_HAS_AUTH_LOGIN:
         MOZ_LOG(POP3LOGMODULE, LogLevel::Debug, (POP3LOG("POP AUTH=LOGIN")));
         m_pop3ConData->next_state = POP3_AUTH_LOGIN;
--- a/mailnews/mime/src/mimemsig.cpp
+++ b/mailnews/mime/src/mimemsig.cpp
@@ -10,17 +10,17 @@
 #include "prmem.h"
 #include "plstr.h"
 #include "prerror.h"
 #include "nsMimeTypes.h"
 #include "msgCore.h"
 #include "nsMimeStringResources.h"
 #include "mimemoz2.h"
 #include "nsIMimeConverter.h" // for MimeConverterOutputCallback
-
+#include "mozilla/Attributes.h"
 
 #define MIME_SUPERCLASS mimeMultipartClass
 MimeDefClass(MimeMultipartSigned, MimeMultipartSignedClass,
        mimeMultipartSignedClass, &MIME_SUPERCLASS);
 
 static int MimeMultipartSigned_initialize (MimeObject *);
 static int MimeMultipartSigned_create_child (MimeObject *);
 static int MimeMultipartSigned_close_child(MimeObject *);
@@ -248,17 +248,17 @@ MimeMultipartSigned_parse_line (const ch
      state, so cache away the headers that apply only to the body part.
      */
     NS_ASSERTION(mult->hdrs, "null multipart hdrs");
     NS_ASSERTION(!sig->body_hdrs, "signed part shouldn't have already have body_hdrs");
     sig->body_hdrs = mult->hdrs;
     mult->hdrs = 0;
 
     /* fall through. */
-
+   MOZ_FALLTHROUGH;
   case MimeMultipartSignedBodyFirstHeader:
   case MimeMultipartSignedBodyHeaders:
   case MimeMultipartSignedBodyLine:
 
     if (!sig->crypto_closure)
     {
       /* Set error change */
       PR_SetError(0, 0);
@@ -398,17 +398,17 @@ MimeMultipartSigned_parse_line (const ch
     {
       status = (((MimeMultipartSignedClass *) obj->clazz)
           ->crypto_signature_init) (sig->crypto_closure,
                         obj, sig->sig_hdrs);
       if (status < 0) return status;
     }
 
     /* fall through. */
-
+   MOZ_FALLTHROUGH;
   case MimeMultipartSignedSignatureLine:
     if (hash_line_p)
     {
       /* Feed this line into the signature verification routines. */
 
       if (sig->sig_decoder_data)
       status = MimeDecoderWrite (sig->sig_decoder_data, line, length, nullptr);
       else
@@ -489,27 +489,27 @@ MimeMultipartSigned_parse_child_line (Mi
 
   switch (sig->state)
   {
   case MimeMultipartSignedPreamble:
   case MimeMultipartSignedBodyFirstHeader:
   case MimeMultipartSignedBodyHeaders:
     // How'd we get here?  Oh well, fall through.
     NS_ERROR("wrong state in parse child line");
-
+    MOZ_FALLTHROUGH;
   case MimeMultipartSignedBodyFirstLine:
     PR_ASSERT(first_line_p);
     if (!sig->part_buffer)
     {
       sig->part_buffer = MimePartBufferCreate();
       if (!sig->part_buffer)
       return MIME_OUT_OF_MEMORY;
     }
     /* fall through */
-
+   MOZ_FALLTHROUGH;
   case MimeMultipartSignedBodyLine:
     {
     /* This is the first part; we are buffering it, and will emit it all
        at the end (so that we know whether the signature matches before
        showing anything to the user.)
      */
 
     /* The newline issues here are tricky, since both the newlines
@@ -543,17 +543,17 @@ MimeMultipartSigned_parse_child_line (Mi
       status = MimePartBufferWrite (sig->part_buffer, line, length);
     if (status < 0) return status;
     }
   break;
 
   case MimeMultipartSignedSignatureHeaders:
     // How'd we get here?  Oh well, fall through.
     NS_ERROR("should have already parse sig hdrs");
-
+    MOZ_FALLTHROUGH;
   case MimeMultipartSignedSignatureFirstLine:
   case MimeMultipartSignedSignatureLine:
     /* Nothing to do here -- hashing of the signature part is handled up
      in MimeMultipartSigned_parse_line().
      */
     break;
 
   case MimeMultipartSignedEpilogue:
--- a/mailnews/mime/src/nsCMS.h
+++ b/mailnews/mime/src/nsCMS.h
@@ -42,17 +42,17 @@ private:
   nsCOMPtr<nsIInterfaceRequestor> m_ctx;
   NSSCMSMessage * m_cmsMsg;
   NSSCMSSignerInfo* GetTopLevelSignerInfo();
   nsresult CommonVerifySignature(unsigned char* aDigestData, uint32_t aDigestDataLen);
 
   nsresult CommonAsyncVerifySignature(nsISMimeVerificationListener *aListener,
                                       unsigned char* aDigestData, uint32_t aDigestDataLen);
 
-  virtual void virtualDestroyNSSReference();
+  virtual void virtualDestroyNSSReference() override;
   void destructorSafeDestroyNSSReference();
 
 };
 
 // ===============================================
 // nsCMSDecoder - implementation of nsICMSDecoder
 // ===============================================
 
@@ -68,17 +68,17 @@ public:
 
   nsCMSDecoder();
   nsresult Init();
 
 private:
   virtual ~nsCMSDecoder();
   nsCOMPtr<nsIInterfaceRequestor> m_ctx;
   NSSCMSDecoderContext *m_dcx;
-  virtual void virtualDestroyNSSReference();
+  virtual void virtualDestroyNSSReference() override;
   void destructorSafeDestroyNSSReference();
 };
 
 // ===============================================
 // nsCMSEncoder - implementation of nsICMSEncoder
 // ===============================================
 
 #define NS_CMSENCODER_CID \
@@ -92,13 +92,13 @@ public:
 
   nsCMSEncoder();
   nsresult Init();
 
 private:
   virtual ~nsCMSEncoder();
   nsCOMPtr<nsIInterfaceRequestor> m_ctx;
   NSSCMSEncoderContext *m_ecx;
-  virtual void virtualDestroyNSSReference();
+  virtual void virtualDestroyNSSReference() override;
   void destructorSafeDestroyNSSReference();
 };
 
 #endif
--- a/mailnews/mime/src/nsSimpleMimeConverterStub.cpp
+++ b/mailnews/mime/src/nsSimpleMimeConverterStub.cpp
@@ -160,24 +160,24 @@ MimeSimpleStubClassInitialize(MimeSimple
 
 class nsSimpleMimeConverterStub : public nsIMimeContentTypeHandler
 {
 public:
     nsSimpleMimeConverterStub(const char *aContentType) : mContentType(aContentType) { }
 
     NS_DECL_ISUPPORTS
 
-    NS_IMETHOD GetContentType(char **contentType)
+    NS_IMETHOD GetContentType(char **contentType) override
     {
         *contentType = ToNewCString(mContentType);
         return *contentType ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
     }
     NS_IMETHOD CreateContentTypeHandlerClass(const char *contentType,
                                              contentTypeHandlerInitStruct *initString,
-                                             MimeObjectClass **objClass);
+                                             MimeObjectClass **objClass) override;
 private:
     virtual ~nsSimpleMimeConverterStub() { }
     nsCString mContentType;
 };
 
 NS_IMPL_ISUPPORTS(nsSimpleMimeConverterStub, nsIMimeContentTypeHandler)
 
 NS_IMETHODIMP
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -21,16 +21,17 @@
 #include "nsMsgNewsCID.h"
 
 #include "nsINntpUrl.h"
 #include "prmem.h"
 #include "prtime.h"
 #include "mozilla/Logging.h"
 #include "prerror.h"
 #include "nsStringGlue.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/Services.h"
 #include "mozilla/mailnews/MimeHeaderParser.h"
 
 #include "prprf.h"
 #include <algorithm>
 
 /* include event sink interfaces for news */
 
@@ -4574,20 +4575,22 @@ nsresult nsNNTPProtocol::ProcessProtocol
       /* check if this connection came from the cache or if it was
       * a new connection.  If it was not new lets start it over
       * again.  But only if we didn't have any successful protocol
       * dialog at all.
       */
       FinishMemCacheEntry(false);  // cleanup mem cache entry
       if (m_responseCode != MK_NNTP_RESPONSE_ARTICLE_NOTFOUND && m_responseCode != MK_NNTP_RESPONSE_ARTICLE_NONEXIST)
         return CloseConnection();
+      MOZ_FALLTHROUGH;
     case NEWS_FREE:
       // Remember when we last used this connection
       m_lastActiveTimeStamp = PR_Now();
       CleanupAfterRunningUrl();
+      MOZ_FALLTHROUGH;
     case NNTP_SUSPENDED:
       return NS_OK;
       break;
     default:
       /* big error */
       return NS_ERROR_FAILURE;
 
     } // end switch
--- a/mailnews/news/src/nsNNTPProtocol.h
+++ b/mailnews/news/src/nsNNTPProtocol.h
@@ -134,28 +134,28 @@ public:
   NS_DECL_NSIMSGASYNCPROMPTLISTENER
 
   // Creating a protocol instance requires the URL
   // need to call Initialize after we do a new of nsNNTPProtocol
   nsNNTPProtocol(nsINntpIncomingServer *aServer, nsIURI *aURL,
                  nsIMsgWindow *aMsgWindow);
 
   // stop binding is a "notification" informing us that the stream associated with aURL is going away.
-  NS_IMETHOD OnStopRequest(nsIRequest *request, nsISupports * aCtxt, nsresult aStatus);
+  NS_IMETHOD OnStopRequest(nsIRequest *request, nsISupports * aCtxt, nsresult aStatus) override;
 
   char * m_ProxyServer;    /* proxy server hostname */
 
-  NS_IMETHOD Cancel(nsresult status);  // handle stop button
-  NS_IMETHOD GetContentType(nsACString &aContentType);
-  NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt);
-  NS_IMETHOD AsyncOpen2(nsIStreamListener *listener);
-  NS_IMETHOD GetOriginalURI(nsIURI* *aURI);
-  NS_IMETHOD SetOriginalURI(nsIURI* aURI);
+  NS_IMETHOD Cancel(nsresult status) override;  // handle stop button
+  NS_IMETHOD GetContentType(nsACString &aContentType) override;
+  NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt) override;
+  NS_IMETHOD AsyncOpen2(nsIStreamListener *listener) override;
+  NS_IMETHOD GetOriginalURI(nsIURI* *aURI) override;
+  NS_IMETHOD SetOriginalURI(nsIURI* aURI) override;
 
-  nsresult LoadUrl(nsIURI * aURL, nsISupports * aConsumer);
+  nsresult LoadUrl(nsIURI * aURL, nsISupports * aConsumer) override;
 
 private:
   virtual ~nsNNTPProtocol();
   /**
    * Triggers the protocol state machine.
    * Most of the time, this machine will read as much input as it can before
    * closing.
    *
@@ -168,29 +168,29 @@ private:
    * NNTP_SUSPENDED: A state where the state machine does not read input until
    *                 reenabled by a non-network related callback
    *
    * @note Use of NNTP_SUSPENDED is dangerous: if input comes along the socket,
    * the code will not read the input stream at all. Therefore, it is strongly
    * advised to suspend the request before using this state.
    */
   virtual nsresult ProcessProtocolState(nsIURI * url, nsIInputStream * inputStream,
-                                        uint64_t sourceOffset, uint32_t length);
-  virtual nsresult CloseSocket();
+                                        uint64_t sourceOffset, uint32_t length) override;
+  virtual nsresult CloseSocket() override;
 
   // we have our own implementation of SendData which writes to the nntp log
   // and then calls the base class to transmit the data
-  nsresult SendData(const char * dataBuffer, bool aSuppressLogging = false);
+  nsresult SendData(const char * dataBuffer, bool aSuppressLogging = false) override;
 
   nsresult CleanupAfterRunningUrl();
   void Cleanup(); //free char* member variables
 
   void ParseHeaderForCancel(char *buf);
 
-  virtual const char* GetType() {return "nntp";}
+  virtual const char* GetType() override { return "nntp"; }
 
   static void CheckIfAuthor(nsIMsgIdentity *aIdentity, const nsCString &aOldFrom, nsCString &aFrom);
 
   nsCOMPtr <nsINNTPNewsgroupList> m_newsgroupList;
   nsCOMPtr <nsINNTPArticleList> m_articleList;
 
   nsCOMPtr <nsIMsgNewsFolder> m_newsFolder;
   nsCOMPtr <nsIMsgWindow> m_msgWindow;
--- a/mailnews/news/src/nsNntpIncomingServer.h
+++ b/mailnews/news/src/nsNntpIncomingServer.h
@@ -45,58 +45,58 @@ public:
     NS_DECL_NSIURLLISTENER
     NS_DECL_NSISUBSCRIBABLESERVER
     NS_DECL_NSITREEVIEW
 
     nsNntpIncomingServer();
 
     NS_IMETHOD GetLocalStoreType(nsACString& type) override;
     NS_IMETHOD GetLocalDatabaseType(nsACString& type) override;
-    NS_IMETHOD CloseCachedConnections();
-    NS_IMETHOD PerformBiff(nsIMsgWindow *aMsgWindow);
-    NS_IMETHOD PerformExpand(nsIMsgWindow *aMsgWindow);
+    NS_IMETHOD CloseCachedConnections() override;
+    NS_IMETHOD PerformBiff(nsIMsgWindow *aMsgWindow) override;
+    NS_IMETHOD PerformExpand(nsIMsgWindow *aMsgWindow) override;
     NS_IMETHOD OnUserOrHostNameChanged(const nsACString& oldName,
                                        const nsACString& newName,
-                                       bool hostnameChanged);
+                                       bool hostnameChanged) override;
 
     // for nsMsgLineBuffer
     virtual nsresult HandleLine(const char *line, uint32_t line_size);
 
     // override to clear all passwords associated with server
-    NS_IMETHODIMP ForgetPassword();
-    NS_IMETHOD GetCanSearchMessages(bool *canSearchMessages);
-    NS_IMETHOD GetOfflineSupportLevel(int32_t *aSupportLevel);
-    NS_IMETHOD GetDefaultCopiesAndFoldersPrefsToServer(bool *aCopiesAndFoldersOnServer);
-    NS_IMETHOD GetCanCreateFoldersOnServer(bool *aCanCreateFoldersOnServer);
-    NS_IMETHOD GetCanFileMessagesOnServer(bool *aCanFileMessagesOnServer);
-    NS_IMETHOD GetFilterScope(nsMsgSearchScopeValue *filterScope);
-    NS_IMETHOD GetSearchScope(nsMsgSearchScopeValue *searchScope);
+    NS_IMETHODIMP ForgetPassword() override;
+    NS_IMETHOD GetCanSearchMessages(bool *canSearchMessages) override;
+    NS_IMETHOD GetOfflineSupportLevel(int32_t *aSupportLevel) override;
+    NS_IMETHOD GetDefaultCopiesAndFoldersPrefsToServer(bool *aCopiesAndFoldersOnServer) override;
+    NS_IMETHOD GetCanCreateFoldersOnServer(bool *aCanCreateFoldersOnServer) override;
+    NS_IMETHOD GetCanFileMessagesOnServer(bool *aCanFileMessagesOnServer) override;
+    NS_IMETHOD GetFilterScope(nsMsgSearchScopeValue *filterScope) override;
+    NS_IMETHOD GetSearchScope(nsMsgSearchScopeValue *searchScope) override;
 
-    NS_IMETHOD GetSocketType(int32_t *aSocketType); // override nsMsgIncomingServer impl
-    NS_IMETHOD SetSocketType(int32_t aSocketType); // override nsMsgIncomingServer impl
-    NS_IMETHOD GetSortOrder(int32_t* aSortOrder);
+    NS_IMETHOD GetSocketType(int32_t *aSocketType) override; // override nsMsgIncomingServer impl
+    NS_IMETHOD SetSocketType(int32_t aSocketType) override; // override nsMsgIncomingServer impl
+    NS_IMETHOD GetSortOrder(int32_t* aSortOrder) override;
 
 protected:
     virtual ~nsNntpIncomingServer();
    virtual nsresult CreateRootFolderFromUri(const nsCString &serverUri,
-                                            nsIMsgFolder **rootFolder);
+                                            nsIMsgFolder **rootFolder) override;
     nsresult GetNntpConnection(nsIURI *url, nsIMsgWindow *window,
                                nsINNTPProtocol **aNntpConnection);
     nsresult CreateProtocolInstance(nsINNTPProtocol **aNntpConnection,
                                     nsIURI *url, nsIMsgWindow *window);
     bool ConnectionTimeOut(nsINNTPProtocol* aNntpConnection);
     nsCOMArray<nsINNTPProtocol> mConnectionCache;
     nsTArray<RefPtr<nsNntpMockChannel> > m_queuedChannels;
 
     /**
      * Downloads the newsgroup headers.
      */
     nsresult DownloadMail(nsIMsgWindow *aMsgWindow);
 
-    NS_IMETHOD GetServerRequiresPasswordForBiff(bool *aServerRequiresPasswordForBiff);
+    NS_IMETHOD GetServerRequiresPasswordForBiff(bool *aServerRequiresPasswordForBiff) override;
     nsresult SetupNewsrcSaveTimer();
     static void OnNewsrcSaveTimer(nsITimer *timer, void *voidIncomingServer);
     void WriteLine(nsIOutputStream *stream, nsCString &str);
 
 private:
     nsTArray<nsCString> mSubscribedNewsgroups;
     nsTArray<nsCString> mGroupsOnServer;
     nsTArray<nsCString> mSubscribeSearchResult;
--- a/mailnews/news/src/nsNntpUrl.h
+++ b/mailnews/news/src/nsNntpUrl.h
@@ -14,25 +14,25 @@
 class nsNntpUrl : public nsINntpUrl, public nsMsgMailNewsUrl, public nsIMsgMessageUrl, public nsIMsgI18NUrl
 {
 public:
   NS_DECL_NSINNTPURL
   NS_DECL_NSIMSGMESSAGEURL
   NS_DECL_NSIMSGI18NURL
 
   // nsIURI over-ride...
-  NS_IMETHOD SetSpec(const nsACString &aSpec);
+  NS_IMETHOD SetSpec(const nsACString &aSpec) override;
 
-  NS_IMETHOD IsUrlType(uint32_t type, bool *isType);
+  NS_IMETHOD IsUrlType(uint32_t type, bool *isType) override;
 
   // nsIMsgMailNewsUrl overrides
-  NS_IMETHOD GetServer(nsIMsgIncomingServer **server);
-  NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder);
+  NS_IMETHOD GetServer(nsIMsgIncomingServer **server) override;
+  NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder) override;
   NS_IMETHOD CloneInternal(uint32_t aRefHandlingMode,
-                           const nsACString& newRef,nsIURI **_retval);
+                           const nsACString& newRef,nsIURI **_retval) override;
 
   // nsNntpUrl
   nsNntpUrl();
 
   NS_DECL_ISUPPORTS_INHERITED
 
 private:
   virtual ~nsNntpUrl();