summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-30 15:10:09 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-30 19:16:42 +0300
commit40def6ddac0b7487de9fea56ee0720c73d8cf8b0 (patch)
treeefceec4f2c6e122763b9efab3af084f857e113d2
parentfe89bdd964cdc8c9d6bdb6e70ef16d5581a666b9 (diff)
downloadqtlocation-mapboxgl-40def6ddac0b7487de9fea56ee0720c73d8cf8b0.tar.gz
[core] Fix bugprone-integer-division errors
As reported by clang-tidy-8.too_small
-rw-r--r--src/mbgl/tile/custom_geometry_tile.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mbgl/tile/custom_geometry_tile.cpp b/src/mbgl/tile/custom_geometry_tile.cpp
index e13b16a4f1..68e120750d 100644
--- a/src/mbgl/tile/custom_geometry_tile.cpp
+++ b/src/mbgl/tile/custom_geometry_tile.cpp
@@ -8,6 +8,8 @@
#include <mbgl/style/custom_tile_loader.hpp>
#include <mapbox/geojsonvt.hpp>
+
+#include <cassert>
#include <utility>
namespace mbgl {
@@ -32,7 +34,8 @@ void CustomGeometryTile::setTileData(const GeoJSON& geoJSON) {
auto featureData = mapbox::feature::feature_collection<int16_t>();
if (geoJSON.is<FeatureCollection>() && !geoJSON.get<FeatureCollection>().empty()) {
- const double scale = util::EXTENT / options->tileSize;
+ auto scale = util::EXTENT / options->tileSize;
+ assert(util::EXTENT % options->tileSize == 0);
mapbox::geojsonvt::TileOptions vtOptions;
vtOptions.extent = util::EXTENT;