X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fguid.cpp;h=a2a4ac4ce2239158e49e2ce935bdc827565a8f15;hb=4f9e4d835da8089a953dfa5f508643c538924921;hp=7740c545a0a9d85e0eb6967be5058fa9a3db2b8e;hpb=28f28705612902c15cd0702cc891fba35bf2d2df;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/guid.cpp b/synfig-core/trunk/src/synfig/guid.cpp index 7740c54..a2a4ac4 100644 --- a/synfig-core/trunk/src/synfig/guid.cpp +++ b/synfig-core/trunk/src/synfig/guid.cpp @@ -2,19 +2,20 @@ /*! \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 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -86,12 +87,12 @@ public: { next=x; } - + unsigned long i32() { static const unsigned long a(1664525); static const unsigned long c(1013904223); - + return next=next*a+c; } @@ -103,10 +104,10 @@ public: float f() { static const float m(int(65535)); - + return float(i16())/m; } - + unsigned long operator()(const unsigned long& m) { if(m==65536) @@ -145,10 +146,10 @@ static void _get_rand_long_long(uint64_t &x) { //subtractive_rng _c(clock()); unsigned short* data(reinterpret_cast(&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 @@ -159,7 +160,7 @@ static void _get_rand_long_long(uint64_t &x) static void get_rand_long_long(uint64_t &x) { _GUID* guid(reinterpret_cast<_GUID*>(&x)); - CoCreateGuid(guid); + CoCreateGuid(guid); } #else @@ -194,7 +195,7 @@ synfig::GUID::make_unique() synfig::GUID synfig::GUID::hasher(const String& str) -{ +{ #ifdef HASH_MAP_H hash string_hash_; const unsigned int seed( @@ -210,7 +211,7 @@ synfig::GUID::hasher(const String& str) 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);