[pre-commit.ci] pre-commit autoupdate (#2192)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot]
2024-03-13 12:39:57 +01:00
committed by GitHub
parent 3a836b8fbb
commit 8bf3040da1
24 changed files with 45 additions and 61 deletions

View File

@@ -4,7 +4,7 @@ repos:
hooks:
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v18.1.1
hooks:
- id: clang-format
files: '.*\.(hpp|cpp|h)'

View File

@@ -230,8 +230,8 @@ int main(int argc, char* argv[]) {
std::cout << status.completedResourceCount << " / " << status.requiredResourceCount << " resources | "
<< status.completedTileCount << " / " << status.requiredTileCount << " tiles"
<< (status.requiredResourceCountIsPrecise ? " | " : " (indeterminate); ")
<< status.completedResourceSize << " bytes downloaded"
<< " (" << bytesPerSecond << " bytes/sec)" << std::endl;
<< status.completedResourceSize << " bytes downloaded" << " (" << bytesPerSecond << " bytes/sec)"
<< std::endl;
if (status.complete()) {
std::cout << "Finished Download" << std::endl;

View File

@@ -42,7 +42,7 @@ public:
/// Makes a weak pointer to this Scheduler.
virtual mapbox::base::WeakPtr<Scheduler> makeWeakPtr() = 0;
/// Enqueues a function for execution on the render thread.
virtual void runOnRenderThread(std::function<void()>&&){};
virtual void runOnRenderThread(std::function<void()>&&) {};
virtual void runRenderJobs() {}
/// Returns a closure wrapping the given one.

View File

@@ -23,7 +23,7 @@ public:
: host(host_) {}
~DrawableCustomLayerHostTweaker() override = default;
void init(Drawable&) override{};
void init(Drawable&) override {};
void execute(Drawable&, const PaintParameters&) override;

View File

@@ -65,7 +65,7 @@ public:
virtual bool onCanRemoveUnusedStyleImage(const std::string&) { return true; }
// Observe this event to easily mutate or observe shaders as soon
// as the registry becomes available.
virtual void onRegisterShaders(gfx::ShaderRegistry&){};
virtual void onRegisterShaders(gfx::ShaderRegistry&) {};
};
} // namespace mbgl

View File

@@ -53,7 +53,7 @@ public:
virtual void onRemoveUnusedStyleImages(const std::vector<std::string>&) {}
// Entry point for custom shader registration
virtual void onRegisterShaders(gfx::ShaderRegistry&){};
virtual void onRegisterShaders(gfx::ShaderRegistry&) {};
};
} // namespace mbgl

View File

@@ -80,7 +80,7 @@ public:
virtual void resume() {}
/// Generic setter method
virtual void setProperty(const std::string&, const mapbox::base::Value&){};
virtual void setProperty(const std::string&, const mapbox::base::Value&) {};
/// Generic getter method
virtual mapbox::base::Value getProperty(const std::string&) const { return {}; };

View File

@@ -362,15 +362,11 @@ Value makeValue(T&& arg) {
template <typename T>
StyleProperty makeStyleProperty(const PropertyValue<T>& value) {
return value.match([](const Undefined&) -> StyleProperty { return {}; },
[](const Color& c) -> StyleProperty {
return {makeValue(c), StyleProperty::Kind::Expression};
},
[](const Color& c) -> StyleProperty { return {makeValue(c), StyleProperty::Kind::Expression}; },
[](const PropertyExpression<T>& fn) -> StyleProperty {
return {fn.getExpression().serialize(), StyleProperty::Kind::Expression};
},
[](const auto& t) -> StyleProperty {
return {makeValue(t), StyleProperty::Kind::Constant};
});
[](const auto& t) -> StyleProperty { return {makeValue(t), StyleProperty::Kind::Constant}; });
}
inline StyleProperty makeStyleProperty(const TransitionOptions& value) {

View File

@@ -50,11 +50,9 @@ public:
if (res.kind == Resource::Kind::Tile) {
// onlineResponse.data will be null if data not modified
MBGL_TIMING_FINISH(watch,
" Action: "
<< "Requesting,"
<< " URL: " << res.url.c_str() << " Size: "
<< (response.data != nullptr ? response.data->size() : 0) << "B,"
<< " Time")
" Action: " << "Requesting," << " URL: " << res.url.c_str() << " Size: "
<< (response.data != nullptr ? response.data->size() : 0) << "B,"
<< " Time")
}
callback(response);
});

View File

@@ -77,10 +77,8 @@ std::string simpleDiff(const Value& result, const Value& expected) {
}
if (resultTokens[i] != expectedTokens[i]) {
diff << "<b>"
<< "-" << expectedTokens[i] << "</b>" << std::endl;
diff << "<b>"
<< "+" << resultTokens[i] << "</b>" << std::endl;
diff << "<b>" << "-" << expectedTokens[i] << "</b>" << std::endl;
diff << "<b>" << "+" << resultTokens[i] << "</b>" << std::endl;
} else {
diff << resultTokens[i] << std::endl;
}

View File

@@ -106,19 +106,17 @@ bool VertexAttributeGL::get(const gfx::VertexAttribute::ElementType& element, GL
case GL_FLOAT:
return gl::get<float>(element, buffer) || gl::get<float, std::int32_t>(element, buffer);
case GL_FLOAT_VEC2:
return gl::get<float2>(element, buffer) || gl::get<int2, float2>(element, buffer, [](int2 x) {
return float2{(float)x[0], (float)x[1]};
});
return gl::get<float2>(element, buffer) ||
gl::get<int2, float2>(element, buffer, [](int2 x) { return float2{(float)x[0], (float)x[1]}; });
case GL_FLOAT_VEC3:
return gl::get<float3>(element, buffer);
case GL_FLOAT_VEC4:
case GL_FLOAT_MAT2:
return gl::get<float4>(element, buffer) ||
gl::get<int4, float4>(element,
buffer,
[](int4 x) {
return float4{(float)x[0], (float)x[1], (float)x[2], (float)x[3]};
}) ||
gl::get<int4, float4>(
element,
buffer,
[](int4 x) { return float4{(float)x[0], (float)x[1], (float)x[2], (float)x[3]}; }) ||
gl::get<ushort8, float4>(element, buffer, [](ushort8 x) {
return float4{(float)x[0], (float)x[1], (float)x[2], (float)x[3]};
});

View File

@@ -25,7 +25,7 @@ public:
bool,
const CanonicalTileID&) = 0;
virtual void prepareSymbols(const GlyphMap&, const GlyphPositions&, const ImageMap&, const ImagePositions&){};
virtual void prepareSymbols(const GlyphMap&, const GlyphPositions&, const ImageMap&, const ImagePositions&) {};
virtual bool hasSymbolInstances() const { return true; };

View File

@@ -42,7 +42,7 @@ public:
const ImagePositions&,
const PatternLayerMap&,
std::size_t,
const CanonicalTileID&){};
const CanonicalTileID&) {};
virtual void update(const FeatureStates&, const GeometryTileLayer&, const std::string&, const ImagePositions&) {}

View File

@@ -346,7 +346,7 @@ public:
opacity(opacity_) {}
~OutlineDrawableTweaker() override = default;
void init(gfx::Drawable&) override{};
void init(gfx::Drawable&) override {};
virtual void execute(gfx::Drawable& drawable, const PaintParameters& parameters) override {
if (!drawable.getTileID().has_value()) {

View File

@@ -146,7 +146,7 @@ protected:
}
virtual void bind() { MBGL_CHECK_ERROR(glUseProgram(program)); }
void detach() { MBGL_CHECK_ERROR(glUseProgram(0)); }
virtual void pullLocations(){};
virtual void pullLocations() {};
GLuint program = 0;
GLuint vertexShader = 0;

View File

@@ -178,7 +178,7 @@ public:
void setPatternParameters(const std::optional<ImagePosition>&,
const std::optional<ImagePosition>&,
const CrossfadeParameters&) override{};
const CrossfadeParameters&) override {};
std::tuple<float> interpolationFactor(float) const override { return std::tuple<float>{0.0f}; }
@@ -272,7 +272,7 @@ public:
void setPatternParameters(const std::optional<ImagePosition>&,
const std::optional<ImagePosition>&,
const CrossfadeParameters&) override{};
const CrossfadeParameters&) override {};
void populateVertexVector(const GeometryTileFeature& feature,
std::size_t length,
std::size_t index,
@@ -391,7 +391,7 @@ public:
void setPatternParameters(const std::optional<ImagePosition>&,
const std::optional<ImagePosition>&,
const CrossfadeParameters&) override{};
const CrossfadeParameters&) override {};
void populateVertexVector(const GeometryTileFeature& feature,
std::size_t length,
std::size_t index,

View File

@@ -132,7 +132,7 @@ public:
bool supportsZoom(float zoom) const;
virtual void upload(gfx::UploadPass&) {}
virtual void render(PaintParameters&){};
virtual void render(PaintParameters&) {};
// Check wether the given geometry intersects
// with the feature

View File

@@ -26,7 +26,7 @@ private:
const std::string& getName() const override { return name; }
std::string name;
#if MLN_DRAWABLE_RENDERER
void updateDebugDrawables(DebugLayerGroupMap&, PaintParameters&) const override{};
void updateDebugDrawables(DebugLayerGroupMap&, PaintParameters&) const override {};
#endif
mutable std::optional<gfx::Texture> debugTexture;
};

View File

@@ -188,7 +188,7 @@ void TileSourceRenderItem::updateDebugDrawables(DebugLayerGroupMap& debugLayerGr
: linePropertiesUBO(properties) {}
~PolylineDrawableTweaker() override = default;
void init(gfx::Drawable&) override{};
void init(gfx::Drawable&) override {};
void execute(gfx::Drawable& drawable, const PaintParameters& parameters) override {
if (!drawable.getTileID().has_value()) {

View File

@@ -51,9 +51,8 @@ std::optional<T> Converter<T, typename std::enable_if_t<std::is_enum_v<T>>>::ope
}
template <class T>
auto Converter<std::vector<T>, typename std::enable_if_t<std::is_enum_v<T>>>::operator()(const Convertible& value,
Error& error) const
-> std::optional<std::vector<T>> {
auto Converter<std::vector<T>, typename std::enable_if_t<std::is_enum_v<T>>>::operator()(
const Convertible& value, Error& error) const -> std::optional<std::vector<T>> {
if (!isArray(value)) {
error.message = "value must be an array";
return std::nullopt;

View File

@@ -31,8 +31,7 @@ bool hasTokens(const std::string& source) {
while (pos != end) {
auto brace = std::find(pos, end, '{');
if (brace == end) return false;
for (brace++; brace != end && tokenReservedChars.find(*brace) == std::string::npos; brace++)
;
for (brace++; brace != end && tokenReservedChars.find(*brace) == std::string::npos; brace++);
if (brace != end && *brace == '}') {
return true;
}
@@ -65,8 +64,7 @@ std::unique_ptr<Expression> convertTokenStringToExpression(const std::string& so
}
pos = brace;
if (pos != end) {
for (brace++; brace != end && tokenReservedChars.find(*brace) == std::string::npos; brace++)
;
for (brace++; brace != end && tokenReservedChars.find(*brace) == std::string::npos; brace++);
if (brace != end && *brace == '}') {
inputs.push_back(get(literal(std::string(pos + 1, brace))));
pos = brace + 1;

View File

@@ -86,7 +86,7 @@ public:
: linePropertiesUBO(properties) {}
~LineDrawableTweaker() override = default;
void init(gfx::Drawable&) override{};
void init(gfx::Drawable&) override {};
void execute(gfx::Drawable& drawable, const PaintParameters& parameters) override {
if (!drawable.getTileID().has_value()) {
@@ -136,7 +136,7 @@ public:
opacity(opacity_) {}
~FillDrawableTweaker() override = default;
void init(gfx::Drawable&) override{};
void init(gfx::Drawable&) override {};
void execute(gfx::Drawable& drawable, const PaintParameters& parameters) override {
if (!drawable.getTileID().has_value()) {
@@ -183,7 +183,7 @@ public:
: options(options_) {}
~SymbolDrawableTweaker() override = default;
void init(gfx::Drawable&) override{};
void init(gfx::Drawable&) override {};
void execute(gfx::Drawable& drawable, const PaintParameters& parameters) override {
if (!drawable.getTileID().has_value()) {

View File

@@ -439,10 +439,9 @@ void GeometryTileWorker::parse() {
requestNewImages(imageDependencies);
MBGL_TIMING_FINISH(watch,
" Action: "
<< "Parsing,"
<< " SourceID: " << sourceID.c_str() << " Canonical: " << static_cast<int>(id.canonical.z)
<< "/" << id.canonical.x << "/" << id.canonical.y << " Time");
" Action: " << "Parsing," << " SourceID: " << sourceID.c_str()
<< " Canonical: " << static_cast<int>(id.canonical.z) << "/" << id.canonical.x << "/"
<< id.canonical.y << " Time");
finalizeLayout();
}
@@ -493,10 +492,9 @@ void GeometryTileWorker::finalizeLayout() {
firstLoad = false;
MBGL_TIMING_FINISH(watch,
" Action: "
<< "SymbolLayout,"
<< " SourceID: " << sourceID.c_str() << " Canonical: " << static_cast<int>(id.canonical.z)
<< "/" << id.canonical.x << "/" << id.canonical.y << " Time");
" Action: " << "SymbolLayout," << " SourceID: " << sourceID.c_str()
<< " Canonical: " << static_cast<int>(id.canonical.z) << "/" << id.canonical.x << "/"
<< id.canonical.y << " Time");
parent.invoke(&GeometryTile::onLayout,
std::make_shared<GeometryTile::LayoutResult>(

View File

@@ -24,8 +24,7 @@ std::string replaceTokens(const std::string &source, const Lookup &lookup) {
result.append(pos, brace);
pos = brace;
if (pos != end) {
for (brace++; brace != end && tokenReservedChars.find(*brace) == std::string::npos; brace++)
;
for (brace++; brace != end && tokenReservedChars.find(*brace) == std::string::npos; brace++);
if (brace != end && *brace == '}') {
std::string key{pos + 1, brace};
if (std::optional<std::string> replacement = lookup(key)) {