[msvc] Fix compilation errors and warnings (#141)
This commit is contained in:
@@ -15,12 +15,12 @@ public:
|
||||
double base;
|
||||
|
||||
double interpolationFactor(const Range<double>& inputLevels, const double input) const {
|
||||
return util::interpolationFactor(base,
|
||||
return util::interpolationFactor(static_cast<float>(base),
|
||||
Range<float> {
|
||||
static_cast<float>(inputLevels.min),
|
||||
static_cast<float>(inputLevels.max)
|
||||
},
|
||||
input);
|
||||
static_cast<float>(input));
|
||||
}
|
||||
|
||||
bool operator==(const ExponentialInterpolator& rhs) const {
|
||||
@@ -33,12 +33,12 @@ public:
|
||||
CubicBezierInterpolator(double x1_, double y1_, double x2_, double y2_) : ub(x1_, y1_, x2_, y2_) {}
|
||||
|
||||
double interpolationFactor(const Range<double>& inputLevels, const double input) const {
|
||||
return ub.solve(util::interpolationFactor(1.0,
|
||||
return ub.solve(util::interpolationFactor(1.0f,
|
||||
Range<float> {
|
||||
static_cast<float>(inputLevels.min),
|
||||
static_cast<float>(inputLevels.max)
|
||||
},
|
||||
input),
|
||||
static_cast<float>(input)),
|
||||
1e-6);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <mbgl/util/constants.hpp>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
#include <tuple>
|
||||
@@ -199,7 +200,7 @@ inline OverscaledTileID OverscaledTileID::unwrapTo(int16_t newWrap) const {
|
||||
}
|
||||
|
||||
inline UnwrappedTileID::UnwrappedTileID(uint8_t z_, int64_t x_, int64_t y_)
|
||||
: wrap((x_ < 0 ? x_ - (1ll << z_) + 1 : x_) / (1ll << z_)),
|
||||
: wrap(static_cast<int16_t>((x_ < 0 ? x_ - (1ll << z_) + 1 : x_) / (1ll << z_))),
|
||||
canonical(
|
||||
z_,
|
||||
static_cast<uint32_t>(x_ - wrap * (1ll << z_)),
|
||||
@@ -247,7 +248,7 @@ inline OverscaledTileID UnwrappedTileID::overscaleTo(const uint8_t overscaledZ)
|
||||
}
|
||||
|
||||
inline float UnwrappedTileID::pixelsToTileUnits(const float pixelValue, const float zoom) const {
|
||||
return pixelValue * (util::EXTENT / (util::tileSize * std::pow(2, zoom - canonical.z)));
|
||||
return pixelValue * (static_cast<float>(util::EXTENT) / (static_cast<float>(util::tileSize) * std::pow(2.f, zoom - canonical.z)));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user