Author: pfg
Date: Tue Apr 21 17:41:29 2015
New Revision: 1675168
URL: http://svn.apache.org/r1675168
Log:
Minor cleanups in the random generator code.
Drop unused variables.
Enhance slightly the naming of static variables.
Modified:
openoffice/trunk/main/sc/source/core/tool/interpr1.cxx
Modified: openoffice/trunk/main/sc/source/core/tool/interpr1.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/core/tool/interpr1.cxx?rev=1675168r1=1675167r2=1675168view=diff
==
--- openoffice/trunk/main/sc/source/core/tool/interpr1.cxx (original)
+++ openoffice/trunk/main/sc/source/core/tool/interpr1.cxx Tue Apr 21 17:41:29
2015
@@ -1561,9 +1561,9 @@ b32MWC(void)
}
// Congruential
-#defineCNG ( cng = 69069 * cng + 13579 )
+#defineCNG ( ScCNG = 69069 * ScCNG + 13579 )
// Xorshift
-#defineXS ( xs ^= (xs 13), xs ^= (xs 17), xs ^= (xs 5) )
+#defineXS ( ScXS ^= (ScXS 13), ScXS ^= (ScXS 17), ScXS ^= (ScXS
5) )
#defineKISS (b32MWC() + CNG + XS)
@@ -1573,11 +1573,11 @@ void ScInterpreter::ScRandom()
static rtlRandomPool aPool = rtl_random_createPool();
static sal_Bool SqSeeded = sal_False;
-static sal_uInt32 i, x, cng, xs = 362436069;
+static sal_uInt32 ScCNG, ScXS = 362436069;
// Seeding for the PRNG
if (SqSeeded == sal_False) {
-rtl_random_getBytes(aPool, cng, sizeof(cng));
+rtl_random_getBytes(aPool, ScCNG, sizeof(ScCNG));
rtl_random_getBytes(aPool, nScRandomQ,
sizeof(nScRandomQ[0]) * SCRANDOMQ_SIZE);
SqSeeded = sal_True;