Browse Source

Fixed L4 warnings.

bkaradzic 12 years ago
parent
commit
6582276e3e

+ 2 - 2
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;
 

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 2
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;
 

+ 1 - 1
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;

+ 1 - 1
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();
 

+ 0 - 3
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);

+ 3 - 2
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*/)
 	{
 	}
 

+ 4 - 2
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;
 

+ 3 - 3
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);
 	}

+ 1 - 1
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*/)
 	{
 	}
 

+ 1 - 1
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);
 	}