Fix warnings about unreferenced local variables.

BUG=skia:2272

Change-Id: Ibf03efedc662fea2a389ad2dc5af5b7b014181a8
Reviewed-on: https://chromium-review.googlesource.com/201900
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/Fence.cpp b/src/libGLESv2/Fence.cpp
index 1e04b1a..31d149d 100644
--- a/src/libGLESv2/Fence.cpp
+++ b/src/libGLESv2/Fence.cpp
@@ -104,6 +104,7 @@
 
     LARGE_INTEGER counterFreqency = { 0 };
     BOOL success = QueryPerformanceFrequency(&counterFreqency);
+    UNUSED_ASSERTION_VARIABLE(success);
     ASSERT(success);
 
     mCounterFrequency = counterFreqency.QuadPart;
@@ -143,6 +144,7 @@
 
     LARGE_INTEGER currentCounter = { 0 };
     BOOL success = QueryPerformanceCounter(&currentCounter);
+    UNUSED_ASSERTION_VARIABLE(success);
     ASSERT(success);
 
     LONGLONG timeoutInSeconds = static_cast<LONGLONG>(timeout) * static_cast<LONGLONG>(1000000ll);
@@ -152,6 +154,7 @@
     {
         Sleep(0);
         BOOL success = QueryPerformanceCounter(&currentCounter);
+        UNUSED_ASSERTION_VARIABLE(success);
         ASSERT(success);
     }
 
diff --git a/src/libGLESv2/renderer/d3d11/BufferStorage11.cpp b/src/libGLESv2/renderer/d3d11/BufferStorage11.cpp
index f66b88c..c0f8e00 100644
--- a/src/libGLESv2/renderer/d3d11/BufferStorage11.cpp
+++ b/src/libGLESv2/renderer/d3d11/BufferStorage11.cpp
@@ -388,6 +388,7 @@
     bufferSRVDesc.Format = srvFormat;
 
     HRESULT result = device->CreateShaderResourceView(buffer, &bufferSRVDesc, &bufferSRV);
+    UNUSED_ASSERTION_VARIABLE(result);
     ASSERT(SUCCEEDED(result));
 
     mBufferResourceViews[srvFormat] = BufferSRVPair(buffer, bufferSRV);
@@ -597,6 +598,7 @@
 
         D3D11_MAPPED_SUBRESOURCE mappedResource;
         HRESULT hr = context->Map(mNativeBuffer, 0, D3D11_MAP_WRITE, 0, &mappedResource);
+        UNUSED_ASSERTION_VARIABLE(hr);
         ASSERT(SUCCEEDED(hr));
 
         unsigned char *destPointer = static_cast<unsigned char *>(mappedResource.pData) + destOffset;
@@ -723,6 +725,7 @@
     UINT d3dMapFlag = ((access & GL_MAP_UNSYNCHRONIZED_BIT) != 0 ? D3D11_MAP_FLAG_DO_NOT_WAIT : 0);
 
     HRESULT result = context->Map(mNativeBuffer, 0, d3dMapType, d3dMapFlag, &mappedResource);
+    UNUSED_ASSERTION_VARIABLE(result);
     ASSERT(SUCCEEDED(result));
 
     return mappedResource.pData;
@@ -831,7 +834,6 @@
         ASSERT(SUCCEEDED(hr));
     }
 
-    ID3D11Texture2D* srcTex = NULL;
     if (textureDesc.SampleDesc.Count > 1)
     {
         UNIMPLEMENTED();
diff --git a/src/libGLESv2/renderer/d3d11/Renderer11.cpp b/src/libGLESv2/renderer/d3d11/Renderer11.cpp
index dff3166..143799a 100644
--- a/src/libGLESv2/renderer/d3d11/Renderer11.cpp
+++ b/src/libGLESv2/renderer/d3d11/Renderer11.cpp
@@ -1604,6 +1604,7 @@
     {
         D3D11_MAPPED_SUBRESOURCE map = {0};
         HRESULT result = mDeviceContext->Map(vertexConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map);
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
         mapVS = (float(*)[4])map.pData;
     }
@@ -1612,6 +1613,7 @@
     {
         D3D11_MAPPED_SUBRESOURCE map = {0};
         HRESULT result = mDeviceContext->Map(pixelConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map);
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
         mapPS = (float(*)[4])map.pData;
     }
@@ -1673,6 +1675,7 @@
         constantBufferDescription.StructureByteStride = 0;
 
         HRESULT result = mDevice->CreateBuffer(&constantBufferDescription, NULL, &mDriverConstantBufferVS);
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
 
         mDeviceContext->VSSetConstantBuffers(1, 1, &mDriverConstantBufferVS);
@@ -1689,6 +1692,7 @@
         constantBufferDescription.StructureByteStride = 0;
 
         HRESULT result = mDevice->CreateBuffer(&constantBufferDescription, NULL, &mDriverConstantBufferPS);
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
 
         mDeviceContext->PSSetConstantBuffers(1, 1, &mDriverConstantBufferPS);
@@ -3448,6 +3452,7 @@
 
     D3D11_MAPPED_SUBRESOURCE mapping;
     HRESULT hr = mDeviceContext->Map(readTexture, 0, D3D11_MAP_READ, 0, &mapping);
+    UNUSED_ASSERTION_VARIABLE(hr);
     ASSERT(SUCCEEDED(hr));
 
     unsigned char *source;
diff --git a/src/libGLESv2/renderer/d3d11/ShaderExecutable11.cpp b/src/libGLESv2/renderer/d3d11/ShaderExecutable11.cpp
index fe8749b..de2eeda 100644
--- a/src/libGLESv2/renderer/d3d11/ShaderExecutable11.cpp
+++ b/src/libGLESv2/renderer/d3d11/ShaderExecutable11.cpp
@@ -93,6 +93,7 @@
         constantBufferDescription.StructureByteStride = 0;
 
         HRESULT result = d3d11Device->CreateBuffer(&constantBufferDescription, NULL, &mConstantBuffer);
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
     }
 }
diff --git a/src/libGLESv2/renderer/d3d11/SwapChain11.cpp b/src/libGLESv2/renderer/d3d11/SwapChain11.cpp
index d0be253..096370e 100644
--- a/src/libGLESv2/renderer/d3d11/SwapChain11.cpp
+++ b/src/libGLESv2/renderer/d3d11/SwapChain11.cpp
@@ -593,6 +593,7 @@
     if (result == DXGI_ERROR_DEVICE_REMOVED)
     {
         HRESULT removedReason = device->GetDeviceRemovedReason();
+        UNUSED_ASSERTION_VARIABLE(removedReason);
         ERR("Present failed: the D3D11 device was removed: 0x%08X", removedReason);
         return EGL_CONTEXT_LOST;
     }
diff --git a/src/libGLESv2/renderer/d3d11/renderer11_utils.h b/src/libGLESv2/renderer/d3d11/renderer11_utils.h
index e577d48..94bb8f8 100644
--- a/src/libGLESv2/renderer/d3d11/renderer11_utils.h
+++ b/src/libGLESv2/renderer/d3d11/renderer11_utils.h
@@ -117,6 +117,7 @@
 {
     ID3D11VertexShader *vs = NULL;
     HRESULT result = device->CreateVertexShader(byteCode, N, NULL, &vs);
+    UNUSED_ASSERTION_VARIABLE(result);
     ASSERT(SUCCEEDED(result));
     SetDebugName(vs, name);
     return vs;
@@ -127,6 +128,7 @@
 {
     ID3D11GeometryShader *gs = NULL;
     HRESULT result = device->CreateGeometryShader(byteCode, N, NULL, &gs);
+    UNUSED_ASSERTION_VARIABLE(result);
     ASSERT(SUCCEEDED(result));
     SetDebugName(gs, name);
     return gs;
@@ -137,6 +139,7 @@
 {
     ID3D11PixelShader *ps = NULL;
     HRESULT result = device->CreatePixelShader(byteCode, N, NULL, &ps);
+    UNUSED_ASSERTION_VARIABLE(result);
     ASSERT(SUCCEEDED(result));
     SetDebugName(ps, name);
     return ps;
diff --git a/src/libGLESv2/renderer/d3d9/Fence9.cpp b/src/libGLESv2/renderer/d3d9/Fence9.cpp
index 02b927e..372a8a4 100644
--- a/src/libGLESv2/renderer/d3d9/Fence9.cpp
+++ b/src/libGLESv2/renderer/d3d9/Fence9.cpp
@@ -43,6 +43,7 @@
     }
 
     HRESULT result = mQuery->Issue(D3DISSUE_END);
+    UNUSED_ASSERTION_VARIABLE(result);
     ASSERT(SUCCEEDED(result));
 }
 
diff --git a/src/libGLESv2/renderer/d3d9/Image9.cpp b/src/libGLESv2/renderer/d3d9/Image9.cpp
index 30613bc..7ddf957 100644
--- a/src/libGLESv2/renderer/d3d9/Image9.cpp
+++ b/src/libGLESv2/renderer/d3d9/Image9.cpp
@@ -240,6 +240,7 @@
     if (mSurface)
     {
         HRESULT result = mSurface->UnlockRect();
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
     }
 }
@@ -367,6 +368,7 @@
         {
             // UpdateSurface: source must be SYSTEMMEM, dest must be DEFAULT pools 
             HRESULT result = device->UpdateSurface(sourceSurface, &rect, destSurface, &point);
+            UNUSED_ASSERTION_VARIABLE(result);
             ASSERT(SUCCEEDED(result));
         }
     }
@@ -417,11 +419,8 @@
     GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, 1);
     GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, height, 1);
 
-    GLuint outputBlockWidth = d3d9::GetBlockWidth(mD3DFormat);
-    GLuint outputBlockHeight = d3d9::GetBlockHeight(mD3DFormat);
-
-    ASSERT(xoffset % outputBlockWidth == 0);
-    ASSERT(yoffset % outputBlockHeight == 0);
+    ASSERT(xoffset % d3d9::GetBlockWidth(mD3DFormat) == 0);
+    ASSERT(yoffset % d3d9::GetBlockHeight(mD3DFormat) == 0);
 
     LoadImageFunction loadFunction = d3d9::GetImageLoadFunction(mInternalFormat, mRenderer);
     ASSERT(loadFunction != NULL);
diff --git a/src/libGLESv2/renderer/d3d9/Query9.cpp b/src/libGLESv2/renderer/d3d9/Query9.cpp
index 40e7fc2..bc3f58f 100644
--- a/src/libGLESv2/renderer/d3d9/Query9.cpp
+++ b/src/libGLESv2/renderer/d3d9/Query9.cpp
@@ -38,6 +38,7 @@
     }
 
     HRESULT result = mQuery->Issue(D3DISSUE_BEGIN);
+    UNUSED_ASSERTION_VARIABLE(result);
     ASSERT(SUCCEEDED(result));
 }
 
@@ -46,6 +47,7 @@
     ASSERT(mQuery);
 
     HRESULT result = mQuery->Issue(D3DISSUE_END);
+    UNUSED_ASSERTION_VARIABLE(result);
     ASSERT(SUCCEEDED(result));
 
     mStatus = GL_FALSE;
diff --git a/src/libGLESv2/renderer/d3d9/Renderer9.cpp b/src/libGLESv2/renderer/d3d9/Renderer9.cpp
index 8c60653..7af1682 100644
--- a/src/libGLESv2/renderer/d3d9/Renderer9.cpp
+++ b/src/libGLESv2/renderer/d3d9/Renderer9.cpp
@@ -676,6 +676,7 @@
     if (mEventQueryPool.empty())
     {
         HRESULT result = mDevice->CreateQuery(D3DQUERYTYPE_EVENT, &query);
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
     }
     else
diff --git a/src/libGLESv2/renderer/d3d9/TextureStorage9.cpp b/src/libGLESv2/renderer/d3d9/TextureStorage9.cpp
index 551394e..a8efca7 100644
--- a/src/libGLESv2/renderer/d3d9/TextureStorage9.cpp
+++ b/src/libGLESv2/renderer/d3d9/TextureStorage9.cpp
@@ -145,6 +145,7 @@
     if (mTexture)
     {
         HRESULT result = mTexture->GetSurfaceLevel(level + mTopLevel, &surface);
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
 
         // With managed textures the driver needs to be informed of updates to the lower mipmap levels
@@ -250,6 +251,7 @@
     {
         D3DCUBEMAP_FACES face = gl_d3d9::ConvertCubeFace(faceTarget);
         HRESULT result = mTexture->GetCubeMapSurface(face, level + mTopLevel, &surface);
+        UNUSED_ASSERTION_VARIABLE(result);
         ASSERT(SUCCEEDED(result));
 
         // With managed textures the driver needs to be informed of updates to the lower mipmap levels