Fix a lot of warnings and some errors

This commit is contained in:
Jérôme Leclercq
2020-09-26 11:44:09 +02:00
parent 267bd74a97
commit 65337c6a38
30 changed files with 78 additions and 65 deletions

View File

@@ -27,7 +27,6 @@ namespace Nz
for (Block& block : m_blocks)
{
UInt64 alignedOffset = block.freeOffset;
if (block.freeOffset + size > m_blockSize)
continue; //< Not enough space

View File

@@ -418,7 +418,7 @@ namespace Nz
}
else
{
handler->beginFunc = [](cpArbiter* arb, cpSpace* space, void*) -> cpBool
handler->beginFunc = [](cpArbiter*, cpSpace*, void*) -> cpBool
{
return cpTrue;
};
@@ -444,7 +444,7 @@ namespace Nz
}
else
{
handler->separateFunc = [](cpArbiter* arb, cpSpace* space, void*)
handler->separateFunc = [](cpArbiter*, cpSpace*, void*)
{
};
}
@@ -472,7 +472,7 @@ namespace Nz
}
else
{
handler->preSolveFunc = [](cpArbiter* arb, cpSpace* space, void* data) -> cpBool
handler->preSolveFunc = [](cpArbiter*, cpSpace*, void*) -> cpBool
{
return cpTrue;
};
@@ -498,7 +498,7 @@ namespace Nz
}
else
{
handler->postSolveFunc = [](cpArbiter* arb, cpSpace* space, void* data)
handler->postSolveFunc = [](cpArbiter*, cpSpace*, void*)
{
};
}

View File

@@ -183,7 +183,7 @@ namespace Nz
{
using CallbackType = decltype(callback);
auto RealCallback = [](cpBody* body, cpArbiter* arbiter, void* data)
auto RealCallback = [](cpBody* /*body*/, cpArbiter* arbiter, void* data)
{
CallbackType& cb = *static_cast<CallbackType*>(data);
@@ -399,7 +399,6 @@ namespace Nz
m_geom->GenerateShapes(this, &m_shapes);
cpSpace* space = m_world->GetHandle();
for (cpShape* shape : m_shapes)
cpShapeSetUserData(shape, this);
@@ -643,7 +642,6 @@ namespace Nz
{
UnregisterFromSpace();
cpSpace* space = m_world->GetHandle();
for (cpShape* shape : m_shapes)
cpShapeFree(shape);

View File

@@ -11,8 +11,8 @@
namespace Nz
{
PhysWorld3D::PhysWorld3D() :
m_gravity(Vector3f::Zero()),
m_maxStepCount(50),
m_gravity(Vector3f::Zero()),
m_stepSize(0.005f),
m_timestepAccumulator(0.f)
{
@@ -159,7 +159,7 @@ namespace Nz
}
}
int PhysWorld3D::OnAABBOverlap(const NewtonJoint* const contactJoint, float timestep, int threadIndex)
int PhysWorld3D::OnAABBOverlap(const NewtonJoint* const contactJoint, float /*timestep*/, int /*threadIndex*/)
{
RigidBody3D* bodyA = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody0(contactJoint)));
RigidBody3D* bodyB = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody1(contactJoint)));
@@ -186,7 +186,7 @@ namespace Nz
return 1;
}
void PhysWorld3D::ProcessContact(const NewtonJoint* const contactJoint, float timestep, int threadIndex)
void PhysWorld3D::ProcessContact(const NewtonJoint* const contactJoint, float /*timestep*/, int /*threadIndex*/)
{
RigidBody3D* bodyA = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody0(contactJoint)));
RigidBody3D* bodyB = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody1(contactJoint)));

View File

@@ -82,7 +82,7 @@ namespace Nz
m_value = Value { resultId };
},
[this](std::monostate)
[](std::monostate)
{
throw std::runtime_error("an internal error occurred");
}

View File

@@ -46,7 +46,6 @@ namespace Nz
{
UInt32 resultId = m_writer.AllocateResultId();
UInt32 pointerType = m_writer.RegisterPointerType(node.exprType, pointer.storage); //< FIXME
UInt32 typeId = m_writer.GetTypeId(node.exprType);
m_writer.GetInstructions().AppendVariadic(SpirvOp::OpAccessChain, [&](const auto& appender)
{

View File

@@ -217,7 +217,7 @@ namespace Nz
for (unsigned int y = 0; y < height; ++y)
{
for (unsigned int x = 0; x < width; ++x)
*pixels++ = (data[x/8] & ((1 << (7 - x%8)) ? 255 : 0));
*pixels++ = (data[x/8] & ((1 << (7 - x%8) != 0) ? 255 : 0));
data += bitmap.pitch;
}

View File

@@ -460,15 +460,15 @@ namespace Nz
if (!mesh.faces.empty())
{
const std::string& matKey = matIt.key();
mesh.name = meshIt.key();
const std::string& matName = matIt.key();
auto it = materials.find(matName);
auto it = materials.find(matKey);
if (it == materials.end())
{
mesh.material = index;
materials[matName] = index;
m_materials[index] = matName;
materials[matKey] = index;
m_materials[index] = matKey;
}
else
mesh.material = it->second;

View File

@@ -263,7 +263,7 @@ namespace Nz
DisconnectFontSlots();
m_blocks = std::move(drawer.m_blocks);
m_bounds = std::move(m_bounds);
m_bounds = std::move(drawer.m_bounds);
m_defaultCharacterSize = std::move(drawer.m_defaultCharacterSize);
m_defaultCharacterSpacingOffset = std::move(drawer.m_defaultCharacterSpacingOffset);
m_defaultColor = std::move(drawer.m_defaultColor);
@@ -272,12 +272,12 @@ namespace Nz
m_defaultOutlineColor = std::move(drawer.m_defaultOutlineColor);
m_defaultOutlineThickness = std::move(drawer.m_defaultOutlineThickness);
m_defaultStyle = std::move(drawer.m_defaultStyle);
m_drawPos = std::move(m_drawPos);
m_drawPos = std::move(drawer.m_drawPos);
m_fontIndexes = std::move(drawer.m_fontIndexes);
m_fonts = std::move(drawer.m_fonts);
m_glyphs = std::move(m_glyphs);
m_lines = std::move(m_lines);
m_glyphUpdated = std::move(m_glyphUpdated);
m_glyphs = std::move(drawer.m_glyphs);
m_lines = std::move(drawer.m_lines);
m_glyphUpdated = std::move(drawer.m_glyphUpdated);
drawer.DisconnectFontSlots();
ConnectFontSlots();

View File

@@ -24,8 +24,8 @@ namespace Ndk
* \param id Identifier of the entity
*/
Entity::Entity(World* world, EntityId id) :
m_id(id),
m_world(world)
m_world(world),
m_id(id)
{
}