Fix the remaining warnings on the intel compiler.
This commit is contained in:
parent
704cfa4051
commit
ec665cc24c
2 changed files with 12 additions and 1 deletions
|
@ -32,12 +32,22 @@ namespace cloonel {
|
|||
template <typename To, typename From>
|
||||
inline
|
||||
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)
|
||||
return static_cast<To>(parFrom);
|
||||
#else
|
||||
const To retVal = static_cast<To>(parFrom);
|
||||
assert(static_cast<From>(retVal) == parFrom);
|
||||
return retVal;
|
||||
#endif
|
||||
|
||||
#if defined(__INTEL_COMPILER)
|
||||
# pragma warning pop
|
||||
#endif
|
||||
}
|
||||
} //namespace cloonel
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "physicsfswrapper.hpp"
|
||||
#include "gameplaysceneclassic.hpp"
|
||||
#include "vector.hpp"
|
||||
#include "casts.hpp"
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <ciso646>
|
||||
|
@ -45,7 +46,7 @@ namespace {
|
|||
///------------------------------------------------------------------------------
|
||||
int main (int, char* parArgv[]) {
|
||||
#if defined(NDEBUG)
|
||||
std::srand(static_cast<unsigned int>(std::time(nullptr)));
|
||||
std::srand(cloonel::checked_numcast<unsigned int>(std::time(nullptr)));
|
||||
#else
|
||||
std::srand(static_cast<unsigned int>(DEF_RANDOM_SEED));
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue