From 508554fcb1ff7e64e0e13c26883875cae153e62f Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 30 Sep 2017 15:00:42 +0200 Subject: [PATCH] Fix some more warnings --- SDK/src/NDK/Lua/LuaBinding_Core.cpp | 22 +++++++++--------- SDK/src/NDK/Lua/LuaBinding_Utility.cpp | 32 +++++++++++++------------- include/Nazara/Renderer/ShaderAst.inl | 2 +- src/Nazara/Physics2D/RigidBody2D.cpp | 2 +- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/SDK/src/NDK/Lua/LuaBinding_Core.cpp b/SDK/src/NDK/Lua/LuaBinding_Core.cpp index 5dc6511d2..6091c88e2 100644 --- a/SDK/src/NDK/Lua/LuaBinding_Core.cpp +++ b/SDK/src/NDK/Lua/LuaBinding_Core.cpp @@ -159,9 +159,9 @@ namespace Ndk directory.BindStaticMethod("SetCurrent", Nz::Directory::SetCurrent); // Manual - directory.BindMethod("__tostring", [] (Nz::LuaState& lua, Nz::Directory& dir, std::size_t /*argumentCount*/) -> int { + directory.BindMethod("__tostring", [] (Nz::LuaState& lua, Nz::Directory& instance, std::size_t /*argumentCount*/) -> int { Nz::StringStream ss("Directory("); - ss << dir.GetPath(); + ss << instance.GetPath(); ss << ')'; lua.PushString(ss); @@ -237,7 +237,7 @@ namespace Ndk file.BindStaticMethod("Rename", &Nz::File::Rename); // Manual - file.BindMethod("Open", [] (Nz::LuaState& lua, Nz::File& file, std::size_t argumentCount) -> int + file.BindMethod("Open", [] (Nz::LuaState& lua, Nz::File& instance, std::size_t argumentCount) -> int { std::size_t argCount = std::min(argumentCount, 2U); @@ -246,13 +246,13 @@ namespace Ndk { case 0: case 1: - return lua.Push(file.Open(lua.Check(&argIndex, Nz::OpenMode_NotOpen))); + return lua.Push(instance.Open(lua.Check(&argIndex, Nz::OpenMode_NotOpen))); case 2: { Nz::String filePath = lua.Check(&argIndex); Nz::UInt32 openMode = lua.Check(&argIndex, Nz::OpenMode_NotOpen); - return lua.Push(file.Open(filePath, openMode)); + return lua.Push(instance.Open(filePath, openMode)); } } @@ -260,7 +260,7 @@ namespace Ndk return 0; }); - file.BindMethod("SetCursorPos", [] (Nz::LuaState& lua, Nz::File& file, std::size_t argumentCount) -> int + file.BindMethod("SetCursorPos", [] (Nz::LuaState& lua, Nz::File& instance, std::size_t argumentCount) -> int { std::size_t argCount = std::min(argumentCount, 2U); @@ -268,13 +268,13 @@ namespace Ndk switch (argCount) { case 1: - return lua.Push(file.SetCursorPos(lua.Check(&argIndex))); + return lua.Push(instance.SetCursorPos(lua.Check(&argIndex))); case 2: { Nz::CursorPosition curPos = lua.Check(&argIndex); Nz::Int64 offset = lua.Check(&argIndex); - return lua.Push(file.SetCursorPos(curPos, offset)); + return lua.Push(instance.SetCursorPos(curPos, offset)); } } @@ -282,10 +282,10 @@ namespace Ndk return 0; }); - file.BindMethod("__tostring", [] (Nz::LuaState& lua, Nz::File& file, std::size_t /*argumentCount*/) -> int { + file.BindMethod("__tostring", [] (Nz::LuaState& lua, Nz::File& instance, std::size_t /*argumentCount*/) -> int { Nz::StringStream ss("File("); - if (file.IsOpen()) - ss << "Path: " << file.GetPath(); + if (instance.IsOpen()) + ss << "Path: " << instance.GetPath(); ss << ')'; diff --git a/SDK/src/NDK/Lua/LuaBinding_Utility.cpp b/SDK/src/NDK/Lua/LuaBinding_Utility.cpp index 65230a97a..14fddec73 100644 --- a/SDK/src/NDK/Lua/LuaBinding_Utility.cpp +++ b/SDK/src/NDK/Lua/LuaBinding_Utility.cpp @@ -209,29 +209,29 @@ namespace Ndk node.BindMethod("SetPosition", (void(Nz::Node::*)(const Nz::Vector3f&, Nz::CoordSys)) &Nz::Node::SetPosition, Nz::CoordSys_Local); node.BindMethod("SetRotation", (void(Nz::Node::*)(const Nz::Quaternionf&, Nz::CoordSys)) &Nz::Node::SetRotation, Nz::CoordSys_Local); - node.BindMethod("Move", [] (Nz::LuaState& lua, Nz::Node& node, std::size_t /*argumentCount*/) -> int + node.BindMethod("Move", [] (Nz::LuaState& lua, Nz::Node& instance, std::size_t /*argumentCount*/) -> int { int argIndex = 2; Nz::Vector3f offset = lua.Check(&argIndex); Nz::CoordSys coordSys = lua.Check(&argIndex, Nz::CoordSys_Local); - node.Move(offset, coordSys); + instance.Move(offset, coordSys); return 0; }); - node.BindMethod("Rotate", [] (Nz::LuaState& lua, Nz::Node& node, std::size_t /*argumentCount*/) -> int + node.BindMethod("Rotate", [] (Nz::LuaState& lua, Nz::Node& instance, std::size_t /*argumentCount*/) -> int { int argIndex = 2; Nz::Quaternionf rotation = lua.Check(&argIndex); Nz::CoordSys coordSys = lua.Check(&argIndex, Nz::CoordSys_Local); - node.Rotate(rotation, coordSys); + instance.Rotate(rotation, coordSys); return 0; }); - node.BindMethod("Scale", [] (Nz::LuaState& lua, Nz::Node& node, std::size_t argumentCount) -> int + node.BindMethod("Scale", [] (Nz::LuaState& lua, Nz::Node& instance, std::size_t argumentCount) -> int { std::size_t argCount = std::min(argumentCount, 4U); @@ -241,15 +241,15 @@ namespace Ndk case 1: { if (lua.IsOfType(argIndex, Nz::LuaType_Number)) - node.Scale(lua.Check(&argIndex)); + instance.Scale(lua.Check(&argIndex)); else - node.Scale(lua.Check(&argIndex)); + instance.Scale(lua.Check(&argIndex)); return 0; } case 3: - node.Scale(lua.Check(&argIndex)); + instance.Scale(lua.Check(&argIndex)); return 0; } @@ -257,7 +257,7 @@ namespace Ndk return 0; }); - node.BindMethod("SetScale", [] (Nz::LuaState& lua, Nz::Node& node, std::size_t argumentCount) -> int + node.BindMethod("SetScale", [] (Nz::LuaState& lua, Nz::Node& instance, std::size_t argumentCount) -> int { std::size_t argCount = std::min(argumentCount, 4U); @@ -271,10 +271,10 @@ namespace Ndk { float scale = lua.Check(&argIndex); Nz::CoordSys coordSys = lua.Check(&argIndex, Nz::CoordSys_Local); - node.SetScale(scale, coordSys); + instance.SetScale(scale, coordSys); } else - node.SetScale(lua.Check(&argIndex)); + instance.SetScale(lua.Check(&argIndex)); return 0; } @@ -285,7 +285,7 @@ namespace Ndk Nz::Vector3f scale = lua.Check(&argIndex); Nz::CoordSys coordSys = lua.Check(&argIndex, Nz::CoordSys_Local); - node.SetScale(scale, coordSys); + instance.SetScale(scale, coordSys); return 0; } } @@ -294,7 +294,7 @@ namespace Ndk return 0; }); - node.BindMethod("SetInitialScale", [] (Nz::LuaState& lua, Nz::Node& node, std::size_t argumentCount) -> int + node.BindMethod("SetInitialScale", [] (Nz::LuaState& lua, Nz::Node& instance, std::size_t argumentCount) -> int { std::size_t argCount = std::min(argumentCount, 4U); @@ -304,16 +304,16 @@ namespace Ndk case 1: { if (lua.IsOfType(argIndex, Nz::LuaType_Number)) - node.SetInitialScale(lua.Check(&argIndex)); + instance.SetInitialScale(lua.Check(&argIndex)); else - node.SetInitialScale(lua.Check(&argIndex)); + instance.SetInitialScale(lua.Check(&argIndex)); return 0; } case 2: case 3: - node.SetInitialScale(lua.Check(&argIndex)); + instance.SetInitialScale(lua.Check(&argIndex)); return 0; } diff --git a/include/Nazara/Renderer/ShaderAst.inl b/include/Nazara/Renderer/ShaderAst.inl index b03045386..9b87babd9 100644 --- a/include/Nazara/Renderer/ShaderAst.inl +++ b/include/Nazara/Renderer/ShaderAst.inl @@ -159,7 +159,7 @@ namespace Nz inline Cast::Cast(ExpressionType castTo, ExpressionPtr first, ExpressionPtr second, ExpressionPtr third, ExpressionPtr fourth) : exprType(castTo), - expressions({first, second, third, fourth}) + expressions({ {first, second, third, fourth} }) { unsigned int componentCount = 0; unsigned int requiredComponents = GetComponentCount(exprType); diff --git a/src/Nazara/Physics2D/RigidBody2D.cpp b/src/Nazara/Physics2D/RigidBody2D.cpp index a526c4bff..63c9f9d4d 100644 --- a/src/Nazara/Physics2D/RigidBody2D.cpp +++ b/src/Nazara/Physics2D/RigidBody2D.cpp @@ -46,7 +46,7 @@ namespace Nz CopyBodyData(object.GetHandle()); - for (int i = 0; i < m_shapes.size(); ++i) + for (std::size_t i = 0; i < m_shapes.size(); ++i) m_shapes[i]->bb = cpShapeCacheBB(object.m_shapes[i]); }