2013-09-26 17:14:40 +02:00

27 lines
1.1 KiB
Plaintext

$NetBSD: patch-ab,v 1.1 2007/01/14 16:28:40 rillig Exp $
SunPro complains about an overloading abiguity when std::log(2) is
called. It doesn't know whether to take log(double) or log(long double).
There also seems to be some namespace issues, maybe an #include
directive for a standard header has been placed into a namespace?
--- 7z/AriBitCoder.cc.orig 2003-02-10 20:25:06.000000000 +0100
+++ 7z/AriBitCoder.cc 2007-01-14 17:00:56.250636464 +0100
@@ -10,10 +10,12 @@ static const double kDummyMultMid = (1.0
CPriceTables::CPriceTables()
{
- double aLn2 = log(2);
- double aLnAll = log(kBitModelTotal >> kNumMoveReducingBits);
+ using ::std::log;
+ using ::std::fabs;
+ double aLn2 = log(2.0);
+ double aLnAll = log((double)(kBitModelTotal >> kNumMoveReducingBits));
for(UINT32 i = 1; i < (kBitModelTotal >> kNumMoveReducingBits) - 1; i++)
- m_StatePrices[i] = UINT32((fabs(aLnAll - log(i)) / aLn2 + kDummyMultMid) * kBitPrice);
+ m_StatePrices[i] = UINT32((fabs(aLnAll - log((double)i)) / aLn2 + kDummyMultMid) * kBitPrice);
}
CPriceTables g_PriceTables;