Cast result as int to avoid error about conversion from double to int

Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/824fd641
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/824fd641
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/824fd641

Branch: refs/heads/sphinx-docs
Commit: 824fd6411494be06fc8e4c10604b92a9d164015c
Parents: 870fe0e
Author: Daniel Gruno <[email protected]>
Authored: Fri Apr 26 15:35:39 2013 +0200
Committer: Daniel Gruno <[email protected]>
Committed: Fri Apr 26 15:35:39 2013 +0200

----------------------------------------------------------------------
 tools/jtest/jtest.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/824fd641/tools/jtest/jtest.cc
----------------------------------------------------------------------
diff --git a/tools/jtest/jtest.cc b/tools/jtest/jtest.cc
index 621ee48..b589d1a 100644
--- a/tools/jtest/jtest.cc
+++ b/tools/jtest/jtest.cc
@@ -3050,7 +3050,7 @@ static int get_zipf(double v) {
   if (zipf_bucket_size == 1)
     return m;
   double x = zipf_table[m], y = zipf_table[m+1];
-  m += (v - x) / (y - x);
+  m += static_cast<int> ((v - x) / (y - x));
   return m;
 }
 

Reply via email to