summaryrefslogtreecommitdiff
path: root/node/Path.hpp
diff options
context:
space:
mode:
authorJoseph Henry <josephjah@gmail.com>2018-05-02 11:22:07 -0700
committerJoseph Henry <josephjah@gmail.com>2018-05-02 11:22:07 -0700
commit1debe2292d85e2d377064f74246244ac607046bf (patch)
treed2d17652451c4d0d92b17f65bd9de66638389bc0 /node/Path.hpp
parent6a2ba4baca326272c45930208b70cfedf8cb1638 (diff)
downloadinfinitytier-1debe2292d85e2d377064f74246244ac607046bf.tar.gz
infinitytier-1debe2292d85e2d377064f74246244ac607046bf.zip
Cleanup. Misc type conversion and signedness fixes
Diffstat (limited to 'node/Path.hpp')
-rw-r--r--node/Path.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/node/Path.hpp b/node/Path.hpp
index 5751d326..7ce6e0f1 100644
--- a/node/Path.hpp
+++ b/node/Path.hpp
@@ -303,11 +303,11 @@ public:
*/
inline float computeQuality(const int64_t now)
{
- float latency_contrib = _meanLatency ? 1.0 / _meanLatency : 0;
- float jitter_contrib = _jitter ? 1.0 / _jitter : 0;
+ float latency_contrib = _meanLatency ? (float)1.0 / _meanLatency : 0;
+ float jitter_contrib = _jitter ? (float)1.0 / _jitter : 0;
float throughput_contrib = _meanThroughput ? _meanThroughput / 1000000 : 0; // in Mbps
float age_contrib = _meanAge > 0 ? (float)sqrt(_meanAge) : 1;
- float error_contrib = 1.0 - _meanPacketErrorRatio;
+ float error_contrib = (float)1.0 - _meanPacketErrorRatio;
float sum = (latency_contrib + jitter_contrib + throughput_contrib + error_contrib) / age_contrib;
_lastComputedQuality = sum * (long)((_ipScope) + 1);
return _lastComputedQuality;