Bug 754582 - Fixed unused-result warnings in Windows-specific code r=benjamin
authorJacek Caban <jacek@codeweavers.com>
Wed, 16 May 2012 10:48:45 +0200
changeset 94115 255b7fd26002432dcfa8dd36a9d6587876c5a9e4
parent 94114 cf972dca5a8e91f678661bdef474124ec5025aad
child 94116 8dc6d1111442f14fcc2a808e020c70b4d6a4bd29
push id22700
push userryanvm@gmail.com
push dateThu, 17 May 2012 00:48:56 +0000
treeherdermozilla-central@762e95608da3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenjamin
bugs754582
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 754582 - Fixed unused-result warnings in Windows-specific code r=benjamin
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginModuleParent.cpp
widget/tests/TestAppShellSteadyState.cpp
widget/windows/nsWindowGfx.cpp
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -1195,26 +1195,27 @@ PluginInstanceParent::NPP_HandleEvent(vo
     if (mWindowType == NPWindowTypeDrawable) {
         if (IsAsyncDrawing()) {
             if (npevent->event == WM_PAINT || npevent->event == DoublePassRenderingEvent()) {
                 // This plugin maintains its own async drawing.
                 return handled;
             }
         }
         if (DoublePassRenderingEvent() == npevent->event) {
-            CallPaint(npremoteevent, &handled);
-            return handled;
+            return CallPaint(npremoteevent, &handled) && handled;
         }
 
         switch (npevent->event) {
             case WM_PAINT:
             {
                 RECT rect;
                 SharedSurfaceBeforePaint(rect, npremoteevent);
-                CallPaint(npremoteevent, &handled);
+                if (!CallPaint(npremoteevent, &handled)) {
+                    handled = false;
+                }
                 SharedSurfaceAfterPaint(npevent);
                 return handled;
             }
             break;
 
             case WM_KILLFOCUS:
             {
               // When the user selects fullscreen mode in Flash video players,
@@ -1232,20 +1233,17 @@ PluginInstanceParent::NPP_HandleEvent(vo
                   return 0;
               }
             }
             break;
 
             case WM_WINDOWPOSCHANGED:
             {
                 // We send this in nsObjectFrame just before painting
-                SendWindowPosChanged(npremoteevent);
-                // nsObjectFrame doesn't care whether we handle this
-                // or not, just returning 1 for good hygiene
-                return 1;
+                return SendWindowPosChanged(npremoteevent);
             }
             break;
         }
     }
 #endif
 
 #if defined(MOZ_X11)
     switch (npevent->type) {
@@ -1787,17 +1785,17 @@ PluginInstanceParent::PluginWindowHookPr
         return DefWindowProc(hWnd, message, wParam, lParam);
     }
 
     NS_ASSERTION(self->mPluginHWND == hWnd, "Wrong window!");
 
     switch (message) {
         case WM_SETFOCUS:
         // Let the child plugin window know it should take focus.
-        self->CallSetPluginFocus();
+        unused << self->CallSetPluginFocus();
         break;
 
         case WM_CLOSE:
         self->UnsubclassPluginWindow();
         break;
     }
 
     if (self->mPluginWndProc == PluginWindowHookProc) {
@@ -1816,17 +1814,17 @@ PluginInstanceParent::SubclassPluginWind
     NS_ASSERTION(!(mPluginHWND && aWnd != mPluginHWND),
       "PluginInstanceParent::SubclassPluginWindow hwnd is not our window!");
 
     if (!mPluginHWND) {
         mPluginHWND = aWnd;
         mPluginWndProc = 
             (WNDPROC)::SetWindowLongPtrA(mPluginHWND, GWLP_WNDPROC,
                          reinterpret_cast<LONG_PTR>(PluginWindowHookProc));
-        bool bRes = ::SetPropW(mPluginHWND, kPluginInstanceParentProperty, this);
+        DebugOnly<bool> bRes = ::SetPropW(mPluginHWND, kPluginInstanceParentProperty, this);
         NS_ASSERTION(mPluginWndProc,
           "PluginInstanceParent::SubclassPluginWindow failed to set subclass!");
         NS_ASSERTION(bRes,
           "PluginInstanceParent::SubclassPluginWindow failed to set prop!");
    }
 }
 
 void
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -787,17 +787,17 @@ PluginModuleParent::NP_Initialize(NPNets
     // Send the info needed to join the chrome process's audio session to the
     // plugin process
     nsID id;
     nsString sessionName;
     nsString iconPath;
 
     if (NS_SUCCEEDED(mozilla::widget::GetAudioSessionData(id, sessionName,
                                                           iconPath)))
-        SendSetAudioSessionData(id, sessionName, iconPath);
+        unused << SendSetAudioSessionData(id, sessionName, iconPath);
 #endif
 
     return NS_OK;
 }
 #endif
 
 nsresult
 PluginModuleParent::NP_Shutdown(NPError* error)
@@ -1038,17 +1038,17 @@ PluginModuleParent::RecvProcessNativeEve
     return false;
 #endif
 }
 
 void
 PluginModuleParent::ProcessRemoteNativeEventsInRPCCall()
 {
 #if defined(OS_WIN)
-    SendProcessNativeEventsInRPCCall();
+    unused << SendProcessNativeEventsInRPCCall();
     return;
 #endif
     NS_NOTREACHED(
         "PluginModuleParent::ProcessRemoteNativeEventsInRPCCall not implemented!");
 }
 
 bool
 PluginModuleParent::RecvPluginShowWindow(const uint32_t& aWindowId, const bool& aModal,
--- a/widget/tests/TestAppShellSteadyState.cpp
+++ b/widget/tests/TestAppShellSteadyState.cpp
@@ -20,17 +20,17 @@
 #include "nsIXULWindow.h"
 
 #include "nsAppShellCID.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsNetUtil.h"
 #include "nsThreadUtils.h"
 
 #ifdef XP_WIN
-#include "Windows.h"
+#include <windows.h>
 #endif
 
 using namespace mozilla;
 
 typedef void (*TestFunc)(nsIAppShell*);
 
 bool gStableStateEventHasRun = false;
 
--- a/widget/windows/nsWindowGfx.cpp
+++ b/widget/windows/nsWindowGfx.cpp
@@ -61,16 +61,17 @@ using mozilla::plugins::PluginInstancePa
 #include "gfxImageSurface.h"
 #include "gfxWindowsSurface.h"
 #include "gfxWindowsPlatform.h"
 #include "nsGfxCIID.h"
 #include "gfxContext.h"
 #include "nsRenderingContext.h"
 #include "prmem.h"
 #include "WinUtils.h"
+#include "mozilla/unused.h"
 
 #include "LayerManagerOGL.h"
 #include "BasicLayers.h"
 #ifdef MOZ_ENABLE_D3D9_LAYER
 #include "LayerManagerD3D9.h"
 #endif
 #ifdef MOZ_ENABLE_D3D10_LAYER
 #include "LayerManagerD3D10.h"
@@ -79,16 +80,17 @@ using mozilla::plugins::PluginInstancePa
 #include "nsUXThemeData.h"
 #include "nsUXThemeConstants.h"
 
 extern "C" {
 #define PIXMAN_DONT_DEFINE_STDINT
 #include "pixman.h"
 }
 
+using namespace mozilla;
 using namespace mozilla::layers;
 using namespace mozilla::widget;
 
 /**************************************************************
  **************************************************************
  **
  ** BLOCK: Variables
  **
@@ -247,17 +249,17 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32
       BeginPaint(mWnd, &ps);
       EndPaint(mWnd, &ps);
       return true;
     }
 
     PluginInstanceParent* instance = reinterpret_cast<PluginInstanceParent*>(
       ::GetPropW(mWnd, L"PluginInstanceParentProperty"));
     if (instance) {
-      instance->CallUpdateWindow();
+      unused << instance->CallUpdateWindow();
     } else {
       // We should never get here since in-process plugins should have
       // subclassed our HWND and handled WM_PAINT, but in some cases that
       // could fail. Return without asserting since it's not our fault.
       NS_WARNING("Plugin failed to subclass our window");
     }
 
     ValidateRect(mWnd, NULL);