From 0490fbcd1ecb8bd78042d13a23e20e3d40ccb5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 30 Mar 2015 14:38:16 -0700 Subject: [PATCH] Fixed more variable shadowing warnings. --- examples/08-update/update.cpp | 3 +-- examples/12-lod/lod.cpp | 14 +++++++++----- examples/13-stencil/stencil.cpp | 4 ++-- examples/24-nbody/nbody.cpp | 8 +++----- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/examples/08-update/update.cpp b/examples/08-update/update.cpp index 4c021e23a..38486b9b3 100644 --- a/examples/08-update/update.cpp +++ b/examples/08-update/update.cpp @@ -292,8 +292,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) for (uint32_t ii = 0, num = bx::uint32_min(10, (uint32_t)quads.size() ); ii < num; ++ii) { - const PackCube& face = quads.front(); - cube.clear(face); + cube.clear(quads.front() ); quads.pop_front(); } } diff --git a/examples/12-lod/lod.cpp b/examples/12-lod/lod.cpp index a8bdf4dd8..7317c8488 100644 --- a/examples/12-lod/lod.cpp +++ b/examples/12-lod/lod.cpp @@ -20,7 +20,7 @@ KnightPos knightTour[8*4] = {0,0}, {1,2}, {3,3}, {4,1}, {5,3}, {7,2}, {6,0}, {5,2}, {7,3}, {6,1}, {4,0}, {3,2}, {2,0}, {0,1}, {1,3}, {2,1}, {0,2}, {1,0}, {2,2}, {0,3}, {1,1}, {3,0}, {4,2}, {5,0}, - {7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3} + {7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3}, }; int _main_(int /*_argc*/, char** /*_argv*/) @@ -55,15 +55,19 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::TextureHandle textureStipple; - const bgfx::Memory* stipple = bgfx::alloc(8*4); - memset(stipple->data, 0, stipple->size); + const bgfx::Memory* stippleTex = bgfx::alloc(8*4); + memset(stippleTex->data, 0, stippleTex->size); for (uint32_t ii = 0; ii < 32; ++ii) { - stipple->data[knightTour[ii].m_y * 8 + knightTour[ii].m_x] = ii*4; + stippleTex->data[knightTour[ii].m_y * 8 + knightTour[ii].m_x] = ii*4; } - textureStipple = bgfx::createTexture2D(8, 4, 1, bgfx::TextureFormat::R8, BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIN_POINT, stipple); + textureStipple = bgfx::createTexture2D(8, 4, 1 + , bgfx::TextureFormat::R8 + , BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIN_POINT + , stippleTex + ); Mesh* meshTop[3] = { diff --git a/examples/13-stencil/stencil.cpp b/examples/13-stencil/stencil.cpp index f79b0e569..3b869b5c5 100644 --- a/examples/13-stencil/stencil.cpp +++ b/examples/13-stencil/stencil.cpp @@ -1319,10 +1319,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) ); // Cubes. - for (uint8_t ii = 0; ii < numCubes; ++ii) + for (uint8_t jj = 0; jj < numCubes; ++jj) { cubeMesh.submit(viewId - , cubeMtx[ii] + , cubeMtx[jj] , programTextureLightning , s_renderStates[RenderState::ProjectionShadows_DrawDiffuse] , figureTex diff --git a/examples/24-nbody/nbody.cpp b/examples/24-nbody/nbody.cpp index 36a98e978..047618fe6 100644 --- a/examples/24-nbody/nbody.cpp +++ b/examples/24-nbody/nbody.cpp @@ -209,7 +209,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) imguiSlider("Random seed", u_paramsData.baseSeed, 0, 100); int32_t shape = imguiChoose(u_paramsData.initialShape, "Point", "Sphere", "Box", "Donut"); imguiSlider("Initial speed", u_paramsData.initialSpeed, 0.0f, 300.0f, 0.1f); - bool reset = imguiButton("Reset"); + bool defaults = imguiButton("Reset"); imguiSeparatorLine(); imguiSlider("Particle count (x512)", u_paramsData.dispatchSize, 1, 64); imguiSlider("Gravity", u_paramsData.gravity, 0.0f, 0.3f, 0.001f); @@ -226,11 +226,11 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Modify parameters and reset if shape is changed if (shape != u_paramsData.initialShape) { - reset = true; + defaults = true; InitializeParams(shape, &u_paramsData); } - if (reset) + if (defaults) { bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write); bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write); @@ -248,8 +248,6 @@ int _main_(int /*_argc*/, char** /*_argv*/) bx::xchg(currPositionBuffer0, currPositionBuffer1); bx::xchg(prevPositionBuffer0, prevPositionBuffer1); - float view[16]; - // Update camera. cameraUpdate(deltaTime, mouseState); cameraGetViewMtx(view);