Fix the remaining warnings on the intel compiler.

This commit is contained in:
King_DuckZ 2014-08-14 13:12:25 +02:00
parent 704cfa4051
commit ec665cc24c
2 changed files with 12 additions and 1 deletions

View file

@ -32,12 +32,22 @@ namespace cloonel {
template <typename To, typename From> template <typename To, typename From>
inline inline
To checked_numcast (From parFrom) { To checked_numcast (From parFrom) {
#if defined(__INTEL_COMPILER)
//implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
# pragma warning push
# pragma warning disable 1682
#endif
#if defined(NDEBUG) #if defined(NDEBUG)
return static_cast<To>(parFrom); return static_cast<To>(parFrom);
#else #else
const To retVal = static_cast<To>(parFrom); const To retVal = static_cast<To>(parFrom);
assert(static_cast<From>(retVal) == parFrom); assert(static_cast<From>(retVal) == parFrom);
return retVal; return retVal;
#endif
#if defined(__INTEL_COMPILER)
# pragma warning pop
#endif #endif
} }
} //namespace cloonel } //namespace cloonel

View file

@ -22,6 +22,7 @@
#include "physicsfswrapper.hpp" #include "physicsfswrapper.hpp"
#include "gameplaysceneclassic.hpp" #include "gameplaysceneclassic.hpp"
#include "vector.hpp" #include "vector.hpp"
#include "casts.hpp"
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include <ciso646> #include <ciso646>
@ -45,7 +46,7 @@ namespace {
///------------------------------------------------------------------------------ ///------------------------------------------------------------------------------
int main (int, char* parArgv[]) { int main (int, char* parArgv[]) {
#if defined(NDEBUG) #if defined(NDEBUG)
std::srand(static_cast<unsigned int>(std::time(nullptr))); std::srand(cloonel::checked_numcast<unsigned int>(std::time(nullptr)));
#else #else
std::srand(static_cast<unsigned int>(DEF_RANDOM_SEED)); std::srand(static_cast<unsigned int>(DEF_RANDOM_SEED));
#endif #endif