Warning fix on clang

This commit is contained in:
King_DuckZ 2014-08-14 12:09:44 +02:00
parent 4e89878eb4
commit 08f217e22c
5 changed files with 13 additions and 4 deletions

View file

@ -54,6 +54,7 @@ namespace cloonel {
return g_emptyBars; return g_emptyBars;
} }
#if !defined(NDEBUG)
///---------------------------------------------------------------------- ///----------------------------------------------------------------------
///---------------------------------------------------------------------- ///----------------------------------------------------------------------
const CollisionBarSetListType& findGroup (const CollisionBarSetsListType& parList, Collider::GroupIDType parID) { const CollisionBarSetListType& findGroup (const CollisionBarSetsListType& parList, Collider::GroupIDType parID) {
@ -64,6 +65,7 @@ namespace cloonel {
} }
return g_emptySets; return g_emptySets;
} }
#endif
#if !defined(NDEBUG) #if !defined(NDEBUG)
///---------------------------------------------------------------------- ///----------------------------------------------------------------------
@ -72,7 +74,9 @@ namespace cloonel {
const CollisionBarListType& result = findGroup(parList, parID); const CollisionBarListType& result = findGroup(parList, parID);
return &g_emptyBars != &result; return &g_emptyBars != &result;
} }
#endif
#if !defined(NDEBUG)
///---------------------------------------------------------------------- ///----------------------------------------------------------------------
///---------------------------------------------------------------------- ///----------------------------------------------------------------------
bool isGroupRegistered (const CollisionBarSetsListType& parList, Collider::GroupIDType parID) { bool isGroupRegistered (const CollisionBarSetsListType& parList, Collider::GroupIDType parID) {

View file

@ -21,6 +21,7 @@
#include "platformset.hpp" #include "platformset.hpp"
#include "platform.hpp" #include "platform.hpp"
#include "CloonelJumpConfig.h" #include "CloonelJumpConfig.h"
#include "casts.hpp"
#include <ciso646> #include <ciso646>
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
@ -65,7 +66,7 @@ namespace cloonel {
///-------------------------------------------------------------------------- ///--------------------------------------------------------------------------
void PlatformSet::CopyBars (std::vector<const HorzCollisionBar*>& parOut) const { void PlatformSet::CopyBars (std::vector<const HorzCollisionBar*>& parOut) const {
auto eleCopy = FindFirstVisible(m_platforms); auto eleCopy = FindFirstVisible(m_platforms);
const size_t count = m_platforms.end() - eleCopy; const size_t count = checked_numcast<size_t>(m_platforms.end() - eleCopy);
parOut.reserve(parOut.size() + count); parOut.reserve(parOut.size() + count);
while (m_platforms.end() != eleCopy) { while (m_platforms.end() != eleCopy) {
parOut.push_back(eleCopy->TopCollisionBar()); parOut.push_back(eleCopy->TopCollisionBar());
@ -77,7 +78,7 @@ namespace cloonel {
///-------------------------------------------------------------------------- ///--------------------------------------------------------------------------
void PlatformSet::CopyDrawables (std::vector<const Drawable*>& parOut) const { void PlatformSet::CopyDrawables (std::vector<const Drawable*>& parOut) const {
auto eleCopy = FindFirstVisible(m_platforms); auto eleCopy = FindFirstVisible(m_platforms);
const size_t count = m_platforms.end() - eleCopy; const size_t count = checked_numcast<size_t>(m_platforms.end() - eleCopy);
parOut.reserve(parOut.size() + count); parOut.reserve(parOut.size() + count);
while (m_platforms.end() != eleCopy) { while (m_platforms.end() != eleCopy) {
parOut.push_back(&*eleCopy); parOut.push_back(&*eleCopy);

View file

@ -25,6 +25,7 @@
#include "mover.hpp" #include "mover.hpp"
#include "collider.hpp" #include "collider.hpp"
#include "platformset.hpp" #include "platformset.hpp"
#include "casts.hpp"
#include <ciso646> #include <ciso646>
#include <cstdlib> #include <cstdlib>
#include <cassert> #include <cassert>
@ -55,7 +56,7 @@ namespace cloonel {
const float yDist = static_cast<float>(std::rand()) * invRandMax * 2.0f * std::min(lowerRange, upperRange) + minDist; const float yDist = static_cast<float>(std::rand()) * invRandMax * 2.0f * std::min(lowerRange, upperRange) + minDist;
assert(yDist >= minDist and yDist <= maxDist); assert(yDist >= minDist and yDist <= maxDist);
const auto rndNum = std::rand() % (REFERENCE_WIDTH - g_platfWidth); const auto rndNum = std::rand() % checked_numcast<int>(REFERENCE_WIDTH - g_platfWidth);
return float2(static_cast<float>(rndNum), yDist + parStart); return float2(static_cast<float>(rndNum), yDist + parStart);
} }

View file

@ -25,6 +25,7 @@
#include <type_traits> #include <type_traits>
#include <cstdint> #include <cstdint>
#include <cmath> #include <cmath>
#include <cassert>
namespace cloonel { namespace cloonel {
template <typename T, typename U, uint32_t S> template <typename T, typename U, uint32_t S>

View file

@ -32,7 +32,9 @@ namespace cloonel {
///-------------------------------------------------------------------------- ///--------------------------------------------------------------------------
///-------------------------------------------------------------------------- ///--------------------------------------------------------------------------
template <typename T, typename U> template <typename T, typename U>
Vector<typename std::common_type<T, U>::type, 3> cross (const Vector<T, 3>& parA, const Vector<U, 3>& parB) { Vector<typename std::common_type<T, U>::type, 3> cross (const Vector<T, 3>& /*parA*/, const Vector<U, 3>& /*parB*/) {
//Not implemented
assert(false);
} }
///-------------------------------------------------------------------------- ///--------------------------------------------------------------------------