Buildfix for clang

This commit is contained in:
King_DuckZ 2014-03-21 22:51:28 +01:00
parent 2b9746b868
commit 452761985d
7 changed files with 24 additions and 22 deletions

View file

@ -73,7 +73,7 @@ namespace cloonel {
///------------------------------------------------------------------------
///------------------------------------------------------------------------
GameBase::~GameBase() {
GameBase::~GameBase() noexcept {
}
///------------------------------------------------------------------------

View file

@ -79,7 +79,7 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
InputBag::~InputBag() {
InputBag::~InputBag() noexcept {
}
///--------------------------------------------------------------------------

View file

@ -60,9 +60,9 @@ namespace cloonel {
Iterator& operator++ ( void ) {
if (m_occupied.size() == m_pos)
return *this;
auto itNext = std::find(m_occupied.begin() + m_pos + 1, m_occupied.end(), true);
auto itNext = std::find(m_occupied.begin() + static_cast<std::vector<bool>::difference_type>(m_pos + 1), m_occupied.end(), true);
if (m_occupied.end() != itNext)
m_pos = itNext - m_occupied.begin();
m_pos = static_cast<std::size_t>(itNext - m_occupied.begin());
else
m_pos = m_occupied.size();
return *this;
@ -138,7 +138,7 @@ namespace cloonel {
auto lastNull = std::find(m_occupied.rbegin(), m_occupied.rend(), false);
if (m_occupied.rend() != lastNull) {
const std::size_t newSize = m_occupied.size() - (lastNull - m_occupied.rbegin()) + 1;
const std::size_t newSize = m_occupied.size() - static_cast<std::size_t>(lastNull - m_occupied.rbegin()) + 1;
m_occupied.resize(newSize);
m_list.resize(newSize);
}

View file

@ -22,6 +22,7 @@
#include "sizenotifiable.hpp"
#include "sizeratio.hpp"
#include <SDL2/SDL.h>
#include <stdexcept>
namespace cloonel {
struct SDLMain::LocalData {

View file

@ -22,6 +22,7 @@
#include "vector.hpp"
#include <memory>
#include <string>
struct SDL_Renderer;

View file

@ -75,21 +75,21 @@ namespace cloonel {
Vector<typename std::common_type<T, U>::type, S> operator* ( Vector<T, S> parA, const Vector<U, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
Vector<typename std::common_type<T, U>::type, S> operator/ ( Vector<T, S> parA, const Vector<U, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator+ ( U parA, const Vector<U, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator- ( U parA, const Vector<U, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator* ( U parA, const Vector<U, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator/ ( U parA, const Vector<U, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator+ ( const Vector<T, S>& parA, U parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator- ( const Vector<T, S>& parA, U parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator* ( const Vector<T, S>& parA, U parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator/ ( const Vector<T, S>& parA, U parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S>

View file

@ -22,7 +22,7 @@ namespace cloonel {
///-------------------------------------------------------------------------
template <typename T, uint32_t S>
Vector<T, S>::Vector (T parValue) {
for (int z = 0; z < S; ++z) {
for (uint32_t z = 0; z < S; ++z) {
m_mem[z] = parValue;
}
}
@ -142,23 +142,23 @@ namespace cloonel {
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator+ (T parA, const Vector<U, S>& parB) {
return parB + parA;
}
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator- (T parA, const Vector<U, S>& parB) {
return Vector<T, S>(parA) - parB;
}
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator* (T parA, const Vector<U, S>& parB) {
return parB * parA;
}
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator/ (T parA, const Vector<U, S>& parB) {
return Vector<T, S>(parA) / parB;
}
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator+ (const Vector<T, S>& parA, U parB) {
typedef typename std::common_type<T, U>::type RetType;
Vector<RetType, S> retVal;
@ -167,7 +167,7 @@ namespace cloonel {
}
return retVal;
}
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator- (const Vector<T, S>& parA, U parB) {
typedef typename std::common_type<T, U>::type RetType;
Vector<RetType, S> retVal;
@ -176,7 +176,7 @@ namespace cloonel {
}
return retVal;
}
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator* (const Vector<T, S>& parA, U parB) {
typedef typename std::common_type<T, U>::type RetType;
Vector<RetType, S> retVal;
@ -185,7 +185,7 @@ namespace cloonel {
}
return retVal;
}
template <typename T, typename U, uint32_t S>
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator/ (const Vector<T, S>& parA, U parB) {
typedef typename std::common_type<T, U>::type RetType;
Vector<RetType, S> retVal;