Removed SignedRound and replaced std::round with std::lround where needed

Also see https://clang.llvm.org/extra/clang-tidy/checks/bugprone/incorrect-roundings.html

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-07-06 01:25:08 +02:00
committed by Konstantin Pastbin
parent ae349462c6
commit 76d7ef146c
22 changed files with 67 additions and 60 deletions

View File

@@ -8,6 +8,7 @@
#include "base/file_name_utils.hpp"
#include "base/logging.hpp"
#include <cmath>
#include <fstream>
#include <iomanip>
#include <sstream>
@@ -125,7 +126,7 @@ geometry::Altitude SrtmTile::GetHeight(ms::LatLon const & coord) const
auto const ll = GetCoordInSeconds(coord);
return GetHeightRC(static_cast<size_t>(std::round(ll.m_lat)), static_cast<size_t>(std::round(ll.m_lon)));
return GetHeightRC(std::lround(ll.m_lat), std::lround(ll.m_lon));
}
geometry::Altitude SrtmTile::GetHeightRC(size_t row, size_t col) const
@@ -142,7 +143,7 @@ double SrtmTile::GetTriangleHeight(ms::LatLon const & coord) const
auto const ll = GetCoordInSeconds(coord);
m2::Point<int> const p1(static_cast<int>(std::round(ll.m_lon)), static_cast<int>(std::round(ll.m_lat)));
m2::Point<int> const p1(std::lround(ll.m_lon), std::lround(ll.m_lat));
auto p2 = p1;
if (p2.x > ll.m_lon)