From ec665cc24c79ce58bc54a4427133deda246d2047 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 14 Aug 2014 13:12:25 +0200 Subject: [PATCH] Fix the remaining warnings on the intel compiler. --- src/casts.hpp | 10 ++++++++++ src/main.cpp | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/casts.hpp b/src/casts.hpp index 24a2192..0a3d144 100644 --- a/src/casts.hpp +++ b/src/casts.hpp @@ -32,12 +32,22 @@ namespace cloonel { template 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(parFrom); #else const To retVal = static_cast(parFrom); assert(static_cast(retVal) == parFrom); return retVal; +#endif + +#if defined(__INTEL_COMPILER) +# pragma warning pop #endif } } //namespace cloonel diff --git a/src/main.cpp b/src/main.cpp index d03f5db..5fe901e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,7 @@ #include "physicsfswrapper.hpp" #include "gameplaysceneclassic.hpp" #include "vector.hpp" +#include "casts.hpp" #include #include #include @@ -45,7 +46,7 @@ namespace { ///------------------------------------------------------------------------------ int main (int, char* parArgv[]) { #if defined(NDEBUG) - std::srand(static_cast(std::time(nullptr))); + std::srand(cloonel::checked_numcast(std::time(nullptr))); #else std::srand(static_cast(DEF_RANDOM_SEED)); #endif