Bug 1202150 - Silence compiler warnings in nsMsgDBView and friends, part 3 mailnews/imap|local|mime|news. r=rkent
authoralta88
Tue, 29 Sep 2015 16:02:41 -0600
changeset 18467 553773cf31bde6d107bb2baa03015b472efe1b54
parent 18466 4d82d455486356697812d9baa3042ee5ce1bde39
child 18468 e91c890a2de59d496102475d686d2d64a32b2430
push id11304
push useraleth@instantbird.org
push dateTue, 29 Sep 2015 22:57:33 +0000
treeherdercomm-central@3ddf3a3eaf07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrkent
bugs1202150
Bug 1202150 - Silence compiler warnings in nsMsgDBView and friends, part 3 mailnews/imap|local|mime|news. r=rkent
mailnews/imap/src/nsImapFlagAndUidState.cpp
mailnews/imap/src/nsImapIncomingServer.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/local/src/nsMsgBrkMBoxStore.cpp
mailnews/local/src/nsParseMailbox.cpp
mailnews/local/src/nsPop3Protocol.cpp
mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
mailnews/mime/cthandlers/vcard/mimevcrd.cpp
mailnews/mime/emitters/nsMimeBaseEmitter.cpp
mailnews/mime/src/mimedrft.cpp
mailnews/mime/src/mimetpfl.cpp
mailnews/news/src/nsNNTPNewsgroupList.cpp
mailnews/news/src/nsNNTPProtocol.cpp
mailnews/news/src/nsNewsFolder.cpp
mailnews/news/src/nsNntpIncomingServer.cpp
--- a/mailnews/imap/src/nsImapFlagAndUidState.cpp
+++ b/mailnews/imap/src/nsImapFlagAndUidState.cpp
@@ -37,17 +37,17 @@ NS_IMETHODIMP nsImapFlagAndUidState::Get
 {
   NS_ENSURE_ARG_POINTER(aResult);
   *aResult = fFlags.SafeElementAt(zeroBasedIndex, kNoImapMsgFlag);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsImapFlagAndUidState::SetMessageFlags(int32_t zeroBasedIndex, unsigned short flags)
 {
-  if (zeroBasedIndex < fUids.Length())
+  if (zeroBasedIndex < (int32_t)fUids.Length())
     fFlags[zeroBasedIndex] = flags;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsImapFlagAndUidState::GetNumberOfRecentMessages(int32_t *result)
 {
   if (!result)
     return NS_ERROR_NULL_POINTER;
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -73,17 +73,17 @@ nsImapIncomingServer::nsImapIncomingServ
   mDoingLsub = false;
   m_canHaveFilters = true;
   m_userAuthenticated = false;
   m_shuttingDown = false;
 }
 
 nsImapIncomingServer::~nsImapIncomingServer()
 {
-  nsresult rv = ClearInner();
+  mozilla::DebugOnly<nsresult> rv = ClearInner();
   NS_ASSERTION(NS_SUCCEEDED(rv), "ClearInner failed");
   CloseCachedConnections();
 }
 
 NS_IMETHODIMP nsImapIncomingServer::SetKey(const nsACString& aKey)  // override nsMsgIncomingServer's implementation...
 {
   nsMsgIncomingServer::SetKey(aKey);
 
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -5313,17 +5313,17 @@ nsImapMailFolder::OnStopRunningUrl(nsIUR
           if (m_copyState->m_msgWindow &&
               m_copyState->m_undoMsgTxn &&  // may be null from filters
               NS_SUCCEEDED(aExitCode))      //we should do this only if move/copy succeeds
           {
             nsCOMPtr<nsITransactionManager> txnMgr;
             m_copyState->m_msgWindow->GetTransactionManager(getter_AddRefs(txnMgr));
             if (txnMgr)
             {
-              nsresult rv2 = txnMgr->DoTransaction(m_copyState->m_undoMsgTxn);
+              mozilla::DebugOnly<nsresult> rv2 = txnMgr->DoTransaction(m_copyState->m_undoMsgTxn);
               NS_ASSERTION(NS_SUCCEEDED(rv2), "doing transaction failed");
             }
           }
           (void) OnCopyCompleted(m_copyState->m_srcSupport, aExitCode);
         }
 
         // we're the dest folder of a move/copy - if we're not open in the ui,
         // then we should clear our nsMsgDatabase pointer. Otherwise, the db would
@@ -5931,17 +5931,17 @@ nsImapMailFolder::SetUidValidity(int32_t
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsImapMailFolder::FillInFolderProps(nsIMsgImapFolderProps *aFolderProps)
 {
   NS_ENSURE_ARG(aFolderProps);
   const char* folderTypeStringID;
-  const char* folderTypeDescStringID;
+  const char* folderTypeDescStringID = nullptr;
   const char* folderQuotaStatusStringID;
   nsString folderType;
   nsString folderTypeDesc;
   nsString folderQuotaStatusDesc;
   nsCOMPtr<nsIStringBundle> bundle;
   nsresult rv = IMAPGetStringBundle(getter_AddRefs(bundle));
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -9643,17 +9643,17 @@ void nsImapMailFolder::PlaybackTimerCall
 {
   nsPlaybackRequest *request = static_cast<nsPlaybackRequest*>(aClosure);
   
   NS_ASSERTION(request->SrcFolder->m_pendingPlaybackReq == request, "wrong playback request pointer");
   
   nsRefPtr<nsImapOfflineSync> offlineSync = new nsImapOfflineSync(request->MsgWindow, nullptr, request->SrcFolder, true);
   if (offlineSync)
   {
-    nsresult rv = offlineSync->ProcessNextOperation();
+    mozilla::DebugOnly<nsresult> rv = offlineSync->ProcessNextOperation();
     NS_ASSERTION(NS_SUCCEEDED(rv), "pseudo-offline playback is not successful");
   }
   
   // release request struct
   request->SrcFolder->m_pendingPlaybackReq = nullptr;
   delete request;
 }
 
--- a/mailnews/local/src/nsMsgBrkMBoxStore.cpp
+++ b/mailnews/local/src/nsMsgBrkMBoxStore.cpp
@@ -221,17 +221,17 @@ NS_IMETHODIMP nsMsgBrkMBoxStore::IsSumma
   folderInfo->GetNumUnreadMessages(&numUnreadMessages);
   folderInfo->GetFolderSize(&folderSize);
   folderInfo->GetFolderDate(&folderDate);
 
   int64_t fileSize = 0;
   uint32_t actualFolderTimeStamp = 0;
   GetMailboxModProperties(aFolder, &fileSize, &actualFolderTimeStamp);
 
-  if (folderSize == fileSize && numUnreadMessages >= 0)
+  if ((int64_t)folderSize == fileSize && numUnreadMessages >= 0)
   {
     if (!folderSize)
     {
       *aResult = true;
       return NS_OK;
     }
     if (!gGotGlobalPrefs)
     {
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1935,25 +1935,23 @@ void nsParseNewMailState::ApplyFilters(b
     {
       if (!downloadFolder)
         rootMsgFolder->GetFolderWithFlags(nsMsgFolderFlags::Inbox,
                                           getter_AddRefs(downloadFolder));
       if (downloadFolder)
         downloadFolder->GetURI(m_inboxUri);
       char * headers = m_headers.GetBuffer();
       uint32_t headersSize = m_headers.GetBufferPos();
-      nsresult matchTermStatus;
       if (m_filterList)
-        matchTermStatus =
-          m_filterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule, msgHdr,
-                                          downloadFolder, m_mailDB, headers,
-                                          headersSize, this, msgWindow);
+        (void) m_filterList->
+          ApplyFiltersToHdr(nsMsgFilterType::InboxRule, msgHdr, downloadFolder,
+                            m_mailDB, headers, headersSize, this, msgWindow);
       if (!m_msgMovedByFilter && m_deferredToServerFilterList)
       {
-        matchTermStatus = m_deferredToServerFilterList->
+        (void) m_deferredToServerFilterList->
           ApplyFiltersToHdr(nsMsgFilterType::InboxRule, msgHdr, downloadFolder,
                             m_mailDB, headers, headersSize, this, msgWindow);
       }
     }
   }
   if (pMoved)
     *pMoved = m_msgMovedByFilter;
 }
--- a/mailnews/local/src/nsPop3Protocol.cpp
+++ b/mailnews/local/src/nsPop3Protocol.cpp
@@ -639,19 +639,20 @@ void nsPop3Protocol::UpdateStatus(const 
                                   getter_Copies(statusMessage));
   UpdateStatusWithString(statusMessage.get());
 }
 
 void nsPop3Protocol::UpdateStatusWithString(const char16_t *aStatusString)
 {
     if (mProgressEventSink)
     {
-        nsresult rv = mProgressEventSink->OnStatus(this, m_channelContext,
-                                                   NS_OK, aStatusString);      // XXX i18n message
-        NS_ASSERTION(NS_SUCCEEDED(rv), "dropping error result");
+      mozilla::DebugOnly<nsresult> rv =
+        mProgressEventSink->OnStatus(this, m_channelContext,
+                                     NS_OK, aStatusString); // XXX i18n message
+      NS_ASSERTION(NS_SUCCEEDED(rv), "dropping error result");
     }
 }
 
 void nsPop3Protocol::UpdateProgressPercent (uint32_t totalDone, uint32_t total)
 {
   // XXX 64-bit
   if (mProgressEventSink)
     mProgressEventSink->OnProgress(this, m_channelContext, uint64_t(totalDone), uint64_t(total));
@@ -3159,21 +3160,21 @@ nsPop3Protocol::SendRetr()
       /* Display bytes if we're only downloading one message. */
       PR_ASSERT(!m_pop3ConData->graph_progress_bytes_p);
       UpdateProgressPercent(0, m_totalDownloadSize);
       m_pop3ConData->graph_progress_bytes_p = true;
     }
     else
     {
       nsString finalString;
-      nsresult rv = FormatCounterString(NS_LITERAL_STRING("receivingMessages"),
-                          m_pop3ConData->real_new_counter,
-                          m_pop3ConData->really_new_messages,
-                          finalString);
-
+      mozilla::DebugOnly<nsresult> rv =
+        FormatCounterString(NS_LITERAL_STRING("receivingMessages"),
+                            m_pop3ConData->real_new_counter,
+                            m_pop3ConData->really_new_messages,
+                            finalString);
       NS_ASSERTION(NS_SUCCEEDED(rv), "couldn't format string");
       if (mProgressEventSink) {
         rv = mProgressEventSink->OnStatus(this, m_channelContext, NS_OK,
                                           finalString.get());
         NS_ASSERTION(NS_SUCCEEDED(rv), "dropping error result");
       }
     }
 
@@ -3618,17 +3619,18 @@ nsPop3Protocol::CommitState(bool remove_
         we got it into the database.
       */
       if (remove_last_entry && m_pop3ConData->msg_info &&
           !m_pop3ConData->only_uidl && m_pop3ConData->newuidl->nentries > 0)
       {
         Pop3MsgInfo* info = m_pop3ConData->msg_info + m_pop3ConData->last_accessed_msg;
         if (info && info->uidl)
         {
-          bool val = PL_HashTableRemove(m_pop3ConData->newuidl, info->uidl);
+          mozilla::DebugOnly<bool> val = PL_HashTableRemove(m_pop3ConData->newuidl,
+                                                            info->uidl);
           NS_ASSERTION(val, "uidl not in hash table");
         }
       }
 
       // Add the entries in newuidl to m_pop3ConData->uidlinfo->hash to keep
       // track of the messages we *did* download in this session.
       PL_HashTableEnumerateEntries(m_pop3ConData->newuidl, net_pop3_copy_hash_entries, (void *)m_pop3ConData->uidlinfo->hash);
     }
--- a/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
+++ b/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
@@ -86,20 +86,21 @@ static void PgpMimeGetNeedsAddonString(n
   if (NS_FAILED(rv))
     return;
   aResult = NS_ConvertUTF16toUTF8(result);
 }
 
 static int
 MimeEncryptedPgpClassInitialize(MimeEncryptedPgpClass *clazz)
 {
-  MimeObjectClass    *oclass = (MimeObjectClass *)    clazz;
+  mozilla::DebugOnly<MimeObjectClass *> oclass = (MimeObjectClass *) clazz;
+  NS_ASSERTION(!oclass->class_initialized, "oclass is not initialized");
+
   MimeEncryptedClass *eclass = (MimeEncryptedClass *) clazz;
 
-  NS_ASSERTION(!oclass->class_initialized, "oclass is not initialized");
   eclass->crypto_init          = MimePgpe_init;
   eclass->crypto_write         = MimePgpe_write;
   eclass->crypto_eof           = MimePgpe_eof;
   eclass->crypto_generate_html = MimePgpe_generate;
   eclass->crypto_free          = MimePgpe_free;
 
   return 0;
 }
--- a/mailnews/mime/cthandlers/vcard/mimevcrd.cpp
+++ b/mailnews/mime/cthandlers/vcard/mimevcrd.cpp
@@ -269,18 +269,16 @@ static int GenerateVCardData(MimeObject 
 
   // now write out the vCard
   return COM_MimeObject_write(aMimeObj, (char *) vCardOutput.get(), vCardOutput.Length(), true);
 }
 
 
 static int OutputBasicVcard(MimeObject *aMimeObj, VObject *aVcard, nsACString& vCardOutput)
 {
-  int status = 0;
-
   VObject *prop = NULL;
   nsAutoCString urlstring;
   nsAutoCString namestring;
   nsAutoCString emailstring;
 
   nsCOMPtr<nsIMsgVCardService> vCardService =  do_GetService(MSGVCARDSERVICE_CONTRACT_ID);
   if (!vCardService)
       return -1;
@@ -332,17 +330,17 @@ static int OutputBasicVcard(MimeObject *
         vCardOutput += "</td> </tr> "; // end the cell for the name/email address
       } // if we have a name property
     }
   } // if full name property
 
   // now each basic property goes on its own line
 
   // title
-  status = OutputVcardAttribute (aMimeObj, aVcard, VCTitleProp, vCardOutput);
+  (void) OutputVcardAttribute (aMimeObj, aVcard, VCTitleProp, vCardOutput);
 
   // org name and company name
   prop = vCardService->IsAPropertyOf(aVcard, VCOrgProp);
   if (prop)
   {
     OutputVcardAttribute (aMimeObj, prop, VCOrgUnitProp, vCardOutput);
     OutputVcardAttribute (aMimeObj, prop, VCOrgNameProp, vCardOutput);
   }
--- a/mailnews/mime/emitters/nsMimeBaseEmitter.cpp
+++ b/mailnews/mime/emitters/nsMimeBaseEmitter.cpp
@@ -1040,17 +1040,17 @@ nsMimeBaseEmitter::Complete()
 
   nsresult rv = NS_OK;
   while ( NS_SUCCEEDED(rv) && (mBufferMgr) && (mBufferMgr->GetSize() > 0))
     rv = Write(EmptyCString(), &written);
 
   if (mOutListener)
   {
     uint64_t bytesInStream = 0;
-    nsresult rv2 = mInputStream->Available(&bytesInStream);
+    mozilla::DebugOnly<nsresult> rv2 = mInputStream->Available(&bytesInStream);
     NS_ASSERTION(NS_SUCCEEDED(rv2), "Available failed");
     if (bytesInStream)
     {
       nsCOMPtr<nsIRequest> request = do_QueryInterface(mChannel);
       mOutListener->OnDataAvailable(request, mURL, mInputStream, 0, std::min(bytesInStream, uint64_t(PR_UINT32_MAX)));
     }
   }
 
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -1540,17 +1540,17 @@ mime_parse_stream_complete (nsMIMESessio
   //
   if (bodyAsAttachment)
     mdd->messageBody->m_tmpFile = nullptr;
   else if (mdd->messageBody && mdd->messageBody->m_tmpFile)
     mdd->messageBody->m_tmpFile->Remove(false);
 
   delete mdd->messageBody;
 
-  for (int i = 0; i < mdd->attachments.Length(); i++)
+  for (uint32_t i = 0; i < mdd->attachments.Length(); i++)
     mdd->attachments[i]->m_tmpFile = nullptr;
 
   PR_FREEIF(mdd->mailcharset);
 
   mdd->identity = nullptr;
   PR_Free(mdd->url_name);
   PR_Free(mdd->originalMsgURI);
   mdd->origMsgHdr = nullptr;
@@ -1644,17 +1644,16 @@ int
 mime_decompose_file_init_fn ( void *stream_closure, MimeHeaders *headers )
 {
   mime_draft_data *mdd = (mime_draft_data *) stream_closure;
   nsMsgAttachedFile *newAttachment = 0;
   int nAttachments = 0;
   //char *hdr_value = NULL;
   char *parm_value = NULL;
   bool creatingMsgBody = true;
-  bool bodyPart = false;
 
   NS_ASSERTION (mdd && headers, "null mime draft data and/or headers");
   if (!mdd || !headers)
     return -1;
 
   if (mdd->options->decompose_init_count)
   {
     mdd->options->decompose_init_count++;
@@ -1687,17 +1686,16 @@ mime_decompose_file_init_fn ( void *stre
       }
     }
 
     mdd->messageBody = new nsMsgAttachedFile;
     if (!mdd->messageBody)
       return MIME_OUT_OF_MEMORY;
     newAttachment = mdd->messageBody;
     creatingMsgBody = true;
-    bodyPart = true;
   }
   else
   {
     /* always allocate one more extra; don't ask me why */
     newAttachment = new nsMsgAttachedFile;
     if (!newAttachment)
       return MIME_OUT_OF_MEMORY;
     mdd->attachments.AppendElement(newAttachment);
@@ -1805,17 +1803,16 @@ mime_decompose_file_init_fn ( void *stre
     }
 
     nsMsgCreateTempFile(newAttachName.get(), getter_AddRefs(tmpFile));
   }
   nsresult rv;
 
   // This needs to be done so the attachment structure has a handle
   // on the temp file for this attachment...
-  // if ( (tmpFile) && (!bodyPart) )
   if (tmpFile)
   {
       nsAutoCString fileURL;
       rv = NS_GetURLSpecFromFile(tmpFile, fileURL);
       if (NS_SUCCEEDED(rv))
         nsMimeNewURI(getter_AddRefs(newAttachment->m_origUrl),
                      fileURL.get(), nullptr);
   }
@@ -1893,17 +1890,17 @@ mime_decompose_file_output_fn (const cha
     ret = MimeDecoderWrite(mdd->decoder_data, buf, size, &outsize);
     if (ret == -1) return -1;
     mdd->curAttachment->m_size += outsize;
   }
   else
   {
     uint32_t bytesWritten;
     mdd->tmpFileStream->Write(buf, size, &bytesWritten);
-    if (bytesWritten < size)
+    if ((int32_t)bytesWritten < size)
       return MIME_ERROR_WRITING_FILE;
     mdd->curAttachment->m_size += size;
   }
 
   return 0;
 }
 
 int
--- a/mailnews/mime/src/mimetpfl.cpp
+++ b/mailnews/mime/src/mimetpfl.cpp
@@ -115,18 +115,18 @@ MimeInlineTextPlainFlowed_parse_begin (M
 
   nsIPrefBranch *prefBranch = GetPrefBranch(obj->options);
   if (prefBranch)
   {
     prefBranch->GetIntPref("mail.quoted_size", &(text->mQuotedSizeSetting));
     prefBranch->GetIntPref("mail.quoted_style", &(text->mQuotedStyleSetting));
     prefBranch->GetCharPref("mail.citation_color", &(text->mCitationColor));
     prefBranch->GetBoolPref("mail.strip_sig_on_reply", &(text->mStripSig));
-    nsresult rv = prefBranch->GetBoolPref("mail.fixed_width_messages",
-                                          &(exdata->fixedwidthfont));
+    mozilla::DebugOnly<nsresult> rv =
+      prefBranch->GetBoolPref("mail.fixed_width_messages", &(exdata->fixedwidthfont));
     NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get pref");
          // Check at least the success of one
   }
 
   // Get font
   // only used for viewing (!plainHTML)
   nsAutoCString fontstyle;
   nsAutoCString fontLang;     // langgroup of the font
--- a/mailnews/news/src/nsNNTPNewsgroupList.cpp
+++ b/mailnews/news/src/nsNNTPNewsgroupList.cpp
@@ -741,17 +741,16 @@ NS_IMETHODIMP nsNNTPNewsgroupList::Apply
   return NS_OK;
 }
 
 nsresult
 nsNNTPNewsgroupList::ProcessXOVERLINE(const char *line, uint32_t *status)
 {
   uint32_t message_number=0;
   //  int32_t lines;
-  bool read_p = false;
   nsresult rv = NS_OK;
 
   NS_ASSERTION(line, "null ptr");
   if (!line)
     return NS_ERROR_NULL_POINTER;
 
   if (m_newsDB)
   {
@@ -794,17 +793,17 @@ nsNNTPNewsgroupList::ProcessXOVERLINE(co
   }
 
   if (message_number > m_lastMsgNumber)
     m_lastMsgNumber = message_number;
   else if (message_number < m_firstMsgNumber)
     m_firstMsgNumber = message_number;
 
   if (m_set) {
-    read_p = m_set->IsMember(message_number);
+    (void) m_set->IsMember(message_number);
   }
 
   /* Update the progress meter with a percentage of articles retrieved */
   if (m_lastMsgNumber > m_firstMsgNumber)
   {
     int32_t totalToDownload = m_lastMsgToDownload - m_firstMsgToDownload + 1;
     int32_t lastIndex = m_lastProcessedNumber - m_firstMsgNumber + 1;
     int32_t numDownloaded = lastIndex;
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -2018,25 +2018,24 @@ nsresult nsNNTPProtocol::SendGroupForArt
   m_nextStateAfterResponse = NNTP_SEND_GROUP_FOR_ARTICLE_RESPONSE;
   SetFlag(NNTP_PAUSE_FOR_READ);
   return rv;
 }
 
 nsresult
 nsNNTPProtocol::SetCurrentGroup()
 {
-  nsresult rv;
   nsCString groupname;
   NS_ASSERTION(m_newsFolder, "no news folder");
   if (!m_newsFolder) {
     m_currentGroup.Truncate();
     return NS_ERROR_UNEXPECTED;
   }
 
-  rv = m_newsFolder->GetRawName(groupname);
+  mozilla::DebugOnly<nsresult> rv = m_newsFolder->GetRawName(groupname);
   NS_ASSERTION(NS_SUCCEEDED(rv) && !groupname.IsEmpty(), "no group name");
   MOZ_LOG(NNTP, LogLevel::Info,("(%p) SetCurrentGroup to %s",this, groupname.get()));
   m_currentGroup = groupname;
   return NS_OK;
 }
 
 nsresult nsNNTPProtocol::SendGroupForArticleResponse()
 {
@@ -2078,19 +2077,18 @@ nsresult nsNNTPProtocol::BeginArticle()
   // create a pipe to pump the message into...the output will go to whoever
   // is consuming the message display
   //
   // the pipe must have an unlimited length since we are going to be filling
   // it on the main thread while reading it from the main thread.  iow, the
   // write must not block!! (see bug 190988)
   //
   if (m_channelListener) {
-      nsresult rv;
       nsCOMPtr<nsIPipe> pipe = do_CreateInstance("@mozilla.org/pipe;1");
-      rv = pipe->Init(false, false, 4096, PR_UINT32_MAX);
+      mozilla::DebugOnly<nsresult> rv = pipe->Init(false, false, 4096, PR_UINT32_MAX);
       NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create pipe");
       // TODO: return on failure?
 
       pipe->GetInputStream(getter_AddRefs(mDisplayInputStream));
       pipe->GetOutputStream(getter_AddRefs(mDisplayOutputStream));
   }
 
   m_nextState = NNTP_READ_ARTICLE;
@@ -2539,17 +2537,17 @@ nsresult nsNNTPProtocol::BeginNewsgroups
   mBytesReceived = 0;
     mBytesReceivedSinceLastStatusUpdate = 0;
     m_startTime = PR_Now();
   return NS_OK;
 }
 
 nsresult nsNNTPProtocol::ProcessNewsgroups(nsIInputStream * inputStream, uint32_t length)
 {
-  char *line, *lineToFree, *s, *s1=NULL, *s2=NULL, *flag=NULL;
+  char *line, *lineToFree, *s, *s1=NULL, *s2=NULL;
   uint32_t status = 0;
   nsresult rv = NS_OK;
 
   bool pauseForMoreData = false;
   line = lineToFree = m_lineStreamBuffer->ReadNextLine(inputStream, status, pauseForMoreData, &rv);
 
   if(pauseForMoreData)
   {
@@ -2612,17 +2610,16 @@ nsresult nsNNTPProtocol::ProcessNewsgrou
     if (s)
     {
       *s = 0;
       s2 = s+1;
       s = PL_strchr (s2, ' ');
       if (s)
       {
         *s = 0;
-        flag = s+1;
       }
     }
   }
 
   mBytesReceived += status;
   mBytesReceivedSinceLastStatusUpdate += status;
 
   NS_ASSERTION(m_nntpServer, "no nntp incoming server");
@@ -4134,17 +4131,17 @@ nsresult nsNNTPProtocol::SendListGroupRe
   if(pauseForMoreData)
   {
     SetFlag(NNTP_PAUSE_FOR_READ);
     return NS_OK;
   }
 
   if (line)
   {
-    nsresult rv;
+    mozilla::DebugOnly<nsresult> rv;
     if (line[0] != '.')
     {
       nsMsgKey found_id = nsMsgKey_None;
       PR_sscanf(line, "%ld", &found_id);
       rv = m_articleList->AddArticleKey(found_id);
       NS_ASSERTION(NS_SUCCEEDED(rv), "add article key failed");
     }
     else
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -673,28 +673,24 @@ nsMsgNewsFolder::GetDBFolderInfoAndDB(ns
   }
   return openErr;
 }
 
 /* this used to be MSG_FolderInfoNews::UpdateSummaryFromNNTPInfo() */
 NS_IMETHODIMP
 nsMsgNewsFolder::UpdateSummaryFromNNTPInfo(int32_t oldest, int32_t youngest, int32_t total)
 {
-  bool newsrcHasChanged = false;
-
   /* First, mark all of the articles now known to be expired as read. */
   if (oldest > 1)
   {
     nsCString oldSet;
     nsCString newSet;
     mReadSet->Output(getter_Copies(oldSet));
     mReadSet->AddRange(1, oldest - 1);
     mReadSet->Output(getter_Copies(newSet));
-    if (!oldSet.Equals(newSet))
-      newsrcHasChanged = true;
   }
 
   /* Now search the newsrc line and figure out how many of these messages are marked as unread. */
 
   /* make sure youngest is a least 1. MSNews seems to return a youngest of 0. */
   if (youngest == 0)
     youngest = 1;
 
--- a/mailnews/news/src/nsNntpIncomingServer.cpp
+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
@@ -112,17 +112,17 @@ nsNntpIncomingServer::nsNntpIncomingServ
   // we have server wide and per group filters
   m_canHaveFilters = true;
 
   SetupNewsrcSaveTimer();
 }
 
 nsNntpIncomingServer::~nsNntpIncomingServer()
 {
-    nsresult rv;
+    mozilla::DebugOnly<nsresult> rv;
 
     if (mNewsrcSaveTimer) {
         mNewsrcSaveTimer->Cancel();
         mNewsrcSaveTimer = nullptr;
     }
     rv = ClearInner();
     NS_ASSERTION(NS_SUCCEEDED(rv), "ClearInner failed");