summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-27 18:30:35 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-04-17 13:36:50 +0300
commit4cdc067636ca7f9201faddf1410b6e781dd7c4c5 (patch)
treeb0856bc904d87a19600499fc64f42377f33451fc /include
parent46fa69159616860ded192643031f7cb3c10b818b (diff)
downloadqtlocation-mapboxgl-4cdc067636ca7f9201faddf1410b6e781dd7c4c5.tar.gz
[core] Fix modernize-return-braced-init-list errors in header files
As reported by clang-tidy-8.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/util/char_array_buffer.hpp2
-rw-r--r--include/mbgl/util/geo.hpp17
-rw-r--r--include/mbgl/util/projection.hpp4
3 files changed, 8 insertions, 15 deletions
diff --git a/include/mbgl/util/char_array_buffer.hpp b/include/mbgl/util/char_array_buffer.hpp
index 177f005477..80eeb2db62 100644
--- a/include/mbgl/util/char_array_buffer.hpp
+++ b/include/mbgl/util/char_array_buffer.hpp
@@ -43,7 +43,7 @@ private:
if (dir == std::ios_base::beg) current_ = std::min(begin_ + off, end_);
else if (dir == std::ios_base::cur) current_ = std::min(current_ + off, end_);
else current_ = std::max(end_ - off, begin_); // dir == std::ios_base::end
- return pos_type(off_type(current_ - begin_));
+ return {off_type(current_ - begin_)};
}
char const * const begin_;
diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp
index 58e5c834ab..a653d053f5 100644
--- a/include/mbgl/util/geo.hpp
+++ b/include/mbgl/util/geo.hpp
@@ -82,14 +82,10 @@ public:
class LatLngBounds {
public:
// Return a bounds covering the entire (unwrapped) world.
- static LatLngBounds world() {
- return LatLngBounds({-90, -180}, {90, 180});
- }
+ static LatLngBounds world() { return {{-90, -180}, {90, 180}}; }
// Return the bounds consisting of the single point.
- static LatLngBounds singleton(const LatLng& a) {
- return LatLngBounds(a, a);
- }
+ static LatLngBounds singleton(const LatLng& a) { return {a, a}; }
// Return the convex hull of two points; the smallest bounds that contains both.
static LatLngBounds hull(const LatLng& a, const LatLng& b) {
@@ -126,13 +122,10 @@ public:
LatLng southwest() const { return sw; }
LatLng northeast() const { return ne; }
- LatLng southeast() const { return LatLng(south(), east()); }
- LatLng northwest() const { return LatLng(north(), west()); }
+ LatLng southeast() const { return {south(), east()}; }
+ LatLng northwest() const { return {north(), west()}; }
- LatLng center() const {
- return LatLng((sw.latitude() + ne.latitude()) / 2,
- (sw.longitude() + ne.longitude()) / 2);
- }
+ LatLng center() const { return {(sw.latitude() + ne.latitude()) / 2, (sw.longitude() + ne.longitude()) / 2}; }
LatLng constrain(const LatLng& p) const;
diff --git a/include/mbgl/util/projection.hpp b/include/mbgl/util/projection.hpp
index f0b9115eb0..f8563719d6 100644
--- a/include/mbgl/util/projection.hpp
+++ b/include/mbgl/util/projection.hpp
@@ -61,7 +61,7 @@ public:
const double easting = util::EARTH_RADIUS_M * constrainedLongitude * util::DEG2RAD;
const double northing = 0.5 * util::EARTH_RADIUS_M * std::log((1 + f) / (1 - f));
- return ProjectedMeters(northing, easting);
+ return {northing, easting};
}
static LatLng latLngForProjectedMeters(const ProjectedMeters& projectedMeters) {
@@ -71,7 +71,7 @@ public:
latitude = util::clamp(latitude, -util::LATITUDE_MAX, util::LATITUDE_MAX);
longitude = util::clamp(longitude, -util::LONGITUDE_MAX, util::LONGITUDE_MAX);
- return LatLng(latitude, longitude);
+ return {latitude, longitude};
}
static Point<double> project(const LatLng& latLng, double scale) {