diff options
author | Grant Limberg <grant.limberg@zerotier.com> | 2019-06-17 15:32:27 -0700 |
---|---|---|
committer | Grant Limberg <grant.limberg@zerotier.com> | 2019-06-17 15:32:27 -0700 |
commit | 21e844cd82f8b6bb03f51de996f5fb91cd3fe1f6 (patch) | |
tree | fc76dc87732d90e81472caa2bf1a478e400cb99d /node/Path.hpp | |
parent | 4e2439bd127c399bc31a44611c5226ed51681728 (diff) | |
parent | c5a07c7f20dc54d88a2f6b8b5c4462510b042325 (diff) | |
download | infinitytier-21e844cd82f8b6bb03f51de996f5fb91cd3fe1f6.tar.gz infinitytier-21e844cd82f8b6bb03f51de996f5fb91cd3fe1f6.zip |
Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev
Diffstat (limited to 'node/Path.hpp')
-rw-r--r-- | node/Path.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/node/Path.hpp b/node/Path.hpp index f0198bde..ed3e907f 100644 --- a/node/Path.hpp +++ b/node/Path.hpp @@ -442,7 +442,7 @@ public: uint64_t id = it->first; memcpy(qosBuffer, &id, sizeof(uint64_t)); qosBuffer+=sizeof(uint64_t); - uint16_t holdingTime = (now - it->second); + uint16_t holdingTime = (uint16_t)(now - it->second); memcpy(qosBuffer, &holdingTime, sizeof(uint16_t)); qosBuffer+=sizeof(uint16_t); len+=sizeof(uint64_t)+sizeof(uint16_t); @@ -594,11 +594,11 @@ public: float throughput_cv = _throughputSamples.mean() > 0 ? _throughputSamples.stddev() / _throughputSamples.mean() : 1; // Form an exponential cutoff and apply contribution weights - float pdv_contrib = exp((-1)*normalized_pdv) * ZT_PATH_CONTRIB_PDV; - float latency_contrib = exp((-1)*normalized_la) * ZT_PATH_CONTRIB_LATENCY; + float pdv_contrib = expf((-1.0f)*normalized_pdv) * (float)ZT_PATH_CONTRIB_PDV; + float latency_contrib = expf((-1.0f)*normalized_la) * (float)ZT_PATH_CONTRIB_LATENCY; // Throughput Disturbance Coefficient - float throughput_disturbance_contrib = exp((-1)*throughput_cv) * ZT_PATH_CONTRIB_THROUGHPUT_DISTURBANCE; + float throughput_disturbance_contrib = expf((-1.0f)*throughput_cv) * (float)ZT_PATH_CONTRIB_THROUGHPUT_DISTURBANCE; _throughputDisturbanceSamples.push(throughput_cv); _lastComputedThroughputDistCoeff = _throughputDisturbanceSamples.mean(); |