Commit c821ee36 authored by Gabriele Cosmo's avatar Gabriele Cosmo
Browse files

Fixed JIRA ticket CLHEP-156...

parent c6dec09e
......@@ -44,8 +44,8 @@ namespace CLHEP {
* @ingroup random
*/
typedef unsigned long int myID_t;
typedef unsigned long long int myuint_t;
using myID_t = std::uint32_t;
using myuint_t = unsigned long long int;
class MixMaxRng: public HepRandomEngine {
......
......@@ -222,24 +222,24 @@ void MixMaxRng::setSeed(long longSeed, int /* extraSeed */)
void MixMaxRng::setSeeds(const long* Seeds, int seedNum)
{
unsigned long seed0, seed1= 0, seed2= 0, seed3= 0;
myID_t seed0, seed1= 0, seed2= 0, seed3= 0;
if( seedNum < 1 ) { // Assuming at least 2 seeds in vector...
seed0= static_cast<unsigned long>(Seeds[0]) & MASK32;
seed1= static_cast<unsigned long>(Seeds[1]) & MASK32;
seed0= static_cast<myID_t>(Seeds[0]) & MASK32;
seed1= static_cast<myID_t>(Seeds[1]) & MASK32;
}
else
{
if( seedNum < 4 ) {
seed0= static_cast<unsigned long>(Seeds[0]) & MASK32;
if( seedNum > 1){ seed1= static_cast<unsigned long>(Seeds[1]) & MASK32; }
if( seedNum > 2){ seed2= static_cast<unsigned long>(Seeds[2]) & MASK32; }
seed0= static_cast<myID_t>(Seeds[0]) & MASK32;
if( seedNum > 1){ seed1= static_cast<myID_t>(Seeds[1]) & MASK32; }
if( seedNum > 2){ seed2= static_cast<myID_t>(Seeds[2]) & MASK32; }
}
if( seedNum >= 4 ) {
seed0= static_cast<unsigned long>(Seeds[0]) & MASK32;
seed1= static_cast<unsigned long>(Seeds[1]) & MASK32;
seed2= static_cast<unsigned long>(Seeds[2]) & MASK32;
seed3= static_cast<unsigned long>(Seeds[3]) & MASK32;
seed0= static_cast<myID_t>(Seeds[0]) & MASK32;
seed1= static_cast<myID_t>(Seeds[1]) & MASK32;
seed2= static_cast<myID_t>(Seeds[2]) & MASK32;
seed3= static_cast<myID_t>(Seeds[3]) & MASK32;
}
}
theSeed = Seeds[0];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment