Fix warnings with code analysis tools.
Variable shadowing and a few other non-bug warnings.
BUG=None
Change-Id: Ibf62d6e7fef91fc213a53a6902f494147ed30ebc
Reviewed-on: https://chromium-review.googlesource.com/283223
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/VertexDataManager.cpp b/src/libANGLE/renderer/d3d/VertexDataManager.cpp
index 517e236..00adfc1 100644
--- a/src/libANGLE/renderer/d3d/VertexDataManager.cpp
+++ b/src/libANGLE/renderer/d3d/VertexDataManager.cpp
@@ -171,9 +171,9 @@
}
// Reserve the required space in the buffers
- for (const TranslatedAttribute *translated : mActiveEnabledAttributes)
+ for (const TranslatedAttribute *activeAttrib : mActiveEnabledAttributes)
{
- gl::Error error = reserveSpaceForAttrib(*translated, count, instances);
+ gl::Error error = reserveSpaceForAttrib(*activeAttrib, count, instances);
if (error.isError())
{
return error;
@@ -181,9 +181,9 @@
}
// Perform the vertex data translations
- for (TranslatedAttribute *translated : mActiveEnabledAttributes)
+ for (TranslatedAttribute *activeAttrib : mActiveEnabledAttributes)
{
- gl::Error error = storeAttribute(translated, start, count, instances);
+ gl::Error error = storeAttribute(activeAttrib, start, count, instances);
if (error.isError())
{
@@ -212,14 +212,14 @@
// Hint to unmap all the resources
hintUnmapAllResources(vertexAttributes);
- for (const TranslatedAttribute *translated : mActiveEnabledAttributes)
+ for (const TranslatedAttribute *activeAttrib : mActiveEnabledAttributes)
{
- gl::Buffer *buffer = translated->attribute->buffer.get();
+ gl::Buffer *buffer = activeAttrib->attribute->buffer.get();
if (buffer)
{
BufferD3D *bufferD3D = GetImplAs<BufferD3D>(buffer);
- size_t typeSize = ComputeVertexAttributeTypeSize(*translated->attribute);
+ size_t typeSize = ComputeVertexAttributeTypeSize(*activeAttrib->attribute);
bufferD3D->promoteStaticUsage(count * typeSize);
}
}
diff --git a/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp b/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
index e74cba7..2d90461 100644
--- a/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
@@ -66,7 +66,10 @@
swapChainDesc.Flags = 0;
IDXGISwapChain1 *swapChain1 = nullptr;
HRESULT result = factory2->CreateSwapChainForHwnd(device, mWindow, &swapChainDesc, nullptr, nullptr, &swapChain1);
- *swapChain = static_cast<DXGISwapChain*>(swapChain1);
+ if (SUCCEEDED(result))
+ {
+ *swapChain = static_cast<DXGISwapChain*>(swapChain1);
+ }
SafeRelease(factory2);
return result;
}
diff --git a/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp b/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
index 80eaa09..03fb4c3 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
@@ -135,7 +135,7 @@
{
IDirect3DDevice9 *device = mRenderer->getDevice();
- D3DShaderType *shader;
+ D3DShaderType *shader = nullptr;
if (mCompiledShaders[source] != NULL)
{