From 295059564e92e1dc45aea99506713170f1d3f68e Mon Sep 17 00:00:00 2001 From: Garett Bass Date: Tue, 26 Feb 2013 18:54:03 -0800 Subject: [PATCH] Fix MSVC warnings renderer_d3d11.cpp(615): warning C4389: '==' : signed/unsigned mismatch renderer_d3d11.cpp(1100): warning C4189: 'deviceCtx' : local variable is initialized but not referenced --- src/renderer_d3d11.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 6a87a6e09..6ebcac063 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -592,7 +592,7 @@ namespace bgfx } D3D11_INPUT_ELEMENT_DESC* elem = fillVertexDecl(vertexElements, Attrib::Count, decl); - ptrdiff_t num = elem-vertexElements; + uint32_t num = uint32_t(elem-vertexElements); const D3D11_INPUT_ELEMENT_DESC inst = { "TEXCOORD", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_INSTANCE_DATA, 1 }; @@ -602,7 +602,7 @@ namespace bgfx uint32_t jj; D3D11_INPUT_ELEMENT_DESC* curr; - for (jj = 0; jj < (uint32_t)num; ++jj) + for (jj = 0; jj < num; ++jj) { curr = &vertexElements[jj]; if (0 == strcmp(curr->SemanticName, "TEXCOORD") @@ -624,9 +624,9 @@ namespace bgfx curr->AlignedByteOffset = ii*16; } - num = elem-vertexElements; + num = uint32_t(elem-vertexElements); DX_CHECK(m_device->CreateInputLayout(vertexElements - , uint32_t(num) + , num , _program.m_vsh->m_code->data , _program.m_vsh->m_code->size , &layout @@ -1097,8 +1097,6 @@ namespace bgfx void ConstantBuffer::commit() { - ID3D11DeviceContext* deviceCtx = s_renderCtx.m_deviceCtx; - reset(); do