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;
}
#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) {

View file

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

View file

@ -25,6 +25,7 @@
#include "mover.hpp"
#include "collider.hpp"
#include "platformset.hpp"
#include "casts.hpp"
#include <ciso646>
#include <cstdlib>
#include <cassert>
@ -55,7 +56,7 @@ namespace cloonel {
const float yDist = static_cast<float>(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<int>(REFERENCE_WIDTH - g_platfWidth);
return float2(static_cast<float>(rndNum), yDist + parStart);
}

View file

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

View file

@ -32,7 +32,9 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
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);
}
///--------------------------------------------------------------------------