diff --git a/3rdparty/stb_image/stb_image.c b/3rdparty/stb_image/stb_image.c index a3307b014..8bd036654 100644 --- a/3rdparty/stb_image/stb_image.c +++ b/3rdparty/stb_image/stb_image.c @@ -757,7 +757,7 @@ stbi_inline static uint8 get8u(stbi *s) static void skip(stbi *s, int n) { if (s->io.read) { - int blen = s->img_buffer_end - s->img_buffer; + int blen = (int)(s->img_buffer_end - s->img_buffer); if (blen < n) { s->img_buffer = s->img_buffer_end; (s->io.skip)(s->io_user_data, n - blen); @@ -770,7 +770,7 @@ static void skip(stbi *s, int n) static int getn(stbi *s, stbi_uc *buffer, int n) { if (s->io.read) { - int blen = s->img_buffer_end - s->img_buffer; + int blen = (int)(s->img_buffer_end - s->img_buffer); if (blen < n) { int res, count; diff --git a/examples/00-helloworld/helloworld.cpp b/examples/00-helloworld/helloworld.cpp index 447c5a12e..c210a341b 100644 --- a/examples/00-helloworld/helloworld.cpp +++ b/examples/00-helloworld/helloworld.cpp @@ -9,7 +9,7 @@ #include "../common/dbg.h" #include "../common/processevents.h" -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { uint32_t width = 1280; uint32_t height = 720; diff --git a/examples/01-cubes/cubes.cpp b/examples/01-cubes/cubes.cpp index 42d3a6424..f2bead5db 100644 --- a/examples/01-cubes/cubes.cpp +++ b/examples/01-cubes/cubes.cpp @@ -94,7 +94,7 @@ static const bgfx::Memory* loadShader(const char* _name) return load(filePath); } -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { uint32_t width = 1280; uint32_t height = 720; diff --git a/examples/02-metaballs/metaballs.cpp b/examples/02-metaballs/metaballs.cpp index 249b1b5a2..60dc8a942 100644 --- a/examples/02-metaballs/metaballs.cpp +++ b/examples/02-metaballs/metaballs.cpp @@ -494,7 +494,7 @@ uint32_t triangulate(uint8_t* _result, uint32_t _stride, const float* __restrict return num; } -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { uint32_t width = 1280; uint32_t height = 720; diff --git a/examples/03-raymarch/raymarch.cpp b/examples/03-raymarch/raymarch.cpp index 01f2bfe32..f558c4a47 100644 --- a/examples/03-raymarch/raymarch.cpp +++ b/examples/03-raymarch/raymarch.cpp @@ -173,7 +173,7 @@ void renderScreenSpaceQuad(uint32_t _view, bgfx::ProgramHandle _program, float _ } } -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { uint32_t width = 1280; uint32_t height = 720; diff --git a/examples/04-mesh/mesh.cpp b/examples/04-mesh/mesh.cpp index 3efdd63a0..37b77bd97 100644 --- a/examples/04-mesh/mesh.cpp +++ b/examples/04-mesh/mesh.cpp @@ -278,7 +278,7 @@ struct Mesh GroupArray m_groups; }; -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { uint32_t width = 1280; uint32_t height = 720; diff --git a/examples/05-instancing/instancing.cpp b/examples/05-instancing/instancing.cpp index 0da02eca8..379cafbe8 100644 --- a/examples/05-instancing/instancing.cpp +++ b/examples/05-instancing/instancing.cpp @@ -94,7 +94,7 @@ static const bgfx::Memory* loadShader(const char* _name) return load(filePath); } -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { uint32_t width = 1280; uint32_t height = 720; diff --git a/examples/06-bump/bump.cpp b/examples/06-bump/bump.cpp index c75e05ea2..1e5175f37 100644 --- a/examples/06-bump/bump.cpp +++ b/examples/06-bump/bump.cpp @@ -250,7 +250,7 @@ void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexDecl _decl delete [] tangents; } -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { uint32_t width = 1280; uint32_t height = 720; diff --git a/examples/07-callback/callback.cpp b/examples/07-callback/callback.cpp index b8e86a336..e74750f07 100644 --- a/examples/07-callback/callback.cpp +++ b/examples/07-callback/callback.cpp @@ -223,7 +223,7 @@ struct BgfxCallback : public bgfx::CallbackI saveTga(_filePath, _width, _height, _pitch, _data, false, _yflip); } - virtual void captureBegin(uint32_t _width, uint32_t _height, uint32_t _pitch, bgfx::TextureFormat::Enum /*_format*/, bool _yflip) BX_OVERRIDE + virtual void captureBegin(uint32_t _width, uint32_t _height, uint32_t /*_pitch*/, bgfx::TextureFormat::Enum /*_format*/, bool _yflip) BX_OVERRIDE { m_writer = new AviWriter; if (!m_writer->open("temp/capture.avi", _width, _height, 60, _yflip) ) @@ -254,7 +254,7 @@ struct BgfxCallback : public bgfx::CallbackI AviWriter* m_writer; }; -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { BgfxCallback callback; diff --git a/examples/08-update/update.cpp b/examples/08-update/update.cpp index d764307ad..c979bbd77 100644 --- a/examples/08-update/update.cpp +++ b/examples/08-update/update.cpp @@ -125,7 +125,7 @@ static const bgfx::Memory* loadShader(const char* _name) return load(filePath); } -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { uint32_t width = 1280; uint32_t height = 720; diff --git a/examples/09-hdr/hdr.cpp b/examples/09-hdr/hdr.cpp index a4b785ea2..134d8f7a2 100644 --- a/examples/09-hdr/hdr.cpp +++ b/examples/09-hdr/hdr.cpp @@ -403,7 +403,7 @@ inline float square(float _x) return _x*_x; } -int _main_(int _argc, char** _argv) +int _main_(int /*_argc*/, char** /*_argv*/) { PosColorTexCoord0Vertex::init(); diff --git a/examples/common/entry_windows.cpp b/examples/common/entry_windows.cpp index 08f9a5d4e..8f5a9ec2d 100644 --- a/examples/common/entry_windows.cpp +++ b/examples/common/entry_windows.cpp @@ -305,9 +305,6 @@ namespace entry default: { - unsigned int oldWidth = width; - unsigned int oldHeight = height; - float aspectRatio = m_aspectRatio; height = bx::uint32_max(DEFAULT_HEIGHT/4, height); width = uint32_t(float(height)*aspectRatio); diff --git a/src/glcontext_wgl.cpp b/src/glcontext_wgl.cpp index 787552673..0843a985d 100644 --- a/src/glcontext_wgl.cpp +++ b/src/glcontext_wgl.cpp @@ -69,7 +69,7 @@ namespace bgfx return context; } - void GlContext::create(uint32_t _width, uint32_t _height) + void GlContext::create(uint32_t /*_width*/, uint32_t /*_height*/) { m_opengl32dll = LoadLibrary("opengl32.dll"); BGFX_FATAL(NULL != m_opengl32dll, Fatal::UnableToInitialize, "Failed to load opengl32.dll."); @@ -200,6 +200,7 @@ namespace bgfx BGFX_FATAL(0 != result, Fatal::UnableToInitialize, "SetPixelFormat failed (last err: 0x%08x)!", GetLastError() ); uint32_t flags = BGFX_CONFIG_DEBUG ? WGL_CONTEXT_DEBUG_BIT_ARB : 0; + BX_UNUSED(flags); int32_t contextAttrs[] = { #if BGFX_CONFIG_RENDERER_OPENGL >= 31 @@ -252,7 +253,7 @@ namespace bgfx m_opengl32dll = NULL; } - void GlContext::resize(uint32_t _width, uint32_t _height) + void GlContext::resize(uint32_t /*_width*/, uint32_t /*_height*/) { } diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 68774abd8..c7eba64c5 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -213,7 +213,7 @@ namespace bgfx }, }; - static D3D11_INPUT_ELEMENT_DESC* fillVertexDecl(D3D11_INPUT_ELEMENT_DESC* _out, uint32_t _count, const VertexDecl& _decl) + static D3D11_INPUT_ELEMENT_DESC* fillVertexDecl(D3D11_INPUT_ELEMENT_DESC* _out, const VertexDecl& _decl) { D3D11_INPUT_ELEMENT_DESC* elem = _out; @@ -532,6 +532,7 @@ namespace bgfx void setRenderTarget(RenderTargetHandle _rt, bool _msaa = true) { + BX_UNUSED(_msaa); if (_rt.idx == invalidHandle) { m_deviceCtx->OMSetRenderTargets(1, &m_backBufferColor, m_backBufferDepthStencil); @@ -591,7 +592,7 @@ namespace bgfx decl.m_attributes[ii] = attr == 0 ? 0xff : attr == 0xff ? 0 : attr; } - D3D11_INPUT_ELEMENT_DESC* elem = fillVertexDecl(vertexElements, Attrib::Count, decl); + D3D11_INPUT_ELEMENT_DESC* elem = fillVertexDecl(vertexElements, decl); 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 }; @@ -1230,6 +1231,7 @@ namespace bgfx void ClearQuad::clear(const Rect& _rect, const Clear& _clear, uint32_t _height) { + BX_UNUSED(_height); uint32_t width = s_renderCtx.m_scd.BufferDesc.Width; uint32_t height = s_renderCtx.m_scd.BufferDesc.Height; diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 7023cd469..7c97b97e8 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -1043,7 +1043,7 @@ namespace bgfx }, }; - static D3DVERTEXELEMENT9* fillVertexDecl(D3DVERTEXELEMENT9* _out, uint32_t _count, const VertexDecl& _decl) + static D3DVERTEXELEMENT9* fillVertexDecl(D3DVERTEXELEMENT9* _out, const VertexDecl& _decl) { D3DVERTEXELEMENT9* elem = _out; @@ -1071,7 +1071,7 @@ namespace bgfx static IDirect3DVertexDeclaration9* createVertexDecl(const VertexDecl& _decl, uint8_t _numInstanceData) { D3DVERTEXELEMENT9 vertexElements[Attrib::Count+1+BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT]; - D3DVERTEXELEMENT9* elem = fillVertexDecl(vertexElements, Attrib::Count, _decl); + D3DVERTEXELEMENT9* elem = fillVertexDecl(vertexElements, _decl); const D3DVERTEXELEMENT9 inst = { 1, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }; @@ -2067,7 +2067,7 @@ namespace bgfx s_renderCtx.m_updateTexture->updateBegin(_side, _mip); } - void Context::rendererUpdateTexture(TextureHandle _handle, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, const Memory* _mem) + void Context::rendererUpdateTexture(TextureHandle /*_handle*/, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, const Memory* _mem) { s_renderCtx.m_updateTexture->update(_side, _mip, _rect, _z, _depth, _mem); } diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 9b084d1b3..0c8ca67e4 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -2334,7 +2334,7 @@ namespace bgfx s_renderCtx.m_textures[_handle.idx].create(_mem, _flags); } - void Context::rendererUpdateTextureBegin(TextureHandle _handle, uint8_t _side, uint8_t _mip) + void Context::rendererUpdateTextureBegin(TextureHandle /*_handle*/, uint8_t /*_side*/, uint8_t /*_mip*/) { } diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index 9a0a91ae2..8178da56c 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -1136,7 +1136,7 @@ struct Preprocessor thisClass->m_preprocessed += _ch; } - static void fppError(void* _userData, char* _format, va_list _vargs) + static void fppError(void* /*_userData*/, char* _format, va_list _vargs) { vfprintf(stderr, _format, _vargs); }