diff --git a/src/devices/uan/uan-mac-rc-gw.cc b/src/devices/uan/uan-mac-rc-gw.cc index 71a12e533..26c83177b 100644 --- a/src/devices/uan/uan-mac-rc-gw.cc +++ b/src/devices/uan/uan-mac-rc-gw.cc @@ -655,7 +655,7 @@ UanMacRcGw::ComputeExpBOverA (uint32_t n, uint32_t a, uint32_t ldlh, std::vector { double sum = 0; - uint32_t lt = 8.0 * (m_ctsSizeN + ldlh + m_ackSize); + uint32_t lt = 8 * (m_ctsSizeN + ldlh + m_ackSize); for (uint32_t k = 1; k <= n; k++) { double num = 8.0 * m_ctsSizeG + k * lt; diff --git a/src/devices/uan/uan-prop-model.cc b/src/devices/uan/uan-prop-model.cc index 84756268f..2d2124a02 100644 --- a/src/devices/uan/uan-prop-model.cc +++ b/src/devices/uan/uan-prop-model.cc @@ -207,7 +207,7 @@ UanPdp::SumTapsFromMaxC (Time delay, Time duration) const return m_taps[0].GetAmp (); } - uint32_t numTaps = (uint32_t)(duration.GetSeconds () / (double) m_resolution.GetSeconds () + 0.5); + uint32_t numTaps = static_cast (duration.GetSeconds () / m_resolution.GetSeconds () + 0.5); double maxAmp = -1; uint32_t maxTapIndex = 0; @@ -219,7 +219,7 @@ UanPdp::SumTapsFromMaxC (Time delay, Time duration) const maxTapIndex = i; } } - uint32_t start = maxTapIndex + delay.GetSeconds () / m_resolution.GetSeconds (); + uint32_t start = maxTapIndex + static_cast (delay.GetSeconds () / m_resolution.GetSeconds ()); uint32_t end = std::min (start + numTaps, GetNTaps ()); std::complex sum = 0; for (uint32_t i = start; i < end; i++) @@ -239,7 +239,7 @@ UanPdp::SumTapsFromMaxNc (Time delay, Time duration) const return abs (m_taps[0].GetAmp ()); } - uint32_t numTaps = (uint32_t)(duration.GetSeconds () / (double) m_resolution.GetSeconds () + 0.5); + uint32_t numTaps = static_cast (duration.GetSeconds () / m_resolution.GetSeconds () + 0.5); double maxAmp = -1; uint32_t maxTapIndex = 0; @@ -253,7 +253,7 @@ UanPdp::SumTapsFromMaxNc (Time delay, Time duration) const } - uint32_t start = maxTapIndex + delay.GetSeconds () / m_resolution.GetSeconds (); + uint32_t start = maxTapIndex + static_cast (delay.GetSeconds () / m_resolution.GetSeconds ()); uint32_t end = std::min (start + numTaps, GetNTaps ()); double sum = 0; for (uint32_t i = start; i < end; i++)