]> www.ginac.de Git - cln.git/commitdiff
Remove CL_REQUIRE/CL_PROVIDE(cl_I_doublefactorial) as it's unnecessary.
authorAlexei Sheplyakov <varg@theor.jinr.ru>
Thu, 21 Aug 2008 12:02:59 +0000 (16:02 +0400)
committerAlexei Sheplyakov <varg@theor.jinr.ru>
Wed, 27 Aug 2008 04:41:06 +0000 (08:41 +0400)
The only user of doublefakul_table array is doublefactorial function, so
put that array inside it in order to avoid possible static initialization
order problems.

src/integer/misc/combin/cl_I_doublefactorial.cc

index 0f4621a691a140107440f20722f07f9d76d1d8af..4508461b417568f2ca0846cbf4ddef245b8a12f4 100644 (file)
@@ -3,8 +3,6 @@
 // General includes.
 #include "cl_sysdep.h"
 
-CL_PROVIDE(cl_I_doublefactorial)
-
 // Specification.
 #include "cln/integer.h"
 
@@ -28,7 +26,9 @@ namespace cln {
   //     ord2(n!) = n - logcount(n) to account both for 2^m and for powers of
   //     two in factorial(m).
 
-static cl_I const doublefakul_table [] = {
+const cl_I doublefactorial (uintL n) // assume n >= 0 small
+{
+       static cl_I const doublefakul_table [] = {
         1,
         1UL,
         1UL*2,
@@ -124,10 +124,8 @@ static cl_I const doublefakul_table [] = {
         #endif
         #endif
         #endif
-};
+       };
 
-const cl_I doublefactorial (uintL n) // assume n >= 0 small
-{
       if (n < sizeof(doublefakul_table)/sizeof(cl_I))
         { return doublefakul_table[n]; }
         else {
@@ -181,5 +179,3 @@ const cl_I doublefactorial (uintL n) // assume n >= 0 small
 
 }  // namespace cln
 
-CL_PROVIDE_END(cl_I_doublefactorial)
-