Bug 814541 - Silence warnings in gfx/layers/d3d9/Nv3DVUtils.cpp. r=Bas
authorChris Pearce <cpearce@mozilla.com>
Fri, 23 Nov 2012 15:21:20 +1300
changeset 114057 c27455415eacc423c0b542b3dd39a74a3d0798d6
parent 114056 0ad8812349f2042ba063cc401f6cf8938785c45d
child 114058 7789895e492d3874c90f727164ffab1aa51039d9
child 114067 d8e4f06198dc4933b0011b396ad1d41a063312a1
push id18523
push userryanvm@gmail.com
push dateFri, 23 Nov 2012 02:38:37 +0000
treeherdermozilla-inbound@c27455415eac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs814541
milestone20.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 814541 - Silence warnings in gfx/layers/d3d9/Nv3DVUtils.cpp. r=Bas
gfx/layers/d3d9/Nv3DVUtils.cpp
--- a/gfx/layers/d3d9/Nv3DVUtils.cpp
+++ b/gfx/layers/d3d9/Nv3DVUtils.cpp
@@ -26,46 +26,57 @@ Nv3DVUtils::Nv3DVUtils()
 {
 }
 
 Nv3DVUtils::~Nv3DVUtils()
 {
   UnInitialize();
 }
 
+
+// Silence spurious warnings!
+#if defined(WARNING) || defined WARN_IF_FALSE
+#error We shouldn't be redefining these!
+#endif
+// Uncomment these to enable spurious warnings.
+//#define WARNING(str) NS_WARNING(str)
+//#define WARN_IF_FALSE(b, str) NS_WARN_IF_FALSE(b, str)
+#define WARNING(str)
+#define WARN_IF_FALSE(b, str)
+
 /**
  * Initializes the Nv3DVUtils object.
  */
 void
 Nv3DVUtils::Initialize()
 {
   /*
    * Detect if 3D Streaming object is already loaded. Do nothing in that case.
    */
   if (m3DVStreaming) {
-    NS_WARNING("Nv3DVStreaming COM object already instantiated.\n");
+    WARNING("Nv3DVStreaming COM object already instantiated.\n");
     return;
   }
 
   /*
    * Create the COM object. If we fail at any stage, just return
    */
   HRESULT hr = CoCreateInstance(CLSID_NV3DVStreaming, NULL, CLSCTX_INPROC_SERVER, IID_INV3DVStreaming, (void**)(getter_AddRefs(m3DVStreaming)));
   if (FAILED(hr) || !m3DVStreaming) {
-    NS_WARNING("Nv3DVStreaming CoCreateInstance failed (disabled).");
+    WARNING("Nv3DVStreaming CoCreateInstance failed (disabled).");
     return;
   }
 
   /*
    * Initialize the object. Note that m3DVStreaming cannot be NULL at this point.
    */
   bool bRetVal = m3DVStreaming->Nv3DVInitialize();
 
   if (!bRetVal) {
-    NS_WARNING("Nv3DVStreaming Nv3DVInitialize failed!");
+    WARNING("Nv3DVStreaming Nv3DVInitialize failed!");
     return;
   }
 }
 
 /**
  * Release resources used by the COM Object, and then release 
  * the COM Object (nsRefPtr gets released by setting to NULL) 
  *
@@ -81,56 +92,56 @@ Nv3DVUtils::UnInitialize()
 /**
  * Sets the device info, along with any other initialization that is needed after device creation
  * Pass the D3D9 device pointer is an IUnknown input argument.
  */
 void 
 Nv3DVUtils::SetDeviceInfo(IUnknown *devUnknown)
 {
   if (!devUnknown) {
-    NS_WARNING("D3D Device Pointer (IUnknown) is NULL.\n");
+    WARNING("D3D Device Pointer (IUnknown) is NULL.\n");
     return;
   }
 
   if (!m3DVStreaming) {
       return;
   }
 
   bool rv = m3DVStreaming->Nv3DVSetDevice(devUnknown);
   if (!rv) {
-      NS_WARNING("Nv3DVStreaming Nv3DVControl failed!");
+      WARNING("Nv3DVStreaming Nv3DVControl failed!");
       return;
   }
 
   rv = m3DVStreaming->Nv3DVControl(NV_STEREO_MODE_RIGHT_LEFT, true, FIREFOX_3DV_APP_HANDLE);
-  NS_WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVControl failed!");
+  WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVControl failed!");
 }
 
 /*
  * Send Stereo Control Information. Used mainly to re-route
  * calls from ImageLayerD3D9 to the 3DV COM object
  */
 void 
 Nv3DVUtils::SendNv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle)
 {
   if (!m3DVStreaming)
       return;
 
   DebugOnly<bool> rv = m3DVStreaming->Nv3DVControl(eStereoMode, bEnableStereo, dw3DVAppHandle);
-  NS_WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVControl failed!");
+  WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVControl failed!");
 }
 
 /*
  * Send Stereo Metadata. Used mainly to re-route calls
  * from ImageLayerD3D9 to the 3DV COM object
  */
 void
 Nv3DVUtils::SendNv3DVMetaData(unsigned int dwWidth, unsigned int dwHeight, HANDLE hSrcLuma, HANDLE hDst)
 {
   if (!m3DVStreaming)
       return;
 
   DebugOnly<bool> rv = m3DVStreaming->Nv3DVMetaData((DWORD)dwWidth, (DWORD)dwHeight, hSrcLuma, hDst);
-  NS_WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVMetaData failed!");
+  WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVMetaData failed!");
 }
 
 } /* namespace layers */
 } /* namespace mozilla */