Skip to content

Commit 77fecb2

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 07ffc01 commit 77fecb2

File tree

91 files changed

+2147
-1849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2147
-1849
lines changed

include/mbgl/platform/gl_functions.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77
// initialized by the platform at linking time.
88

99
#ifndef NDEBUG
10-
#define MBGL_CHECK_ERROR(cmd) \
11-
([&]() { \
12-
struct __MBGL_CHECK_ERROR { \
13-
~__MBGL_CHECK_ERROR() noexcept(false) { \
14-
mbgl::platform::glCheckError(#cmd, __FILE__, __LINE__); \
15-
} \
16-
} __MBGL_CHECK_ERROR; \
17-
return cmd; \
10+
#define MBGL_CHECK_ERROR(cmd) \
11+
([&]() { \
12+
struct __MBGL_CHECK_ERROR { \
13+
~__MBGL_CHECK_ERROR() noexcept(false) { mbgl::platform::glCheckError(#cmd, __FILE__, __LINE__); } \
14+
} __MBGL_CHECK_ERROR; \
15+
return cmd; \
1816
}())
1917
#else
2018
#define MBGL_CHECK_ERROR(cmd) (cmd)

include/mbgl/renderer/change_request.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ChangeRequest {
3434
public:
3535
virtual ~ChangeRequest() = default;
3636

37-
virtual void execute(RenderOrchestrator &) = 0;
37+
virtual void execute(RenderOrchestrator&) = 0;
3838
};
3939

4040
/**
@@ -44,7 +44,7 @@ class RefChangeRequest : public ChangeRequest {
4444
protected:
4545
RefChangeRequest(util::SimpleIdentity id_)
4646
: id(id_) {}
47-
RefChangeRequest(const RefChangeRequest &) = default;
47+
RefChangeRequest(const RefChangeRequest&) = default;
4848

4949
util::SimpleIdentity id;
5050
};
@@ -55,9 +55,9 @@ class RefChangeRequest : public ChangeRequest {
5555
class AddLayerGroupRequest : public ChangeRequest {
5656
public:
5757
AddLayerGroupRequest(LayerGroupBasePtr layerGroup_);
58-
AddLayerGroupRequest(AddLayerGroupRequest &&other);
58+
AddLayerGroupRequest(AddLayerGroupRequest&& other);
5959

60-
void execute(RenderOrchestrator &) override;
60+
void execute(RenderOrchestrator&) override;
6161

6262
protected:
6363
LayerGroupBasePtr layerGroup;
@@ -70,9 +70,9 @@ class RemoveLayerGroupRequest : public ChangeRequest {
7070
public:
7171
RemoveLayerGroupRequest(LayerGroupBasePtr layerGroup_)
7272
: layerGroup(std::move(layerGroup_)) {}
73-
RemoveLayerGroupRequest(const RemoveLayerGroupRequest &) = default;
73+
RemoveLayerGroupRequest(const RemoveLayerGroupRequest&) = default;
7474

75-
void execute(RenderOrchestrator &) override;
75+
void execute(RenderOrchestrator&) override;
7676

7777
protected:
7878
LayerGroupBasePtr layerGroup;
@@ -81,9 +81,9 @@ class RemoveLayerGroupRequest : public ChangeRequest {
8181
class UpdateLayerGroupIndexRequest : public ChangeRequest {
8282
public:
8383
UpdateLayerGroupIndexRequest(LayerGroupBasePtr, int32_t newLayerIndex_);
84-
UpdateLayerGroupIndexRequest(const UpdateLayerGroupIndexRequest &) = delete;
84+
UpdateLayerGroupIndexRequest(const UpdateLayerGroupIndexRequest&) = delete;
8585

86-
void execute(RenderOrchestrator &) override;
86+
void execute(RenderOrchestrator&) override;
8787

8888
protected:
8989
LayerGroupBasePtr layerGroup;
@@ -97,7 +97,7 @@ class AddRenderTargetRequest : public ChangeRequest {
9797
public:
9898
AddRenderTargetRequest(RenderTargetPtr renderTarget_);
9999

100-
void execute(RenderOrchestrator &) override;
100+
void execute(RenderOrchestrator&) override;
101101

102102
protected:
103103
RenderTargetPtr renderTarget;
@@ -110,7 +110,7 @@ class RemoveRenderTargetRequest : public ChangeRequest {
110110
public:
111111
RemoveRenderTargetRequest(RenderTargetPtr renderTarget_);
112112

113-
void execute(RenderOrchestrator &) override;
113+
void execute(RenderOrchestrator&) override;
114114

115115
protected:
116116
RenderTargetPtr renderTarget;

include/mbgl/style/conversion_impl.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,7 @@ class Convertible {
285285
[](const Storage& s) { return Traits::toDouble(reinterpret_cast<const T&>(s)); },
286286
[](const Storage& s) { return Traits::toString(reinterpret_cast<const T&>(s)); },
287287
[](const Storage& s) { return Traits::toValue(reinterpret_cast<const T&>(s)); },
288-
[](const Storage& s, Error& err) {
289-
return Traits::toGeoJSON(reinterpret_cast<const T&>(s), err);
290-
}};
288+
[](const Storage& s, Error& err) { return Traits::toGeoJSON(reinterpret_cast<const T&>(s), err); }};
291289
return &vtable;
292290
}
293291

include/mbgl/text/glyph.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ union GlyphID {
4545

4646
operator char16_t() { return complex.code; }
4747
operator char32_t() { return hash; }
48-
bool operator<(const GlyphID &other) const { return hash < other.hash; }
49-
bool operator>(const GlyphID &other) const { return hash > other.hash; }
48+
bool operator<(const GlyphID& other) const { return hash < other.hash; }
49+
bool operator>(const GlyphID& other) const { return hash > other.hash; }
5050

51-
bool operator<(const uint16_t &other) const { return hash < other; }
52-
bool operator>(const uint16_t &other) const { return hash > other; }
51+
bool operator<(const uint16_t& other) const { return hash < other; }
52+
bool operator>(const uint16_t& other) const { return hash > other; }
5353
};
5454

5555
using GlyphIDs = std::set<GlyphID>;
@@ -65,7 +65,7 @@ struct GlyphMetrics {
6565
uint32_t advance = 0;
6666
};
6767

68-
inline bool operator==(const GlyphMetrics &lhs, const GlyphMetrics &rhs) {
68+
inline bool operator==(const GlyphMetrics& lhs, const GlyphMetrics& rhs) {
6969
return lhs.width == rhs.width && lhs.height == rhs.height && lhs.left == rhs.left && lhs.top == rhs.top &&
7070
lhs.advance == rhs.advance;
7171
}
@@ -147,7 +147,7 @@ class Shaping {
147147
float right = 0;
148148
WritingModeType writingMode;
149149
explicit operator bool() const {
150-
return std::ranges::any_of(positionedLines, [](const auto &line) { return !line.positionedGlyphs.empty(); });
150+
return std::ranges::any_of(positionedLines, [](const auto& line) { return !line.positionedGlyphs.empty(); });
151151
}
152152
// The y offset *should* be part of the font metadata.
153153
static constexpr int32_t yOffset = -17;
@@ -170,13 +170,13 @@ struct FontFace {
170170
std::vector<Range> ranges; // unicode ranges
171171

172172
FontFace() = default;
173-
FontFace(const std::string &name_, const std::string &url_, const std::vector<Range> &ranges_)
173+
FontFace(const std::string& name_, const std::string& url_, const std::vector<Range>& ranges_)
174174
: type(FontPBF),
175175
name(name_),
176176
url(url_),
177177
ranges(ranges_) {}
178178

179-
FontFace(const std::string &name_, const std::string &url_, std::vector<Range> &&ranges_)
179+
FontFace(const std::string& name_, const std::string& url_, std::vector<Range>&& ranges_)
180180
: type(FontPBF),
181181
name(name_),
182182
url(url_),
@@ -192,7 +192,7 @@ struct HBShapeRequest {
192192
FontStack fontStack;
193193
GlyphIDType type;
194194

195-
HBShapeRequest(const std::u16string &str_, const FontStack &fontStack_, GlyphIDType type_)
195+
HBShapeRequest(const std::u16string& str_, const FontStack& fontStack_, GlyphIDType type_)
196196
: str(str_),
197197
fontStack(fontStack_),
198198
type(type_) {}

include/mbgl/text/glyph_range.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ enum GlyphIDType : uint16_t {
1212
FontPBF = 0x00,
1313
};
1414

15-
GlyphIDType genNewGlyphIDType(const std::string &url,
16-
const FontStack &fontStack,
17-
const std::vector<std::pair<uint32_t, uint32_t>> &pairs);
15+
GlyphIDType genNewGlyphIDType(const std::string& url,
16+
const FontStack& fontStack,
17+
const std::vector<std::pair<uint32_t, uint32_t>>& pairs);
1818

1919
class GlyphRange {
2020
public:
@@ -25,8 +25,8 @@ class GlyphRange {
2525

2626
GlyphRange(uint32_t first_, uint32_t second_, GlyphIDType type_ = FontPBF);
2727

28-
bool operator==(const GlyphRange &other) const;
29-
bool operator<(const GlyphRange &other) const;
28+
bool operator==(const GlyphRange& other) const;
29+
bool operator<(const GlyphRange& other) const;
3030
};
3131

3232
constexpr uint32_t GLYPHS_PER_GLYPH_RANGE = 256;
@@ -40,7 +40,7 @@ namespace std {
4040

4141
template <>
4242
struct hash<mbgl::GlyphRange> {
43-
std::size_t operator()(const mbgl::GlyphRange &range) const { return mbgl::util::hash(range.first, range.second); }
43+
std::size_t operator()(const mbgl::GlyphRange& range) const { return mbgl::util::hash(range.first, range.second); }
4444
};
4545

4646
} // namespace std

include/mbgl/util/chrono.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ std::string iso8601(Timestamp);
3535
// YYYY-mm-ddTHH:MM:SS.MS e.g. "2015-11-26T16:11:23.324Z"
3636
std::string iso8601(std::chrono::time_point<std::chrono::system_clock, Milliseconds>);
3737

38-
Timestamp parseTimestamp(const char *);
38+
Timestamp parseTimestamp(const char*);
3939

4040
Timestamp parseTimestamp(int32_t timestamp);
4141

include/mbgl/util/event.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct EventPermutation {
3636
const EventSeverity severity;
3737
const Event event;
3838

39-
constexpr bool operator==(const EventPermutation &rhs) const {
39+
constexpr bool operator==(const EventPermutation& rhs) const {
4040
return severity == rhs.severity && event == rhs.event;
4141
}
4242
};

include/mbgl/util/exception.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,44 @@ namespace mbgl {
66
namespace util {
77

88
struct Exception : std::runtime_error {
9-
Exception(const char *msg)
9+
Exception(const char* msg)
1010
: std::runtime_error(msg) {}
11-
Exception(const std::string &msg)
11+
Exception(const std::string& msg)
1212
: std::runtime_error(msg) {}
1313
};
1414

1515
struct StyleImageException : Exception {
16-
StyleImageException(const char *msg)
16+
StyleImageException(const char* msg)
1717
: Exception(msg) {}
18-
StyleImageException(const std::string &msg)
18+
StyleImageException(const std::string& msg)
1919
: Exception(msg) {}
2020
};
2121

2222
struct MisuseException : Exception {
23-
MisuseException(const char *msg)
23+
MisuseException(const char* msg)
2424
: Exception(msg) {}
25-
MisuseException(const std::string &msg)
25+
MisuseException(const std::string& msg)
2626
: Exception(msg) {}
2727
};
2828

2929
struct StyleParseException : Exception {
30-
StyleParseException(const char *msg)
30+
StyleParseException(const char* msg)
3131
: Exception(msg) {}
32-
StyleParseException(const std::string &msg)
32+
StyleParseException(const std::string& msg)
3333
: Exception(msg) {}
3434
};
3535

3636
struct StyleLoadException : Exception {
37-
StyleLoadException(const char *msg)
37+
StyleLoadException(const char* msg)
3838
: Exception(msg) {}
39-
StyleLoadException(const std::string &msg)
39+
StyleLoadException(const std::string& msg)
4040
: Exception(msg) {}
4141
};
4242

4343
struct NotFoundException : Exception {
44-
NotFoundException(const char *msg)
44+
NotFoundException(const char* msg)
4545
: Exception(msg) {}
46-
NotFoundException(const std::string &msg)
46+
NotFoundException(const std::string& msg)
4747
: Exception(msg) {}
4848
};
4949

include/mbgl/util/geometry.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,44 +42,44 @@ template <class T>
4242
using Geometry = mapbox::geometry::geometry<T>;
4343

4444
template <class S, class T>
45-
Point<S> convertPoint(const Point<T> &p) {
45+
Point<S> convertPoint(const Point<T>& p) {
4646
return Point<S>(static_cast<S>(p.x), static_cast<S>(p.y));
4747
}
4848

4949
struct ToFeatureType {
50-
FeatureType operator()(const EmptyGeometry &) const { return FeatureType::Unknown; }
50+
FeatureType operator()(const EmptyGeometry&) const { return FeatureType::Unknown; }
5151
template <class T>
52-
FeatureType operator()(const Point<T> &) const {
52+
FeatureType operator()(const Point<T>&) const {
5353
return FeatureType::Point;
5454
}
5555
template <class T>
56-
FeatureType operator()(const MultiPoint<T> &) const {
56+
FeatureType operator()(const MultiPoint<T>&) const {
5757
return FeatureType::Point;
5858
}
5959
template <class T>
60-
FeatureType operator()(const LineString<T> &) const {
60+
FeatureType operator()(const LineString<T>&) const {
6161
return FeatureType::LineString;
6262
}
6363
template <class T>
64-
FeatureType operator()(const MultiLineString<T> &) const {
64+
FeatureType operator()(const MultiLineString<T>&) const {
6565
return FeatureType::LineString;
6666
}
6767
template <class T>
68-
FeatureType operator()(const Polygon<T> &) const {
68+
FeatureType operator()(const Polygon<T>&) const {
6969
return FeatureType::Polygon;
7070
}
7171
template <class T>
72-
FeatureType operator()(const MultiPolygon<T> &) const {
72+
FeatureType operator()(const MultiPolygon<T>&) const {
7373
return FeatureType::Polygon;
7474
}
7575
template <class T>
76-
FeatureType operator()(const mapbox::geometry::geometry_collection<T> &) const {
76+
FeatureType operator()(const mapbox::geometry::geometry_collection<T>&) const {
7777
return FeatureType::Unknown;
7878
}
7979
};
8080

8181
template <class T, typename F>
82-
auto forEachPoint(const Geometry<T> &g, F f) {
82+
auto forEachPoint(const Geometry<T>& g, F f) {
8383
mapbox::geometry::for_each_point(g, f);
8484
}
8585

include/mbgl/util/platform.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ namespace platform {
88
class Request;
99

1010
/// Uppercase a string, potentially using platform-specific routines.
11-
std::string uppercase(const std::string &string);
11+
std::string uppercase(const std::string& string);
1212

1313
/// Lowercase a string, potentially using platform-specific routines.
14-
std::string lowercase(const std::string &string);
14+
std::string lowercase(const std::string& string);
1515

1616
/// Gets the name of the current thread.
1717
std::string getCurrentThreadName();
1818

1919
/// Set the name of the current thread, truncated at 15.
20-
void setCurrentThreadName(const std::string &name);
20+
void setCurrentThreadName(const std::string& name);
2121

2222
/// Makes the current thread low priority.
2323
void makeThreadLowPriority();

0 commit comments

Comments
 (0)