From 3167531b39058826fadac38d97002a8dbb173b65 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 21 Sep 2013 00:10:10 +0200 Subject: [PATCH] Fixed some VS warnings Thanks to Fraggy again ! Former-commit-id: bd0eea66714701b065892d8b69d576e7b3615dd2 --- include/Nazara/Core/Thread.hpp | 2 +- src/Nazara/Audio/Loaders/sndfile/Loader.cpp | 8 ++-- src/Nazara/Core/File.cpp | 2 +- src/Nazara/Core/Hash/MD5.cpp | 2 +- src/Nazara/Core/Thread.cpp | 2 +- src/Nazara/Graphics/Camera.cpp | 8 ++-- src/Nazara/Graphics/Loaders/OBJ/MTLParser.cpp | 6 +-- src/Nazara/Graphics/View.cpp | 8 ++-- src/Nazara/Lua/LuaInstance.cpp | 46 +++++++++---------- src/Nazara/Noise/Perlin2D.cpp | 13 +++++- src/Nazara/Noise/Simplex3D.cpp | 19 ++++++-- src/Nazara/Noise/Simplex4D.cpp | 18 ++++---- src/Nazara/Renderer/ShaderProgram.cpp | 2 +- src/Nazara/Renderer/ShaderProgramManager.cpp | 2 +- src/Nazara/Renderer/Win32/ContextImpl.cpp | 6 +-- src/Nazara/Utility/Image.cpp | 6 +-- src/Nazara/Utility/Loaders/PCX/Loader.cpp | 2 +- src/Nazara/Utility/PixelFormat.cpp | 8 ++-- src/Nazara/Utility/Win32/WindowImpl.cpp | 8 ++-- 19 files changed, 95 insertions(+), 73 deletions(-) diff --git a/include/Nazara/Core/Thread.hpp b/include/Nazara/Core/Thread.hpp index 5ec68a0fc..f5c6f37fa 100644 --- a/include/Nazara/Core/Thread.hpp +++ b/include/Nazara/Core/Thread.hpp @@ -54,7 +54,7 @@ class NAZARA_API NzThread::Id NAZARA_API friend bool operator>(const Id& lhs, const Id& rhs); NAZARA_API friend bool operator>=(const Id& lhs, const Id& rhs); - NAZARA_API friend bool operator<<(std::ostream& o, const Id& id); + NAZARA_API friend std::ostream& operator<<(std::ostream& o, const Id& id); private: Id(NzThreadImpl* thread); diff --git a/src/Nazara/Audio/Loaders/sndfile/Loader.cpp b/src/Nazara/Audio/Loaders/sndfile/Loader.cpp index bb8a0f473..b1b0a5e31 100644 --- a/src/Nazara/Audio/Loaders/sndfile/Loader.cpp +++ b/src/Nazara/Audio/Loaders/sndfile/Loader.cpp @@ -26,7 +26,7 @@ namespace sf_count_t Read(void* ptr, sf_count_t count, void* user_data) { NzInputStream* stream = static_cast(user_data); - return stream->Read(ptr, count); + return static_cast(stream->Read(ptr, static_cast(count))); } sf_count_t Seek(sf_count_t offset, int whence, void* user_data) @@ -35,7 +35,7 @@ namespace switch (whence) { case SEEK_CUR: - stream->Read(nullptr, offset); + stream->Read(nullptr, static_cast(offset)); break; case SEEK_END: @@ -113,7 +113,7 @@ namespace if (infos.format & SF_FORMAT_VORBIS) sf_command(file, SFC_SET_SCALE_FLOAT_INT_READ, nullptr, SF_TRUE); - unsigned int sampleCount = infos.frames*infos.channels; + sf_count_t sampleCount = infos.frames*infos.channels; std::unique_ptr samples(new nzInt16[sampleCount]); if (sf_read_short(file, samples.get(), sampleCount) != sampleCount) @@ -124,7 +124,7 @@ namespace return false; } - if (!soundBuffer->Create(format, infos.frames*infos.channels, infos.samplerate, samples.get())) + if (!soundBuffer->Create(format, static_cast(sampleCount), infos.samplerate, samples.get())) { sf_close(file); NazaraError("Failed to create sound buffer"); diff --git a/src/Nazara/Core/File.cpp b/src/Nazara/Core/File.cpp index 3ee6b11d9..3e898e6d3 100644 --- a/src/Nazara/Core/File.cpp +++ b/src/Nazara/Core/File.cpp @@ -237,7 +237,7 @@ std::size_t NzFile::Read(void* buffer, std::size_t size) m_impl->SetCursorPos(NzFile::AtCurrent, size); - return m_impl->GetCursorPos()-currentPos; + return static_cast(m_impl->GetCursorPos()-currentPos); } } diff --git a/src/Nazara/Core/Hash/MD5.cpp b/src/Nazara/Core/Hash/MD5.cpp index 6b8b8753e..f291c0b57 100644 --- a/src/Nazara/Core/Hash/MD5.cpp +++ b/src/Nazara/Core/Hash/MD5.cpp @@ -136,7 +136,7 @@ namespace * On little-endian machines, we can process properly aligned * data without copying it. */ - if (!(data - static_cast(nullptr)) & 3) + if (!((data - static_cast(nullptr)) & 3)) { /* data are properly aligned */ X = reinterpret_cast(data); diff --git a/src/Nazara/Core/Thread.cpp b/src/Nazara/Core/Thread.cpp index 3d9230d83..72881ed66 100644 --- a/src/Nazara/Core/Thread.cpp +++ b/src/Nazara/Core/Thread.cpp @@ -135,7 +135,7 @@ bool operator>=(const NzThread::Id& lhs, const NzThread::Id& rhs) return lhs.m_id >= rhs.m_id; } -bool operator<<(std::ostream& o, const NzThread::Id& id) +std::ostream& operator<<(std::ostream& o, const NzThread::Id& id) { o << id.m_id; return o; diff --git a/src/Nazara/Graphics/Camera.cpp b/src/Nazara/Graphics/Camera.cpp index 46a39a153..3b39e1006 100644 --- a/src/Nazara/Graphics/Camera.cpp +++ b/src/Nazara/Graphics/Camera.cpp @@ -306,9 +306,9 @@ void NzCamera::UpdateViewport() const m_projectionMatrixUpdated = false; } - m_viewport.x = width * m_targetRegion.x; - m_viewport.y = height * m_targetRegion.y; - m_viewport.width = vWidth; - m_viewport.height = vHeight; + m_viewport.x = static_cast(width * m_targetRegion.x); + m_viewport.y = static_cast(height * m_targetRegion.y); + m_viewport.width = static_cast(vWidth); + m_viewport.height = static_cast(vHeight); m_viewportUpdated = true; } diff --git a/src/Nazara/Graphics/Loaders/OBJ/MTLParser.cpp b/src/Nazara/Graphics/Loaders/OBJ/MTLParser.cpp index b05008df6..48ac75767 100644 --- a/src/Nazara/Graphics/Loaders/OBJ/MTLParser.cpp +++ b/src/Nazara/Graphics/Loaders/OBJ/MTLParser.cpp @@ -52,7 +52,7 @@ bool NzMTLParser::Parse() if (!currentMaterial) currentMaterial = &m_materials["default"]; - currentMaterial->ambient = NzColor(r*255.f, g*255.f, b*255.f); + currentMaterial->ambient = NzColor(static_cast(r*255.f), static_cast(g*255.f), static_cast(b*255.f)); } #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING else @@ -67,7 +67,7 @@ bool NzMTLParser::Parse() if (!currentMaterial) currentMaterial = &m_materials["default"]; - currentMaterial->diffuse = NzColor(r*255.f, g*255.f, b*255.f); + currentMaterial->diffuse = NzColor(static_cast(r*255.f), static_cast(g*255.f), static_cast(b*255.f)); } #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING else @@ -82,7 +82,7 @@ bool NzMTLParser::Parse() if (!currentMaterial) currentMaterial = &m_materials["default"]; - currentMaterial->specular = NzColor(r*255.f, g*255.f, b*255.f); + currentMaterial->specular = NzColor(static_cast(r*255.f), static_cast(g*255.f), static_cast(b*255.f)); } #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING else diff --git a/src/Nazara/Graphics/View.cpp b/src/Nazara/Graphics/View.cpp index 1e1181094..687834b05 100644 --- a/src/Nazara/Graphics/View.cpp +++ b/src/Nazara/Graphics/View.cpp @@ -277,9 +277,9 @@ void NzView::UpdateViewport() const unsigned int width = m_target->GetWidth(); unsigned int height = std::max(m_target->GetHeight(), 1U); - m_viewport.x = width * m_targetRegion.x; - m_viewport.y = height * m_targetRegion.y; - m_viewport.width = width * m_targetRegion.width; - m_viewport.height = height * m_targetRegion.height; + m_viewport.x = static_cast(width * m_targetRegion.x); + m_viewport.y = static_cast(height * m_targetRegion.y); + m_viewport.width = static_cast(width * m_targetRegion.width); + m_viewport.height = static_cast(height * m_targetRegion.height); m_viewportUpdated = true; } diff --git a/src/Nazara/Lua/LuaInstance.cpp b/src/Nazara/Lua/LuaInstance.cpp index c3146dfa1..e051a6591 100644 --- a/src/Nazara/Lua/LuaInstance.cpp +++ b/src/Nazara/Lua/LuaInstance.cpp @@ -180,7 +180,7 @@ bool NzLuaInstance::Compare(int index1, int index2, nzLuaComparison comparison) } #endif - return lua_compare(m_state, index1, index2, s_comparisons[comparison]); + return (lua_compare(m_state, index1, index2, s_comparisons[comparison]) == 1); } void NzLuaInstance::Compute(nzLuaOperation operation) @@ -236,7 +236,7 @@ bool NzLuaInstance::ExecuteFromFile(const NzString& filePath) return false; } - unsigned int length = file.GetSize(); + unsigned int length = static_cast(file.GetSize()); NzString source; source.Resize(length); @@ -331,7 +331,7 @@ void NzLuaInstance::GetMetatable(const NzString& tname) const bool NzLuaInstance::GetMetatable(int index) const { - return lua_getmetatable(m_state, index); + return lua_getmetatable(m_state, index) == 1; } unsigned int NzLuaInstance::GetStackTop() const @@ -411,34 +411,34 @@ bool NzLuaInstance::IsOfType(int index, nzLuaType type) const switch (type) { case nzLuaType_Boolean: - return lua_isboolean(m_state, index); + return lua_isboolean(m_state, index) == 1; case nzLuaType_Function: - return lua_isfunction(m_state, index); + return lua_isfunction(m_state, index) == 1; case nzLuaType_LightUserdata: - return lua_islightuserdata(m_state, index); + return lua_islightuserdata(m_state, index) == 1; case nzLuaType_Nil: - return lua_isnil(m_state, index); + return lua_isnil(m_state, index) == 1; case nzLuaType_None: - return lua_isnone(m_state, index); + return lua_isnone(m_state, index) == 1; case nzLuaType_Number: - return lua_isnumber(m_state, index); + return lua_isnumber(m_state, index) == 1; case nzLuaType_String: - return lua_isstring(m_state, index); + return lua_isstring(m_state, index) == 1; case nzLuaType_Table: - return lua_istable(m_state, index); + return lua_istable(m_state, index) == 1; case nzLuaType_Thread: - return lua_isthread(m_state, index); + return lua_isthread(m_state, index) == 1; case nzLuaType_Userdata: - return lua_isuserdata(m_state, index); + return lua_isuserdata(m_state, index) == 1; } NazaraError("Lua type unhandled (0x" + NzString::Number(type, 16) + ')'); @@ -473,7 +473,7 @@ void NzLuaInstance::MoveTo(NzLuaInstance* instance, int n) bool NzLuaInstance::NewMetatable(const char* str) { - return luaL_newmetatable(m_state, str); + return luaL_newmetatable(m_state, str) == 1; } bool NzLuaInstance::NewMetatable(const NzString& str) @@ -483,12 +483,12 @@ bool NzLuaInstance::NewMetatable(const NzString& str) bool NzLuaInstance::Next(int index) { - return lua_next(m_state, index); + return lua_next(m_state, index) == 1; } void NzLuaInstance::Pop(unsigned int n) { - lua_pop(m_state, n); + lua_pop(m_state, static_cast(n)); } void NzLuaInstance::PushBoolean(bool value) @@ -639,7 +639,7 @@ void NzLuaInstance::SetTimeLimit(nzUInt32 timeLimit) bool NzLuaInstance::ToBoolean(int index) const { - return lua_toboolean(m_state, index); + return lua_toboolean(m_state, index) == 1; } int NzLuaInstance::ToInteger(int index, bool* succeeded) const @@ -648,9 +648,9 @@ int NzLuaInstance::ToInteger(int index, bool* succeeded) const int result = lua_tointegerx(m_state, index, &success); if (succeeded) - *succeeded = success; + *succeeded = (success == 1); - return result; + return result == 1; } double NzLuaInstance::ToNumber(int index, bool* succeeded) const @@ -659,9 +659,9 @@ double NzLuaInstance::ToNumber(int index, bool* succeeded) const double result = lua_tonumberx(m_state, index, &success); if (succeeded) - *succeeded = success; + *succeeded = (success == 1); - return result; + return result == 1; } const char* NzLuaInstance::ToString(int index, std::size_t* length) const @@ -675,9 +675,9 @@ unsigned int NzLuaInstance::ToUnsigned(int index, bool* succeeded) const unsigned int result = lua_tounsignedx(m_state, index, &success); if (succeeded) - *succeeded = success; + *succeeded = (success == 1); - return result; + return result == 1; } void* NzLuaInstance::ToUserdata(int index) const diff --git a/src/Nazara/Noise/Perlin2D.cpp b/src/Nazara/Noise/Perlin2D.cpp index 87a778f7b..ae5d5960b 100644 --- a/src/Nazara/Noise/Perlin2D.cpp +++ b/src/Nazara/Noise/Perlin2D.cpp @@ -9,8 +9,17 @@ NzPerlin2D::NzPerlin2D() { - int grad2Temp[][2] = {{1,1},{-1,1},{1,-1},{-1,-1}, - {1,0},{-1,0},{0,1},{0,-1}}; + float grad2Temp[][2] = { + {1.f,1.f}, + {-1.f,1.f}, + {1.f,-1.f}, + {-1.f,-1.f}, + + {1.f,0.f}, + {-1.f,0.f}, + {0.f,1.f}, + {0.f,-1.f} + }; for(int i(0) ; i < 8 ; ++i) for(int j(0) ; j < 2 ; ++j) diff --git a/src/Nazara/Noise/Simplex3D.cpp b/src/Nazara/Noise/Simplex3D.cpp index cf8d45fa0..7bc340fa9 100644 --- a/src/Nazara/Noise/Simplex3D.cpp +++ b/src/Nazara/Noise/Simplex3D.cpp @@ -12,9 +12,22 @@ NzSimplex3D::NzSimplex3D() SkewCoeff3D = 1/3.f; UnskewCoeff3D = 1/6.f; - int grad3Temp[][3] = {{1,1,0},{-1,1,0},{1,-1,0},{-1,-1,0}, - {1,0,1},{-1,0,1},{1,0,-1},{-1,0,-1}, - {0,1,1},{0,-1,1},{0,1,-1},{0,-1,-1}}; + float grad3Temp[][3] = { + {1.f,1.f,0.f}, + {-1.f,1.f,0.f}, + {1.f,-1.f,0.f}, + {-1.f,-1.f,0.f}, + + {1.f,0.f,1.f}, + {-1.f,0.f,1.f}, + {1.f,0.f,-1.f}, + {-1.f,0.f,-1.f}, + + {0.f,1.f,1.f}, + {0.f,-1.f,1.f}, + {0.f,1.f,-1.f}, + {0.f,-1.f,-1.f} + }; for(int i(0) ; i < 12 ; ++i) for(int j(0) ; j < 3 ; ++j) diff --git a/src/Nazara/Noise/Simplex4D.cpp b/src/Nazara/Noise/Simplex4D.cpp index 7da60ef1c..d6d0e62d0 100644 --- a/src/Nazara/Noise/Simplex4D.cpp +++ b/src/Nazara/Noise/Simplex4D.cpp @@ -28,16 +28,16 @@ NzSimplex4D::NzSimplex4D() for(int j(0) ; j < 4 ; ++j) lookupTable4D[i][j] = lookupTemp4D[i][j]; - int grad4Temp[][4] = + float grad4Temp[][4] = { - {0,1,1,1}, {0,1,1,-1}, {0,1,-1,1}, {0,1,-1,-1}, - {0,-1,1,1},{0,-1,1,-1},{0,-1,-1,1},{0,-1,-1,-1}, - {1,0,1,1}, {1,0,1,-1}, {1,0,-1,1}, {1,0,-1,-1}, - {-1,0,1,1},{-1,0,1,-1},{-1,0,-1,1},{-1,0,-1,-1}, - {1,1,0,1}, {1,1,0,-1}, {1,-1,0,1}, {1,-1,0,-1}, - {-1,1,0,1},{-1,1,0,-1},{-1,-1,0,1},{-1,-1,0,-1}, - {1,1,1,0}, {1,1,-1,0}, {1,-1,1,0}, {1,-1,-1,0}, - {-1,1,1,0},{-1,1,-1,0},{-1,-1,1,0},{-1,-1,-1,0} + {0.f,1.f,1.f,1.f}, {0.f,1.f,1.f,-1.f}, {0.f,1.f,-1.f,1.f}, {0.f,1.f,-1.f,-1.f}, + {0.f,-1.f,1.f,1.f},{0.f,-1.f,1.f,-1.f},{0.f,-1.f,-1.f,1.f},{0.f,-1.f,-1.f,-1.f}, + {1.f,0.f,1.f,1.f}, {1.f,0.f,1.f,-1.f}, {1.f,0.f,-1.f,1.f}, {1.f,0.f,-1.f,-1.f}, + {-1.f,0.f,1.f,1.f},{-1.f,0.f,1.f,-1.f},{-1.f,0.f,-1.f,1.f},{-1.f,0.f,-1.f,-1.f}, + {1.f,1.f,0.f,1.f}, {1.f,1.f,0.f,-1.f}, {1.f,-1.f,0.f,1.f}, {1.f,-1.f,0.f,-1.f}, + {-1.f,1.f,0.f,1.f},{-1.f,1.f,0.f,-1.f},{-1.f,-1.f,0.f,1.f},{-1.f,-1.f,0.f,-1.f}, + {1.f,1.f,1.f,0.f}, {1.f,1.f,-1.f,0.f}, {1.f,-1.f,1.f,0.f}, {1.f,-1.f,-1.f,0.f}, + {-1.f,1.f,1.f,0.f},{-1.f,1.f,-1.f,0.f},{-1.f,-1.f,1.f,0.f},{-1.f,-1.f,-1.f,0.f} }; for(int i(0) ; i < 32 ; ++i) diff --git a/src/Nazara/Renderer/ShaderProgram.cpp b/src/Nazara/Renderer/ShaderProgram.cpp index c33fedfe5..f550df3ee 100644 --- a/src/Nazara/Renderer/ShaderProgram.cpp +++ b/src/Nazara/Renderer/ShaderProgram.cpp @@ -398,7 +398,7 @@ bool NzShaderProgram::LoadShaderFromFile(nzShaderType type, const NzString& file return false; } - unsigned int length = file.GetSize(); + unsigned int length = static_cast(file.GetSize()); NzString source; source.Resize(length); diff --git a/src/Nazara/Renderer/ShaderProgramManager.cpp b/src/Nazara/Renderer/ShaderProgramManager.cpp index 340e66522..33c95cac4 100644 --- a/src/Nazara/Renderer/ShaderProgramManager.cpp +++ b/src/Nazara/Renderer/ShaderProgramManager.cpp @@ -110,7 +110,7 @@ const NzShaderProgram* NzShaderProgramManager::Get(const NzShaderProgramManagerP { NazaraDebug("File found"); - unsigned int size = shaderFile.GetSize(); + unsigned int size = static_cast(shaderFile.GetSize()); NzByteArray binary; binary.Resize(size); diff --git a/src/Nazara/Renderer/Win32/ContextImpl.cpp b/src/Nazara/Renderer/Win32/ContextImpl.cpp index 7f96035ae..7d1df88d3 100644 --- a/src/Nazara/Renderer/Win32/ContextImpl.cpp +++ b/src/Nazara/Renderer/Win32/ContextImpl.cpp @@ -19,7 +19,7 @@ NzContextImpl::NzContextImpl() bool NzContextImpl::Activate() { - return wglMakeCurrent(m_deviceContext, m_context); + return wglMakeCurrent(m_deviceContext, m_context) == TRUE; } bool NzContextImpl::Create(NzContextParameters& parameters) @@ -74,7 +74,7 @@ bool NzContextImpl::Create(NzContextParameters& parameters) do { - valid = wglChoosePixelFormat(m_deviceContext, attributes, nullptr, 1, &pixelFormat, &numFormats); + valid = (wglChoosePixelFormat(m_deviceContext, attributes, nullptr, 1, &pixelFormat, &numFormats) == TRUE); } while ((!valid || numFormats == 0) && --attributes[19] > 0); @@ -229,6 +229,6 @@ void NzContextImpl::SwapBuffers() bool NzContextImpl::Desactivate() { - return wglMakeCurrent(nullptr, nullptr); + return wglMakeCurrent(nullptr, nullptr) == TRUE; } diff --git a/src/Nazara/Utility/Image.cpp b/src/Nazara/Utility/Image.cpp index 0d014e945..f9ea083f4 100644 --- a/src/Nazara/Utility/Image.cpp +++ b/src/Nazara/Utility/Image.cpp @@ -1279,9 +1279,9 @@ nzUInt8 NzImage::GetMaxLevel(unsigned int width, unsigned int height, unsigned i { static const float invLog2 = 1.f/std::log(2.f); - unsigned int widthLevel = invLog2 * std::log(static_cast(width)); - unsigned int heightLevel = invLog2 * std::log(static_cast(height)); - unsigned int depthLevel = invLog2 * std::log(static_cast(depth)); + unsigned int widthLevel = static_cast(invLog2 * std::log(static_cast(width))); + unsigned int heightLevel = static_cast(invLog2 * std::log(static_cast(height))); + unsigned int depthLevel = static_cast(invLog2 * std::log(static_cast(depth))); return std::max(std::max(std::max(widthLevel, heightLevel), depthLevel), 1U); } diff --git a/src/Nazara/Utility/Loaders/PCX/Loader.cpp b/src/Nazara/Utility/Loaders/PCX/Loader.cpp index 79fdbd3ca..8f9c0ccd6 100644 --- a/src/Nazara/Utility/Loaders/PCX/Loader.cpp +++ b/src/Nazara/Utility/Loaders/PCX/Loader.cpp @@ -217,7 +217,7 @@ namespace nzUInt8 palette[768]; /* the palette is contained in the last 769 bytes of the file */ - unsigned int curPos = stream.GetCursorPos(); + nzUInt64 curPos = stream.GetCursorPos(); stream.SetCursorPos(stream.GetSize()-769); nzUInt8 magic; if (!stream.Read(&magic, 1)) diff --git a/src/Nazara/Utility/PixelFormat.cpp b/src/Nazara/Utility/PixelFormat.cpp index 833279026..b91cdab71 100644 --- a/src/Nazara/Utility/PixelFormat.cpp +++ b/src/Nazara/Utility/PixelFormat.cpp @@ -11,7 +11,7 @@ namespace { inline nzUInt8 c4to5(nzUInt8 c) { - return c * (31.f/15.f); + return static_cast(c * (31.f/15.f)); } inline nzUInt8 c4to8(nzUInt8 c) @@ -21,12 +21,12 @@ namespace inline nzUInt8 c5to4(nzUInt8 c) { - return c * (15.f/31.f); + return static_cast(c * (15.f/31.f)); } inline nzUInt8 c5to8(nzUInt8 c) { - return c * (255.f/31.f); + return static_cast(c * (255.f/31.f)); } inline nzUInt8 c8to4(nzUInt8 c) @@ -36,7 +36,7 @@ namespace inline nzUInt8 c8to5(nzUInt8 c) { - return c * (31.f/255.f); + return static_cast(c * (31.f/255.f)); } template diff --git a/src/Nazara/Utility/Win32/WindowImpl.cpp b/src/Nazara/Utility/Win32/WindowImpl.cpp index 677844fd6..2d7ffcbe6 100644 --- a/src/Nazara/Utility/Win32/WindowImpl.cpp +++ b/src/Nazara/Utility/Win32/WindowImpl.cpp @@ -281,12 +281,12 @@ void NzWindowImpl::IgnoreNextMouseEvent(int mouseX, int mouseY) bool NzWindowImpl::IsMinimized() const { - return IsIconic(m_handle); + return IsIconic(m_handle) == TRUE; } bool NzWindowImpl::IsVisible() const { - return IsWindowVisible(m_handle); + return IsWindowVisible(m_handle) == TRUE; } void NzWindowImpl::ProcessEvents(bool block) @@ -800,7 +800,7 @@ bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARA { NzEvent event; event.type = nzEventType_MouseWheelMoved; - event.mouseWheel.delta = m_scrolling/WHEEL_DELTA; + event.mouseWheel.delta = static_cast(m_scrolling/WHEEL_DELTA); m_parent->PushEvent(event); m_scrolling %= WHEEL_DELTA; @@ -1001,7 +1001,7 @@ bool NzWindowImpl::Initialize() windowClass.lpszMenuName = nullptr; windowClass.style = CS_DBLCLKS; // Gestion du double-clic - return RegisterClassW(&windowClass); + return RegisterClassW(&windowClass) != 0; } void NzWindowImpl::Uninitialize()