Bug 797316 - Fix -Werror=conversion-null errors in Windows-only code (dom/plugins part) r=joshmoz
authorJacek Caban <jacek@codeweavers.com>
Thu, 04 Oct 2012 10:31:37 +0200
changeset 115526 d4a5f910c4461f791581cb8d13e930f6476a2088
parent 115525 8913d486d3f4a87a84a898b3d6d4f3f33203e870
child 115527 65b1536aee04e6949052c021abe213670687f280
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersjoshmoz
bugs797316
milestone18.0a1
Bug 797316 - Fix -Werror=conversion-null errors in Windows-only code (dom/plugins part) r=joshmoz
dom/plugins/base/nsNPAPIPlugin.cpp
dom/plugins/base/nsPluginNativeWindowWin.cpp
dom/plugins/base/nsPluginsDirWin.cpp
dom/plugins/ipc/NPEventWindows.h
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -257,21 +257,22 @@ nsNPAPIPlugin::RunPluginOOP(const nsPlug
   if (!aPluginTag) {
     return false;
   }
 
 #ifdef ACCESSIBILITY
   // Certain assistive technologies don't want oop Flash, thus we have a special
   // pref for them to disable oop Flash (refer to bug 785047 for details).
   bool useA11yPref = false;
+#ifdef XP_WIN
+  useA11yPref =  a11y::Compatibility::IsJAWS();
+#endif
 #endif
 
 #ifdef XP_WIN
-  useA11yPref =  a11y::Compatibility::IsJAWS();
-
   // On Windows Vista+, we force Flash to run in OOPP mode because Adobe
   // doesn't test Flash in-process and there are known stability bugs.
   if (aPluginTag->mIsFlashPlugin && IsVistaOrLater()) {
 #ifdef ACCESSIBILITY
     if (!useA11yPref)
       return true;
 #else
     return true;
--- a/dom/plugins/base/nsPluginNativeWindowWin.cpp
+++ b/dom/plugins/base/nsPluginNativeWindowWin.cpp
@@ -689,17 +689,17 @@ nsresult nsPluginNativeWindowWin::Subcla
   else
     style |= WS_CLIPCHILDREN;
   SetWindowLongPtr(hWnd, GWL_STYLE, style);
 
   mPluginWinProc = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)PluginWndProc);
   if (!mPluginWinProc)
     return NS_ERROR_FAILURE;
 
-  nsPluginNativeWindowWin * win = (nsPluginNativeWindowWin *)::GetProp(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION);
+  DebugOnly<nsPluginNativeWindowWin *> win = (nsPluginNativeWindowWin *)::GetProp(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION);
   NS_ASSERTION(!win || (win == this), "plugin window already has property and this is not us");
   
   if (!::SetProp(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION, (HANDLE)this))
     return NS_ERROR_FAILURE;
 
   return NS_OK;
 }
 
--- a/dom/plugins/base/nsPluginsDirWin.cpp
+++ b/dom/plugins/base/nsPluginsDirWin.cpp
@@ -275,17 +275,17 @@ nsresult nsPluginFile::LoadPlugin(PRLibr
   if (NS_FAILED(rv))
       *outLibrary = NULL;
 
   if (protectCurrentDirectory) {
     SetDllDirectory(L"");
   }
 
   if (restoreOrigDir) {
-    BOOL bCheck = SetCurrentDirectoryW(aOrigDir);
+    DebugOnly<BOOL> bCheck = SetCurrentDirectoryW(aOrigDir);
     NS_ASSERTION(bCheck, "Error in Loading plugin");
   }
 
   return rv;
 }
 
 /**
  * Obtains all of the information currently available for this plugin.
@@ -316,17 +316,17 @@ nsresult nsPluginFile::GetPluginInfo(nsP
 
   versionsize = ::GetFileVersionInfoSizeW(lpFilepath, &zerome);
 
   if (versionsize > 0)
     verbuf = PR_Malloc(versionsize);
   if (!verbuf)
     return NS_ERROR_OUT_OF_MEMORY;
 
-  if (::GetFileVersionInfoW(lpFilepath, NULL, versionsize, verbuf))
+  if (::GetFileVersionInfoW(lpFilepath, 0, versionsize, verbuf))
   {
     // TODO: get appropriately-localized info from plugin file
     UINT lang = 1033; // language = English
     UINT cp = 1252;   // codepage = Western
     info.fName = GetKeyValue(verbuf, L"ProductName", lang, cp);
     info.fDescription = GetKeyValue(verbuf, L"FileDescription", lang, cp);
  
     char *mimeType = GetKeyValue(verbuf, L"MIMEType", lang, cp);
--- a/dom/plugins/ipc/NPEventWindows.h
+++ b/dom/plugins/ipc/NPEventWindows.h
@@ -93,17 +93,17 @@ struct ParamTraits<mozilla::plugins::NPR
             case WM_RBUTTONDBLCLK:
 
             case WM_SETFOCUS:
             case WM_KILLFOCUS:
                 break;
 
             default:
                 // RegisterWindowMessage events should be passed.
-                if (paramCopy.event.event >= 0xC000 && paramCopy.event.event <= 0xFFFF)
+                if (paramCopy.event.event >= 0xC000)
                     break;
 
                 // FIXME/bug 567465: temporarily work around unhandled
                 // events by forwarding a "dummy event".  The eventual
                 // fix will be to stop trying to send these events
                 // entirely.
                 paramCopy.event.event = WM_NULL;
                 break;