/*! \file guid.cpp
** \brief Template File
**
-** $Id: guid.cpp,v 1.4 2005/01/13 06:48:39 darco Exp $
+** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
{
next=x;
}
-
+
unsigned long i32()
{
static const unsigned long a(1664525);
static const unsigned long c(1013904223);
-
+
return next=next*a+c;
}
float f()
{
static const float m(int(65535));
-
+
return float(i16())/m;
}
-
+
unsigned long operator()(const unsigned long& m)
{
if(m==65536)
{
//subtractive_rng _c(clock());
unsigned short* data(reinterpret_cast<unsigned short *>(&x));
- data[0]=_a(65536);
- data[1]=_a(65536);
- data[2]=_a(65536);
- data[3]=_a(65536);
+ data[0]=_a(65536);
+ data[1]=_a(65536);
+ data[2]=_a(65536);
+ data[3]=_a(65536);
}
#else
static void get_rand_long_long(uint64_t &x)
{
_GUID* guid(reinterpret_cast<_GUID*>(&x));
- CoCreateGuid(guid);
+ CoCreateGuid(guid);
}
#else
synfig::GUID
synfig::GUID::hasher(const String& str)
-{
+{
#ifdef HASH_MAP_H
hash<const char*> string_hash_;
const unsigned int seed(
seed=(seed>>(32-(i%24)))^(seed<<(i%24))
}
#endif
-
+
GUID_RNG random(seed);
GUID ret(0);
ret.data.u_32.a=random(~(unsigned int)0);