From 0ba8b1895b96f4482aa7fabed1d60f93f7462558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 2 Sep 2016 19:49:01 -0700 Subject: [PATCH] Cleanup. --- 3rdparty/dxsdk/include/d3dcompiler.h | 8 ++++---- examples/common/entry/entry_windows.cpp | 4 ++-- src/renderer_d3d12.cpp | 14 +++++++------- src/renderer_d3d9.cpp | 12 ++++++------ src/shader_dxbc.cpp | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/3rdparty/dxsdk/include/d3dcompiler.h b/3rdparty/dxsdk/include/d3dcompiler.h index c13f964a1..a4ca79130 100644 --- a/3rdparty/dxsdk/include/d3dcompiler.h +++ b/3rdparty/dxsdk/include/d3dcompiler.h @@ -303,9 +303,9 @@ D3DReflect(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData, HRESULT WINAPI D3DReflectLibrary(__in_bcount(SrcDataSize) LPCVOID pSrcData, - __in SIZE_T SrcDataSize, - __in REFIID riid, - __out LPVOID * ppReflector); + SIZE_T SrcDataSize, + REFIID riid, + LPVOID * ppReflector); //---------------------------------------------------------------------------- // D3DDisassemble: @@ -350,7 +350,7 @@ D3DDisassembleRegion(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData, // Shader linking and Function Linking Graph (FLG) APIs //---------------------------------------------------------------------------- HRESULT WINAPI -D3DCreateLinker(__out interface ID3D11Linker ** ppLinker); +D3DCreateLinker(interface ID3D11Linker ** ppLinker); HRESULT WINAPI D3DLoadModule(_In_ LPCVOID pSrcData, diff --git a/examples/common/entry/entry_windows.cpp b/examples/common/entry/entry_windows.cpp index 419789fa1..29f8c65e8 100644 --- a/examples/common/entry/entry_windows.cpp +++ b/examples/common/entry/entry_windows.cpp @@ -446,13 +446,13 @@ namespace entry int32_t run(int _argc, char** _argv) { - SetDllDirectory("."); + SetDllDirectoryA("."); s_xinput.init(); HINSTANCE instance = (HINSTANCE)GetModuleHandle(NULL); - WNDCLASSEX wnd; + WNDCLASSEXA wnd; memset(&wnd, 0, sizeof(wnd) ); wnd.cbSize = sizeof(wnd); wnd.style = CS_HREDRAW | CS_VREDRAW; diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 08773c597..f66e735e3 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -3846,23 +3846,23 @@ data.NumQualityLevels = 0; { for (uint32_t ii = 0; ii < count; ++ii) { - uint8_t nameSize; + uint8_t nameSize = 0; bx::read(&reader, nameSize); - char name[256]; + char name[256] = {}; bx::read(&reader, &name, nameSize); name[nameSize] = '\0'; - uint8_t type; + uint8_t type = 0; bx::read(&reader, type); - uint8_t num; + uint8_t num = 0; bx::read(&reader, num); - uint16_t regIndex; + uint16_t regIndex = 0; bx::read(&reader, regIndex); - uint16_t regCount; + uint16_t regCount = 0; bx::read(&reader, regCount); const char* kind = "invalid"; @@ -3922,7 +3922,7 @@ data.NumQualityLevels = 0; m_code = copy(code, shaderSize); - uint8_t numAttrs; + uint8_t numAttrs = 0; bx::read(&reader, numAttrs); memset(m_attrMask, 0, sizeof(m_attrMask) ); diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 4e26004b3..be388785a 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -2393,23 +2393,23 @@ namespace bgfx { namespace d3d9 { for (uint32_t ii = 0; ii < count; ++ii) { - uint8_t nameSize; + uint8_t nameSize = 0; bx::read(&reader, nameSize); - char name[256]; + char name[256] = {}; bx::read(&reader, &name, nameSize); name[nameSize] = '\0'; - uint8_t type; + uint8_t type = 0; bx::read(&reader, type); - uint8_t num; + uint8_t num = 0; bx::read(&reader, num); - uint16_t regIndex; + uint16_t regIndex = 0; bx::read(&reader, regIndex); - uint16_t regCount; + uint16_t regCount = 0; bx::read(&reader, regCount); const char* kind = "invalid"; diff --git a/src/shader_dxbc.cpp b/src/shader_dxbc.cpp index 1cc948d31..0ad82cc61 100644 --- a/src/shader_dxbc.cpp +++ b/src/shader_dxbc.cpp @@ -1000,7 +1000,7 @@ namespace bgfx break; } - for (uint32_t ii = 0; ii < _operand.numAddrModes; ++ii) + for (uint32_t ii = 0, num = bx::uint32_min(_operand.numAddrModes, BX_COUNTOF(_operand.addrMode) ); ii < num; ++ii) { switch (_operand.addrMode[ii]) { @@ -1526,7 +1526,7 @@ namespace bgfx ); } - for (uint32_t jj = first; jj < operand.numAddrModes; ++jj) + for (uint32_t jj = first, num = bx::uint32_min(operand.numAddrModes, BX_COUNTOF(operand.addrMode) ); jj < num; ++jj) { switch (operand.addrMode[jj]) {