From 6cb953af14802c3806222c97969a261a10ae7672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 20 Jan 2015 00:04:30 -0800 Subject: [PATCH 1/2] Rename bx::swap to bx::xchg. --- examples/24-nbody/nbody.cpp | 4 ++-- src/renderer_d3d11.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/24-nbody/nbody.cpp b/examples/24-nbody/nbody.cpp index ced3e0c88..62186f745 100644 --- a/examples/24-nbody/nbody.cpp +++ b/examples/24-nbody/nbody.cpp @@ -246,8 +246,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::setUniform(u_params, &u_paramsData, 3); bgfx::dispatch(0, updateInstancesProgram, u_paramsData.dispatchSize, 1, 1); - bx::swap(currPositionBuffer0, currPositionBuffer1); - bx::swap(prevPositionBuffer0, prevPositionBuffer1); + bx::xchg(currPositionBuffer0, currPositionBuffer1); + bx::xchg(prevPositionBuffer0, prevPositionBuffer1); float view[16]; diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 7e3d9c054..82a2bafa1 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1852,10 +1852,10 @@ namespace bgfx texture.D3D11.pSRView = m_ovrRT.m_srv; m_ovr.postReset(texture.Texture); - bx::swap(m_ovrRtv, m_backBufferColor); + bx::xchg(m_ovrRtv, m_backBufferColor); BX_CHECK(NULL == m_backBufferDepthStencil, ""); - bx::swap(m_ovrDsv, m_backBufferDepthStencil); + bx::xchg(m_ovrDsv, m_backBufferDepthStencil); } } #endif // BGFX_CONFIG_USE_OVR @@ -1867,8 +1867,8 @@ namespace bgfx m_ovr.preReset(); if (NULL != m_ovrRtv) { - bx::swap(m_ovrRtv, m_backBufferColor); - bx::swap(m_ovrDsv, m_backBufferDepthStencil); + bx::xchg(m_ovrRtv, m_backBufferColor); + bx::xchg(m_ovrDsv, m_backBufferDepthStencil); BX_CHECK(NULL == m_backBufferDepthStencil, ""); DX_RELEASE(m_ovrRtv, 0); From 93eeca2117541829ab352ac0997d54564a3e8a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 20 Jan 2015 13:17:10 -0800 Subject: [PATCH 2/2] Fixed C4127: conditional expression is constant. --- 3rdparty/ocornut-imgui/imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/ocornut-imgui/imgui.cpp index 6f6140387..4c40726f7 100644 --- a/3rdparty/ocornut-imgui/imgui.cpp +++ b/3rdparty/ocornut-imgui/imgui.cpp @@ -1851,7 +1851,7 @@ static void LogText(const ImVec2& ref_pos, const char* text, const char* text_en if (g.LogStartDepth > window->DC.TreeDepth) // Re-adjust padding if we have popped out of our starting depth g.LogStartDepth = window->DC.TreeDepth; const int tree_depth = (window->DC.TreeDepth - g.LogStartDepth); - while (true) + for (;;) { // Split the string. Each new line (after a '\n') is followed by spacing corresponding to the current depth of our log entry. const char* line_end = text_remaining; @@ -7724,7 +7724,7 @@ struct ExampleAppConsole { // Multiple matches. Complete as much as we can, so inputing "C" will complete to "CL" and display "CLEAR" and "CLASSIFY" int match_len = (int)(word_end - word_start); - while (true) + for (;;) { int c = 0; bool all_candidates_matches = true;