diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-05-29 14:07:32 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-06-04 10:43:21 +0200 |
commit | d66251234d7c0feb875b9490ca945ee9d43306c1 (patch) | |
tree | 3c661091edb98ac15a8711e93fde774a5e6e824a /src/mbgl/storage | |
parent | d232a7a6f30927cb7e9107c9357bc53e2b1ae0f9 (diff) | |
download | qtlocation-mapboxgl-d66251234d7c0feb875b9490ca945ee9d43306c1.tar.gz |
[core] don't use floating point versions of pow/log
GLIBC 2.27 added new versioned symbols of powf and logf, while the double versions of pow and log remained stable.
Prefer the double version to avoid introducing a dependency on a newer version of GLIBC than strictly necessary.
See https://lists.gnu.org/archive/html/info-gnu/2018-02/msg00000.html
Diffstat (limited to 'src/mbgl/storage')
-rw-r--r-- | src/mbgl/storage/resource.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/storage/resource.cpp b/src/mbgl/storage/resource.cpp index ba85f87dea..c51db44548 100644 --- a/src/mbgl/storage/resource.cpp +++ b/src/mbgl/storage/resource.cpp @@ -21,7 +21,7 @@ static std::string getQuadKey(int32_t x, int32_t y, int8_t z) { } static mapbox::geometry::point<double> getMercCoord(int32_t x, int32_t y, int8_t z) { - double resolution = (util::M2PI * util::EARTH_RADIUS_M / 256) / std::pow(2.0f, z); + double resolution = (util::M2PI * util::EARTH_RADIUS_M / 256) / std::pow(2, z); return { x * resolution - util::M2PI * util::EARTH_RADIUS_M / 2, y * resolution - util::M2PI * util::EARTH_RADIUS_M / 2, @@ -30,7 +30,7 @@ static mapbox::geometry::point<double> getMercCoord(int32_t x, int32_t y, int8_t static std::string getTileBBox(int32_t x, int32_t y, int8_t z) { // Alter the y for the Google/OSM tile scheme. - y = std::pow(2.0f, z) - y - 1; + y = std::pow(2, z) - y - 1; auto min = getMercCoord(x * 256, y * 256, z); auto max = getMercCoord((x + 1) * 256, (y + 1) * 256, z); |