Bug 1405439 Do not cast nullptr to bool implicitly, instead return false in gfx/vr r=kip
authorTom Ritter <tom@mozilla.com>
Tue, 03 Oct 2017 12:47:10 -0500
changeset 426922 5e71f573019a4dbe71224e4ea1bddfb02271faae
parent 426921 65c36c354b6acc47c9f286c6bb0e8ac2d0cd025b
child 426923 5e0b4009cf4f338488ac8813f3247c242a357ddf
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewerskip
bugs1405439
milestone58.0a1
Bug 1405439 Do not cast nullptr to bool implicitly, instead return false in gfx/vr r=kip MozReview-Commit-ID: LtfTRFDopsT
gfx/vr/gfxVROculus.cpp
gfx/vr/gfxVRPuppet.cpp
old mode 100644
new mode 100755
--- a/gfx/vr/gfxVROculus.cpp
+++ b/gfx/vr/gfxVROculus.cpp
@@ -1105,17 +1105,17 @@ VRDisplayOculus::SubmitFrame(ID3D11Textu
   mContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
   mContext->VSSetShader(mQuadVS, nullptr, 0);
   mContext->PSSetShader(mQuadPS, nullptr, 0);
 
   RefPtr<ID3D11ShaderResourceView> srView;
   HRESULT hr = mDevice->CreateShaderResourceView(aSource, nullptr, getter_AddRefs(srView));
   if (FAILED(hr)) {
     gfxWarning() << "Could not create shader resource view for Oculus: " << hexa(hr);
-    return nullptr;
+    return false;
   }
   ID3D11ShaderResourceView* viewPtr = srView.get();
   mContext->PSSetShaderResources(0 /* 0 == TexSlot::RGB */, 1, &viewPtr);
   // XXX Use Constant from TexSlot in CompositorD3D11.cpp?
 
   ID3D11SamplerState *sampler = mLinearSamplerState;
   mContext->PSSetSamplers(0, 1, &sampler);
 
old mode 100644
new mode 100755
--- a/gfx/vr/gfxVRPuppet.cpp
+++ b/gfx/vr/gfxVRPuppet.cpp
@@ -428,17 +428,17 @@ VRDisplayPuppet::SubmitFrame(ID3D11Textu
       mContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
       mContext->VSSetShader(mQuadVS, nullptr, 0);
       mContext->PSSetShader(mQuadPS, nullptr, 0);
 
       RefPtr<ID3D11ShaderResourceView> srView;
       HRESULT hr = mDevice->CreateShaderResourceView(aSource, nullptr, getter_AddRefs(srView));
       if (FAILED(hr) || !srView) {
         gfxWarning() << "Could not create shader resource view for Puppet: " << hexa(hr);
-        return nullptr;
+        return false;
       }
       ID3D11ShaderResourceView* viewPtr = srView.get();
       mContext->PSSetShaderResources(0 /* 0 == TexSlot::RGB */, 1, &viewPtr);
       // XXX Use Constant from TexSlot in CompositorD3D11.cpp?
 
       ID3D11SamplerState *sampler = mLinearSamplerState;
       mContext->PSSetSamplers(0, 1, &sampler);