Bug 1481417 - Part 5: Fix warnings and remove ALLOW_COMPILER_WARNINGS = True or replace it with something more specific in mailnews/mapi. r=jorgk a=IanN DONTBUILD SEAMONKEY_2_49_ESR_RELBRANCH
authoraceman <acelists@atlas.sk>
Wed, 08 Aug 2018 07:38:17 +0200
branchSEAMONKEY_2_49_ESR_RELBRANCH
changeset 28329 d4892a924deb1d5bf6ee18c97a8cefa2bce4be92
parent 28328 26ae3f45fae7b2ed7437020cbf87c145a1d2ff12
child 28330 a56d8703036ee1524567c7ae2b4815dce76034c9
push id2136
push userfrgrahl@gmx.net
push dateMon, 15 Jul 2019 16:13:42 +0000
treeherdercomm-esr52@6b30146aa411 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, IanN
bugs1481417
Bug 1481417 - Part 5: Fix warnings and remove ALLOW_COMPILER_WARNINGS = True or replace it with something more specific in mailnews/mapi. r=jorgk a=IanN DONTBUILD SeaMonkey ESR52 release branch only.
mailnews/mapi/mapiDll/MapiDll.cpp
mailnews/mapi/mapihook/build/msgMapi.idl
mailnews/mapi/mapihook/src/msgMapiFactory.h
mailnews/mapi/mapihook/src/msgMapiImp.h
mailnews/mapi/mapihook/src/msgMapiMain.h
mailnews/mapi/mapihook/src/msgMapiSupport.h
--- a/mailnews/mapi/mapiDll/MapiDll.cpp
+++ b/mailnews/mapi/mapiDll/MapiDll.cpp
@@ -192,17 +192,17 @@ ULONG FAR PASCAL MAPISendMail (LHANDLE l
     if (lpMessage->nFileCount > MAX_FILES)
         return MAPI_E_TOO_MANY_FILES ;
 
     if ( (!(flFlags & MAPI_DIALOG)) && (lpMessage->lpRecips == NULL) )
         return MAPI_E_UNKNOWN_RECIPIENT ;
 
     if (!lhSession || pNsMapi->IsValidSession(lhSession) != S_OK)
     {
-        FLAGS LoginFlag ;
+        FLAGS LoginFlag = 0;
         if ( (flFlags & MAPI_LOGON_UI) && (flFlags & MAPI_NEW_SESSION) )
             LoginFlag = MAPI_LOGON_UI | MAPI_NEW_SESSION ;
         else if (flFlags & MAPI_LOGON_UI) 
             LoginFlag = MAPI_LOGON_UI ;
 
         hr = MAPILogon (ulUIParam, (LPTSTR) NULL, (LPTSTR) NULL, LoginFlag, 0, &lhSession) ;
         if (hr != SUCCESS_SUCCESS)
             return MAPI_E_LOGIN_FAILURE ;
@@ -286,37 +286,32 @@ ULONG FAR PASCAL MAPISendDocuments(ULONG
     hr = pNsMapi->SendDocuments(lhSession, (LPTSTR) lpszDelimChar, (LPTSTR) lpszFilePaths, 
                                     (LPTSTR) lpszFileNames, ulReserved) ;
 
     MAPILogoff (lhSession, ulUIParam, 0,0) ;
 
     return hr ;
 }
 
-ULONG FAR PASCAL MAPIFindNext(LHANDLE lhSession, ULONG ulUIParam, LPTSTR lpszMessageType,
-                              LPTSTR lpszSeedMessageID, FLAGS flFlags, ULONG ulReserved,
+ULONG FAR PASCAL MAPIFindNext(LHANDLE lhSession, ULONG ulUIParam, const LPTSTR lpszMessageType,
+                              const LPTSTR lpszSeedMessageID, FLAGS flFlags, ULONG ulReserved,
                               unsigned char lpszMessageID[64])
 {
   nsIMapi *pNsMapi = NULL;
 
   if (!InitMozillaReference(&pNsMapi))
     return MAPI_E_FAILURE;
 
   if (lhSession == 0)
     return MAPI_E_INVALID_SESSION;
 
-  if (!lpszMessageType)
-    lpszMessageType = L"";
-
-  if (!lpszSeedMessageID)
-    lpszSeedMessageID = L"";
-
-  return pNsMapi->FindNext(lhSession, ulUIParam, lpszMessageType,
-                              lpszSeedMessageID, flFlags, ulReserved,
-                              lpszMessageID) ;
+  const LPTSTR type = lpszMessageType ? lpszMessageType : (const LPTSTR)(L"");
+  const LPTSTR id = lpszSeedMessageID ? lpszSeedMessageID : (const LPTSTR)(L"");
+  return pNsMapi->FindNext(lhSession, ulUIParam, type, id,
+                           flFlags, ulReserved, lpszMessageID);
 }
 
 
 ULONG FAR PASCAL MAPIReadMail(LHANDLE lhSession, ULONG ulUIParam, LPTSTR lpszMessageID,
                               FLAGS flFlags, ULONG ulReserved, nsMapiMessage **lppMessage)
 {
   nsIMapi *pNsMapi = NULL;
 
--- a/mailnews/mapi/mapihook/build/msgMapi.idl
+++ b/mailnews/mapi/mapihook/build/msgMapi.idl
@@ -101,18 +101,18 @@ interface nsIMapi : IUnknown
 
     HRESULT SendMail([in] unsigned long aSession, [in, unique] lpnsMapiMessage aMessage,
                      [in] unsigned long aFlags, [in] unsigned long aReserved) ;
 
     HRESULT SendDocuments([in] unsigned long aSession,
                           [in, unique] LPTSTR aDelimChar, [in, unique] LPTSTR aFilePaths,
                           [in, unique] LPTSTR aFileNames, [in] ULONG aFlags ) ;
 
-    HRESULT FindNext([in] unsigned long aSession, [in] ULONG ulUIParam, [in, unique] LPTSTR lpszMessageType,
-                     [in, unique] LPTSTR lpszSeedMessageID, [in] ULONG flFlags, [in] ULONG ulReserved,
+    HRESULT FindNext([in] unsigned long aSession, [in] ULONG ulUIParam, [in, unique] const LPTSTR lpszMessageType,
+                     [in, unique] const LPTSTR lpszSeedMessageID, [in] ULONG flFlags, [in] ULONG ulReserved,
                      [in] [out] char lpszMessageID[64] ) ;
 
     HRESULT ReadMail([in] unsigned long lhSession, [in] ULONG ulUIParam, [in, unique] LPTSTR lpszMessageID,
                      [in] ULONG flFlags, [in] ULONG ulReserved, [out] lpnsMapiMessage *lppMessage);
 
     HRESULT DeleteMail([in] unsigned long lhSession, [in] ULONG ulUIParam, [in, unique] LPTSTR lpszMessageID,
                        [in] ULONG flFlags, [in] ULONG ulReserved);
 
--- a/mailnews/mapi/mapihook/src/msgMapiFactory.h
+++ b/mailnews/mapi/mapihook/src/msgMapiFactory.h
@@ -27,13 +27,13 @@ public :
     STDMETHODIMP        CreateInstance (LPUNKNOWN aUnkOuter, REFIID aIid, void **aPpv);
     STDMETHODIMP        LockServer (BOOL aLock);
 
     CMapiFactory ();
 
 private:
     mozilla::ThreadSafeAutoRefCnt m_cRef;
 
-    ~CMapiFactory ();
+    virtual ~CMapiFactory ();
 };
 
 #endif  // MSG_MAPI_FACTORY_H
 
--- a/mailnews/mapi/mapihook/src/msgMapiImp.h
+++ b/mailnews/mapi/mapihook/src/msgMapiImp.h
@@ -58,17 +58,17 @@ public :
 
   STDMETHODIMP SendMailW(unsigned long aSession, lpnsMapiMessageW aMessage,
                          unsigned long aFlags, unsigned long aReserved);
 
   STDMETHODIMP Logoff (unsigned long aSession);
   STDMETHODIMP CleanUp();
 
   CMapiImp();
-  ~CMapiImp();
+  virtual ~CMapiImp();
 
   LONG InitContext(unsigned long session, MsgMapiListContext **listContext);
   nsresult GetDefaultInbox(nsIMsgFolder **inboxFolder);
 
 private :
   PRLock *m_Lock;
   mozilla::ThreadSafeAutoRefCnt m_cRef;
 };
--- a/mailnews/mapi/mapihook/src/msgMapiMain.h
+++ b/mailnews/mapi/mapihook/src/msgMapiMain.h
@@ -1,14 +1,14 @@
 /* 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/. */
 
 #ifndef MSG_MAPI_MAIN_H_
-#define NSG_MAPI_MAIN_H_
+#define MSG_MAPI_MAIN_H_
 
 #define        MAX_NAME_LEN    256
 #define        MAX_PW_LEN      256
 #define        MAX_SESSIONS    50
 #define        MAPI_SENDCOMPLETE_EVENT   "SendCompletionEvent"
 
 #define MAPI_PROPERTIES_CHROME "chrome://messenger-mapi/locale/mapi.properties"
 #define PREF_MAPI_WARN_PRIOR_TO_BLIND_SEND "mapi.blind-send.warn"
@@ -66,17 +66,17 @@ class nsMAPISession
 
   public :
     nsMAPISession(uint32_t aHwnd, const char16_t *aUserName, \
                   const char16_t *aPassword, \
                   bool aForceDownLoad, const char *aKey);
     uint32_t IncrementSession();
     uint32_t DecrementSession();
     uint32_t GetSessionCount();
-    char16_t *nsMAPISession::GetPassword();
+    char16_t *GetPassword();
     void GetIdKey(nsCString& aKey);
     ~nsMAPISession();
     // For enumerating Messages...
     void SetMapiListContext( void *listContext) { m_listContext = listContext; } 
     void *GetMapiListContext( ) { return m_listContext; }
 };
 
 #endif    // MSG_MAPI_MAIN_H_
--- a/mailnews/mapi/mapihook/src/msgMapiSupport.h
+++ b/mailnews/mapi/mapihook/src/msgMapiSupport.h
@@ -20,15 +20,15 @@ class nsMapiSupport : public nsIMapiSupp
         nsMapiSupport();
 
         // Declare all interface methods we must implement.
         NS_DECL_THREADSAFE_ISUPPORTS
         NS_DECL_NSIOBSERVER
         NS_DECL_NSIMAPISUPPORT
 
     private :
-        ~nsMapiSupport();
+        virtual ~nsMapiSupport();
 
         DWORD   m_dwRegister;
         CMapiFactory *m_nsMapiFactory;
 };
 
 #endif  // MSG_MAPI_SUPPORT_H_