From 840de6c9633a18d886f52f8bd993b5e0246614a5 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Tue, 6 Apr 1999 04:26:14 +0000 Subject: [PATCH] remove various unused variables, fix some signed/unsigned problems, fix some sscanf/printf format strings --- mailnews/local/src/nsLocalMailFolder.cpp | 11 +++++------ mailnews/local/src/nsMailboxProtocol.cpp | 1 - mailnews/local/src/nsMailboxService.cpp | 1 - mailnews/local/src/nsMailboxUrl.cpp | 1 - mailnews/local/src/nsParseMailbox.cpp | 9 +++------ 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/mailnews/local/src/nsLocalMailFolder.cpp b/mailnews/local/src/nsLocalMailFolder.cpp index a786dd43525..10b5cccf577 100644 --- a/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mailnews/local/src/nsLocalMailFolder.cpp @@ -331,9 +331,7 @@ nsMsgLocalMailFolder::GetMessages(nsIEnumerator* *result) nsresult folderOpen = NS_OK; nsIMsgDatabase * mailDBFactory = nsnull; - nsIMsgDatabase *mailDB; - nsIMessage * msgHdr = nsnull; rv = nsComponentManager::CreateInstance(kCMailDB, nsnull, nsIMsgDatabase::GetIID(), (void **) &mailDBFactory); if (NS_SUCCEEDED(rv) && mailDBFactory) { @@ -747,14 +745,13 @@ NS_IMETHODIMP nsMsgLocalMailFolder::GetPrettyName(nsString& prettyName) nsresult nsMsgLocalMailFolder::GetDBFolderInfoAndDB(nsIDBFolderInfo **folderInfo, nsIMsgDatabase **db) { - nsresult openErr; + nsresult openErr=NS_ERROR_UNEXPECTED; if(!db || !folderInfo) return NS_ERROR_NULL_POINTER; nsIMsgDatabase * mailDBFactory = nsnull; nsIMsgDatabase *mailDB; - nsIMessage * msgHdr = nsnull; nsresult rv = nsComponentManager::CreateInstance(kCMailDB, nsnull, nsIMsgDatabase::GetIID(), (void **) &mailDBFactory); if (NS_SUCCEEDED(rv) && mailDBFactory) { @@ -1013,7 +1010,8 @@ NS_IMETHODIMP nsMsgLocalMailFolder::OnKeyDeleted(nsMsgKey aKeyChanged, int32 aFl nsISupports *msgSupports; if(NS_SUCCEEDED(pMessage->QueryInterface(kISupportsIID, (void**)&msgSupports))) { - for(int i = 0; i < mListeners->Count(); i++) + PRUint32 i; + for(i = 0; i < mListeners->Count(); i++) { nsIFolderListener *listener = (nsIFolderListener*)mListeners->ElementAt(i); listener->OnItemRemoved(this, msgSupports); @@ -1034,7 +1032,8 @@ NS_IMETHODIMP nsMsgLocalMailFolder::OnKeyAdded(nsMsgKey aKeyChanged, int32 aFlag nsISupports *msgSupports; if(pMessage && NS_SUCCEEDED(pMessage->QueryInterface(kISupportsIID, (void**)&msgSupports))) { - for(int i = 0; i < mListeners->Count(); i++) + PRUint32 i; + for(i = 0; i < mListeners->Count(); i++) { nsIFolderListener *listener = (nsIFolderListener*)mListeners->ElementAt(i); listener->OnItemAdded(this, msgSupports); diff --git a/mailnews/local/src/nsMailboxProtocol.cpp b/mailnews/local/src/nsMailboxProtocol.cpp index cdae9ab4f2c..e395fb0ee24 100644 --- a/mailnews/local/src/nsMailboxProtocol.cpp +++ b/mailnews/local/src/nsMailboxProtocol.cpp @@ -106,7 +106,6 @@ void nsMailboxProtocol::Initialize(nsIURL * aURL) if (NS_SUCCEEDED(rv) && m_runningUrl) { // extract the file name and create a file transport... - const char * fileName = nsnull; nsINetService* pNetService; rv = nsServiceManager::GetService(kNetServiceCID, nsINetService::GetIID(), diff --git a/mailnews/local/src/nsMailboxService.cpp b/mailnews/local/src/nsMailboxService.cpp index 7514b5669cc..8f9f3917575 100644 --- a/mailnews/local/src/nsMailboxService.cpp +++ b/mailnews/local/src/nsMailboxService.cpp @@ -200,7 +200,6 @@ nsresult nsMailboxService::DisplayMessageNumber(const nsFileSpec& aMailboxPath, nsIMsgDatabase * mailDB = nsnull; nsIMsgDatabase *mailDBFactory; - nsIMessage * msgHdr = nsnull; rv = nsComponentManager::CreateInstance(kCMailDB, nsnull, nsIMsgDatabase::GetIID(), (void **) &mailDBFactory); if (NS_SUCCEEDED(rv) && mailDBFactory) { diff --git a/mailnews/local/src/nsMailboxUrl.cpp b/mailnews/local/src/nsMailboxUrl.cpp index b9e5cbf7f68..d3d5abc5b8f 100644 --- a/mailnews/local/src/nsMailboxUrl.cpp +++ b/mailnews/local/src/nsMailboxUrl.cpp @@ -517,7 +517,6 @@ nsresult nsMailboxUrl::ParseURL(const nsString& aSpec, const nsIURL* aURL) } #endif /* XP_UNIX */ - const char* cp0 = cp; // The remainder of the string is the file name and the search path.... // Strip out the ? stuff.... char* search = strpbrk(cSpec, "?"); diff --git a/mailnews/local/src/nsParseMailbox.cpp b/mailnews/local/src/nsParseMailbox.cpp index 76c649364f3..1c3991e1ccd 100644 --- a/mailnews/local/src/nsParseMailbox.cpp +++ b/mailnews/local/src/nsParseMailbox.cpp @@ -115,8 +115,10 @@ NS_IMETHODIMP nsMsgMailboxParser::OnStopBinding(nsIURL* aURL, nsresult aStatus, msgHdr->GetSubject(subject); char *authorStr = author.ToNewCString(); char *subjectStr = subject.ToNewCString(); +#ifdef DEBUG // leak nsString return values... - printf("hdr key = %ld, author = %s subject = %s\n", key, (authorStr) ? authorStr : "", (subjectStr) ? subjectStr : ""); + printf("hdr key = %d, author = %s subject = %s\n", key, (authorStr) ? authorStr : "", (subjectStr) ? subjectStr : ""); +#endif delete [] authorStr; delete [] subjectStr; msgHdr->Release(); @@ -795,7 +797,6 @@ int nsParseMailMessageState::ParseEnvelope (const char *line, PRUint32 line_size { const char *end; char *s; - int status = 0; m_envelope.AppendBuffer(line, line_size); end = m_envelope.GetBuffer() + line_size; @@ -1032,11 +1033,7 @@ int nsParseMailMessageState::FinalizeHeaders() if (mozstatus2) { PRUint32 flags2 = 0; -#ifdef OSF1 sscanf(mozstatus2->value, " %x ", &flags2); -#else - sscanf(mozstatus2->value, " %lx ", &flags2); -#endif flags |= flags2; }