diff --git a/src/collider.cpp b/src/collider.cpp index 78439af..326de75 100644 --- a/src/collider.cpp +++ b/src/collider.cpp @@ -54,6 +54,7 @@ namespace cloonel { return g_emptyBars; } +#if !defined(NDEBUG) ///---------------------------------------------------------------------- ///---------------------------------------------------------------------- const CollisionBarSetListType& findGroup (const CollisionBarSetsListType& parList, Collider::GroupIDType parID) { @@ -64,6 +65,7 @@ namespace cloonel { } return g_emptySets; } +#endif #if !defined(NDEBUG) ///---------------------------------------------------------------------- @@ -72,7 +74,9 @@ namespace cloonel { const CollisionBarListType& result = findGroup(parList, parID); return &g_emptyBars != &result; } +#endif +#if !defined(NDEBUG) ///---------------------------------------------------------------------- ///---------------------------------------------------------------------- bool isGroupRegistered (const CollisionBarSetsListType& parList, Collider::GroupIDType parID) { diff --git a/src/platformset.cpp b/src/platformset.cpp index 5c86129..244d467 100644 --- a/src/platformset.cpp +++ b/src/platformset.cpp @@ -21,6 +21,7 @@ #include "platformset.hpp" #include "platform.hpp" #include "CloonelJumpConfig.h" +#include "casts.hpp" #include #include #include @@ -65,7 +66,7 @@ namespace cloonel { ///-------------------------------------------------------------------------- void PlatformSet::CopyBars (std::vector& parOut) const { auto eleCopy = FindFirstVisible(m_platforms); - const size_t count = m_platforms.end() - eleCopy; + const size_t count = checked_numcast(m_platforms.end() - eleCopy); parOut.reserve(parOut.size() + count); while (m_platforms.end() != eleCopy) { parOut.push_back(eleCopy->TopCollisionBar()); @@ -77,7 +78,7 @@ namespace cloonel { ///-------------------------------------------------------------------------- void PlatformSet::CopyDrawables (std::vector& parOut) const { auto eleCopy = FindFirstVisible(m_platforms); - const size_t count = m_platforms.end() - eleCopy; + const size_t count = checked_numcast(m_platforms.end() - eleCopy); parOut.reserve(parOut.size() + count); while (m_platforms.end() != eleCopy) { parOut.push_back(&*eleCopy); diff --git a/src/platformspawner.cpp b/src/platformspawner.cpp index f4da94e..26f1d13 100644 --- a/src/platformspawner.cpp +++ b/src/platformspawner.cpp @@ -25,6 +25,7 @@ #include "mover.hpp" #include "collider.hpp" #include "platformset.hpp" +#include "casts.hpp" #include #include #include @@ -55,7 +56,7 @@ namespace cloonel { const float yDist = static_cast(std::rand()) * invRandMax * 2.0f * std::min(lowerRange, upperRange) + minDist; assert(yDist >= minDist and yDist <= maxDist); - const auto rndNum = std::rand() % (REFERENCE_WIDTH - g_platfWidth); + const auto rndNum = std::rand() % checked_numcast(REFERENCE_WIDTH - g_platfWidth); return float2(static_cast(rndNum), yDist + parStart); } diff --git a/src/vectormath.hpp b/src/vectormath.hpp index e2dcb86..c79d2ca 100644 --- a/src/vectormath.hpp +++ b/src/vectormath.hpp @@ -25,6 +25,7 @@ #include #include #include +#include namespace cloonel { template diff --git a/src/vectormath.inl b/src/vectormath.inl index a8ddca2..e82e37f 100644 --- a/src/vectormath.inl +++ b/src/vectormath.inl @@ -32,7 +32,9 @@ namespace cloonel { ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template - Vector::type, 3> cross (const Vector& parA, const Vector& parB) { + Vector::type, 3> cross (const Vector& /*parA*/, const Vector& /*parB*/) { + //Not implemented + assert(false); } ///--------------------------------------------------------------------------