diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-20 12:38:09 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-23 12:09:09 +0200 |
commit | 37802eec36aae3cb84c7f73a48652d9959489243 (patch) | |
tree | 6e5b869babc4e1d23171a9f470b9c822b1c77cae /src/mbgl/text | |
parent | 991cfee7df24acf50893c669d3a135e474945e97 (diff) | |
download | qtlocation-mapboxgl-37802eec36aae3cb84c7f73a48652d9959489243.tar.gz |
[core] Fix performance-type-promotion-in-math-fn errors
As reported by clang-tidy-8.
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/cross_tile_symbol_index.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/text/get_anchors.cpp | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/mbgl/text/cross_tile_symbol_index.cpp b/src/mbgl/text/cross_tile_symbol_index.cpp index 76697fb62a..1eddc08146 100644 --- a/src/mbgl/text/cross_tile_symbol_index.cpp +++ b/src/mbgl/text/cross_tile_symbol_index.cpp @@ -76,8 +76,7 @@ CrossTileSymbolLayerIndex::CrossTileSymbolLayerIndex(uint32_t& maxCrossTileID_) * so that they match the new wrapped version of the map. */ void CrossTileSymbolLayerIndex::handleWrapJump(float newLng) { - - const int wrapDelta = ::round((newLng - lng) / 360); + const int wrapDelta = std::round((newLng - lng) / 360); if (wrapDelta != 0) { std::map<uint8_t, std::map<OverscaledTileID,TileLayerIndex>> newIndexes; for (auto& zoomIndex : indexes) { diff --git a/src/mbgl/text/get_anchors.cpp b/src/mbgl/text/get_anchors.cpp index 714bc79fea..c8f5f470b4 100644 --- a/src/mbgl/text/get_anchors.cpp +++ b/src/mbgl/text/get_anchors.cpp @@ -61,7 +61,7 @@ static Anchors resample(const GeometryCoordinates& line, if (x >= 0 && x < util::EXTENT && y >= 0 && y < util::EXTENT && markedDistance - halfLabelLength >= 0.0f && markedDistance + halfLabelLength <= lineLength) { - Anchor anchor(::round(x), ::round(y), angle, i); + Anchor anchor(std::round(x), std::round(y), angle, i); if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) { anchors.push_back(anchor); @@ -104,7 +104,7 @@ Anchors getAnchors(const GeometryCoordinates& line, const float angleWindowSize = getAngleWindowSize(textLeft, textRight, glyphSize, boxScale); - const float shapedLabelLength = fmax(textRight - textLeft, iconRight - iconLeft); + const float shapedLabelLength = std::fmax(textRight - textLeft, iconRight - iconLeft); const float labelLength = shapedLabelLength * boxScale; // Is the line continued from outside the tile boundary? @@ -143,8 +143,8 @@ optional<Anchor> getCenterAnchor(const GeometryCoordinates& line, } const float angleWindowSize = getAngleWindowSize(textLeft, textRight, glyphSize, boxScale); - const float labelLength = fmax(textRight - textLeft, iconRight - iconLeft) * boxScale; - + const float labelLength = std::fmax(textRight - textLeft, iconRight - iconLeft) * boxScale; + float prevDistance = 0; const float centerDistance = getLineLength(line) / 2; @@ -161,7 +161,7 @@ optional<Anchor> getCenterAnchor(const GeometryCoordinates& line, x = util::interpolate(float(a.x), float(b.x), t), y = util::interpolate(float(a.y), float(b.y), t); - Anchor anchor(::round(x), ::round(y), util::angle_to(b, a), i); + Anchor anchor(std::round(x), std::round(y), util::angle_to(b, a), i); if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) { return anchor; |