Fix some more warnings

This commit is contained in:
Lynix 2017-09-30 15:00:42 +02:00
parent fb354b1204
commit 508554fcb1
4 changed files with 29 additions and 29 deletions

View File

@ -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<std::size_t>(argumentCount, 2U);
@ -246,13 +246,13 @@ namespace Ndk
{
case 0:
case 1:
return lua.Push(file.Open(lua.Check<Nz::UInt32>(&argIndex, Nz::OpenMode_NotOpen)));
return lua.Push(instance.Open(lua.Check<Nz::UInt32>(&argIndex, Nz::OpenMode_NotOpen)));
case 2:
{
Nz::String filePath = lua.Check<Nz::String>(&argIndex);
Nz::UInt32 openMode = lua.Check<Nz::UInt32>(&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<std::size_t>(argumentCount, 2U);
@ -268,13 +268,13 @@ namespace Ndk
switch (argCount)
{
case 1:
return lua.Push(file.SetCursorPos(lua.Check<Nz::UInt64>(&argIndex)));
return lua.Push(instance.SetCursorPos(lua.Check<Nz::UInt64>(&argIndex)));
case 2:
{
Nz::CursorPosition curPos = lua.Check<Nz::CursorPosition>(&argIndex);
Nz::Int64 offset = lua.Check<Nz::Int64>(&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 << ')';

View File

@ -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<Nz::Vector3f>(&argIndex);
Nz::CoordSys coordSys = lua.Check<Nz::CoordSys>(&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<Nz::Quaternionf>(&argIndex);
Nz::CoordSys coordSys = lua.Check<Nz::CoordSys>(&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<std::size_t>(argumentCount, 4U);
@ -241,15 +241,15 @@ namespace Ndk
case 1:
{
if (lua.IsOfType(argIndex, Nz::LuaType_Number))
node.Scale(lua.Check<float>(&argIndex));
instance.Scale(lua.Check<float>(&argIndex));
else
node.Scale(lua.Check<Nz::Vector3f>(&argIndex));
instance.Scale(lua.Check<Nz::Vector3f>(&argIndex));
return 0;
}
case 3:
node.Scale(lua.Check<Nz::Vector3f>(&argIndex));
instance.Scale(lua.Check<Nz::Vector3f>(&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<std::size_t>(argumentCount, 4U);
@ -271,10 +271,10 @@ namespace Ndk
{
float scale = lua.Check<float>(&argIndex);
Nz::CoordSys coordSys = lua.Check<Nz::CoordSys>(&argIndex, Nz::CoordSys_Local);
node.SetScale(scale, coordSys);
instance.SetScale(scale, coordSys);
}
else
node.SetScale(lua.Check<Nz::Vector3f>(&argIndex));
instance.SetScale(lua.Check<Nz::Vector3f>(&argIndex));
return 0;
}
@ -285,7 +285,7 @@ namespace Ndk
Nz::Vector3f scale = lua.Check<Nz::Vector3f>(&argIndex);
Nz::CoordSys coordSys = lua.Check<Nz::CoordSys>(&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<std::size_t>(argumentCount, 4U);
@ -304,16 +304,16 @@ namespace Ndk
case 1:
{
if (lua.IsOfType(argIndex, Nz::LuaType_Number))
node.SetInitialScale(lua.Check<float>(&argIndex));
instance.SetInitialScale(lua.Check<float>(&argIndex));
else
node.SetInitialScale(lua.Check<Nz::Vector2f>(&argIndex));
instance.SetInitialScale(lua.Check<Nz::Vector2f>(&argIndex));
return 0;
}
case 2:
case 3:
node.SetInitialScale(lua.Check<Nz::Vector3f>(&argIndex));
instance.SetInitialScale(lua.Check<Nz::Vector3f>(&argIndex));
return 0;
}

View File

@ -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);

View File

@ -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]);
}