From 224a26ea7c938862d5410a46c97a08491de9ae4f Mon Sep 17 00:00:00 2001 From: Bertrand Bellenot <bertrand.bellenot@cern.ch> Date: Tue, 3 Oct 2017 17:44:14 +0200 Subject: [PATCH] replace the '_NN' variable by 'ROOT_MM_N' Following the observation from philippe: Macro named starting with underscore are technically reserved for/by the compiler --- math/mathcore/src/MixMaxEngineImpl.h | 18 +++++++++--------- math/mathcore/src/MixMaxEngineImpl17.cxx | 2 +- math/mathcore/src/MixMaxEngineImpl240.cxx | 2 +- math/mathcore/src/MixMaxEngineImpl256.cxx | 2 +- math/mathcore/src/mixmax.h | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/math/mathcore/src/MixMaxEngineImpl.h b/math/mathcore/src/MixMaxEngineImpl.h index 1f50baf224c..4dedd701b9b 100644 --- a/math/mathcore/src/MixMaxEngineImpl.h +++ b/math/mathcore/src/MixMaxEngineImpl.h @@ -8,11 +8,11 @@ #define ROOT_Math_MixMaxEngineImpl -#if (_NN==17) +#if (ROOT_MM_N==17) namespace mixmax_17 { -#elif (_NN==240) +#elif (ROOT_MM_N==240) namespace mixmax_240 { -#elif (_NN==256) +#elif (ROOT_MM_N==256) namespace mixmax_256 { #else namespace { @@ -31,11 +31,11 @@ namespace { #include <iostream> -#if (_NN==17) +#if (ROOT_MM_N==17) using namespace mixmax_17; -#elif (_NN==240) +#elif (ROOT_MM_N==240) using namespace mixmax_240; -#elif (_NN==256) +#elif (ROOT_MM_N==256) using namespace mixmax_256; #endif @@ -65,12 +65,12 @@ namespace ROOT { template<> -class MixMaxEngineImpl<_NN> { +class MixMaxEngineImpl<ROOT_MM_N> { rng_state_t * fRngState; public: - typedef MixMaxEngine<_NN,0>::StateInt_t StateInt_t; - typedef MixMaxEngine<_NN,0>::Result_t Result_t; + typedef MixMaxEngine<ROOT_MM_N,0>::StateInt_t StateInt_t; + typedef MixMaxEngine<ROOT_MM_N,0>::Result_t Result_t; MixMaxEngineImpl(uint64_t seed) { fRngState = rng_alloc(); diff --git a/math/mathcore/src/MixMaxEngineImpl17.cxx b/math/mathcore/src/MixMaxEngineImpl17.cxx index 93ec9000753..39ed0852a5d 100644 --- a/math/mathcore/src/MixMaxEngineImpl17.cxx +++ b/math/mathcore/src/MixMaxEngineImpl17.cxx @@ -1,7 +1,7 @@ // define number for used to Mixmax -#define _NN 17 +#define ROOT_MM_N 17 #include "MixMaxEngineImpl.h" diff --git a/math/mathcore/src/MixMaxEngineImpl240.cxx b/math/mathcore/src/MixMaxEngineImpl240.cxx index 5aa4c8b2788..ff0f865052f 100644 --- a/math/mathcore/src/MixMaxEngineImpl240.cxx +++ b/math/mathcore/src/MixMaxEngineImpl240.cxx @@ -1,7 +1,7 @@ // define number for used to Mixmax -#define _NN 240 +#define ROOT_MM_N 240 #include "MixMaxEngineImpl.h" diff --git a/math/mathcore/src/MixMaxEngineImpl256.cxx b/math/mathcore/src/MixMaxEngineImpl256.cxx index fa1d67adc1d..e437126678a 100644 --- a/math/mathcore/src/MixMaxEngineImpl256.cxx +++ b/math/mathcore/src/MixMaxEngineImpl256.cxx @@ -1,7 +1,7 @@ // define number for used to Mixmax -#define _NN 256 +#define ROOT_MM_N 256 #include "MixMaxEngineImpl.h" diff --git a/math/mathcore/src/mixmax.h b/math/mathcore/src/mixmax.h index 5a26c7b1ddd..80a3a4690c2 100644 --- a/math/mathcore/src/mixmax.h +++ b/math/mathcore/src/mixmax.h @@ -27,7 +27,7 @@ //extern "C" { //#endif -#ifndef _NN +#ifndef ROOT_MM_N #define N 240 /* The currently recommended generator is the three-parameter MIXMAX with N=240, s=487013230256099140, m=2^51+1 @@ -38,7 +38,7 @@ N=240, s=487013230256099140, m=2^51+1 Since the algorithm is linear in N, the cost per number is almost independent of N. */ #else -#define N _NN +#define N ROOT_MM_N #endif #ifndef __LP64__ -- GitLab