[core] Fix performance-type-promotion-in-math-fn errors in header files
As reported by clang-tidy-8.
This commit is contained in:
@@ -213,8 +213,8 @@ public:
|
||||
// combining pos and offset to reduce number of vertex attributes passed to shader (8 max for some devices)
|
||||
{{static_cast<int16_t>(labelAnchor.x),
|
||||
static_cast<int16_t>(labelAnchor.y),
|
||||
static_cast<int16_t>(::round(o.x * 32)), // use 1/32 pixels for placement
|
||||
static_cast<int16_t>(::round((o.y + glyphOffsetY) * 32))}},
|
||||
static_cast<int16_t>(std::round(o.x * 32)), // use 1/32 pixels for placement
|
||||
static_cast<int16_t>(std::round((o.y + glyphOffsetY) * 32))}},
|
||||
{{tx, ty, aSizeMin, aSizeMax}},
|
||||
{{static_cast<int16_t>(pixelOffset.x * 16),
|
||||
static_cast<int16_t>(pixelOffset.y * 16),
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/property_value.hpp>
|
||||
#include <mbgl/renderer/property_evaluation_parameters.hpp>
|
||||
#include <mbgl/renderer/possibly_evaluated_property_value.hpp>
|
||||
#include <mbgl/renderer/cross_faded_property_evaluator.hpp>
|
||||
#include <mbgl/renderer/possibly_evaluated_property_value.hpp>
|
||||
#include <mbgl/renderer/property_evaluation_parameters.hpp>
|
||||
#include <mbgl/style/property_value.hpp>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -31,7 +33,7 @@ public:
|
||||
returnExpression.useIntegerZoom = true;
|
||||
return ResultType(returnExpression);
|
||||
}
|
||||
return ResultType(expression.evaluate(floor(parameters.z)));
|
||||
return ResultType(expression.evaluate(std::floor(parameters.z)));
|
||||
} else {
|
||||
if (!expression.isFeatureConstant() || !expression.isRuntimeConstant()) {
|
||||
return ResultType(expression);
|
||||
@@ -66,7 +68,7 @@ public:
|
||||
if (!expression.isFeatureConstant() || !expression.isRuntimeConstant()) {
|
||||
return ResultType(expression);
|
||||
} else {
|
||||
const T evaluated = expression.evaluate(floor(parameters.z));
|
||||
const T evaluated = expression.evaluate(std::floor(parameters.z));
|
||||
return ResultType(calculate(evaluated, evaluated, evaluated));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/property_expression.hpp>
|
||||
#include <mbgl/renderer/cross_faded_property_evaluator.hpp>
|
||||
#include <mbgl/style/property_expression.hpp>
|
||||
#include <mbgl/util/interpolate.hpp>
|
||||
#include <mbgl/util/variant.hpp>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
template <class T>
|
||||
@@ -110,9 +112,10 @@ public:
|
||||
[&] (const Faded<T>& constant_) { return constant_; },
|
||||
[&] (const style::PropertyExpression<T>& expression) {
|
||||
if (!expression.isZoomConstant()) {
|
||||
const T min = expression.evaluate(floor(zoom), feature, availableImages, canonical, defaultValue);
|
||||
const T min =
|
||||
expression.evaluate(std::floor(zoom), feature, availableImages, canonical, defaultValue);
|
||||
const T max =
|
||||
expression.evaluate(floor(zoom) + 1, feature, availableImages, canonical, defaultValue);
|
||||
expression.evaluate(std::floor(zoom) + 1, feature, availableImages, canonical, defaultValue);
|
||||
return Faded<T> {min, max};
|
||||
} else {
|
||||
const T evaluated = expression.evaluate(feature, availableImages, defaultValue);
|
||||
|
||||
Reference in New Issue
Block a user