Author: niels
Date: Mon May 26 15:48:57 2014
New Revision: 9460
URL: http://svn.gna.org/viewcvs/service-tech?rev=9460&view=rev
Log:
* fixed a compiler warning
* avoided log2 function (only introduced in C99)
Modified:
trunk/lola2/src/InputOutput/Reporter.cc
trunk/lola2/src/Planning/Task.cc
Modified: trunk/lola2/src/InputOutput/Reporter.cc
URL:
http://svn.gna.org/viewcvs/service-tech/trunk/lola2/src/InputOutput/Reporter.cc?rev=9460&r1=9459&r2=9460&view=diff
==============================================================================
--- trunk/lola2/src/InputOutput/Reporter.cc (original)
+++ trunk/lola2/src/InputOutput/Reporter.cc Mon May 26 15:48:57 2014
@@ -310,19 +310,19 @@
static const int w = 72;
// the ratio of complete-to-incomplete.
- float ratio = i / (float)n;
+ float ratio = i / static_cast<float>(n);
// the width of the completed bar
const int c = static_cast<int>(ratio * w);
// if there is no change since the last call, return
- if ((int)(ratio * 100) - old_p == 0)
+ if (static_cast<int>(ratio * 100) - old_p == 0)
{
return;
}
// store this call's percentage
- old_p = ratio * 100;
+ old_p = static_cast<int>(ratio * 100);
// in all but the first call, clear the line
if (not called)
Modified: trunk/lola2/src/Planning/Task.cc
URL:
http://svn.gna.org/viewcvs/service-tech/trunk/lola2/src/Planning/Task.cc?rev=9460&r1=9459&r2=9460&view=diff
==============================================================================
--- trunk/lola2/src/Planning/Task.cc (original)
+++ trunk/lola2/src/Planning/Task.cc Mon May 26 15:48:57 2014
@@ -1142,7 +1142,7 @@
RT::rep->status("Bloom filter: probability of false positive is
%.10lf",
pow((1.0 - exp((-k * n) / m)), k));
RT::rep->status("Bloom filter: optimal number of hash functions is
%.1f",
- log2(m / n));
+ log(m / n) / log(2.0));
}
// in case AG is used, the result needs to be negated
--
You received this e-mail, because you subscribed the mailing list
"service-tech-commits" which will forward you any e-mail addressed to
[email protected]. If you want to unsubscribe or make any changes to
your subscription, please go to
https://mail.gna.org/listinfo/service-tech-commits.