star-sp

Random number generators and distributions
git clone git://git.meso-star.fr/star-sp.git
Log | Files | Refs | README | LICENSE

commit c48c32311e9beaa6eb01b93d678281626515c6af
parent 179d474e4484fda313cd385dce77843775a706b3
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 18 Nov 2015 16:40:36 +0100

Fix warnings with MSVC14

Disable warnings in the boost headers.

Diffstat:
Msrc/ssp_rng.c | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/ssp_rng.c b/src/ssp_rng.c @@ -34,11 +34,17 @@ #include <rsys/mem_allocator.h> #ifdef COMPILER_CL - /* The random C++11 library is bugged on MSVC 12. Use the boost version */ + /* Disable some warnings in boost includes */ + #pragma warning(push) + #pragma warning(disable:4244) /* possible loss of data due to data conversion */ + #pragma warning(disable:4458) /* declaration of a variable hides class member */ + + /* The random C++11 library is bugged on MSVC 12 & 14. Use the boost version */ #include <boost/random.hpp> #include <boost/random/random_device.hpp> #define RAN_NAMESPACE boost::random + #pragma warning(pop) #pragma warning(push) #pragma warning(disable:4706) /* Assignment in conditional expression */ #else @@ -46,11 +52,11 @@ #define RAN_NAMESPACE std #endif +/* disable some warnings in Random123 includes */ #ifdef COMPILER_GCC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" /* unsafe conversion */ #elif defined(COMPILER_CL) - /* disable some warnings in Random123 includes */ #pragma warning(push) #pragma warning(disable:4100) /* unreferenced formal parameter */ #pragma warning(disable:4127) /* conditional expression is constant */ @@ -261,7 +267,6 @@ template<typename RNG> static double rng_cxx_canonical(void* data) { - /* On Visual Studio 2013, the generate_canonical method is bugged */ RNG* rng = (RNG*)data; ASSERT(rng); return RAN_NAMESPACE::generate_canonical<double, 48>(*rng);