summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry/anchor.hpp
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-12-04 14:53:32 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-12-05 19:04:15 +0200
commitc2899f76b68ebaa2bba61e4407e128ab261ab212 (patch)
tree873acb061104f43b2c5e47bb42c209486b8be3a6 /src/mbgl/geometry/anchor.hpp
parent27536631d01d623bb4a08c3e85f2a62a6d187a12 (diff)
downloadqtlocation-mapboxgl-c2899f76b68ebaa2bba61e4407e128ab261ab212.tar.gz
[core] Don't use signed int type for anchor segmentupstream/alexshalamov_signed_to_unsigned_conversion
Diffstat (limited to 'src/mbgl/geometry/anchor.hpp')
-rw-r--r--src/mbgl/geometry/anchor.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/geometry/anchor.hpp b/src/mbgl/geometry/anchor.hpp
index b24d8d04e0..1a2cbd3dac 100644
--- a/src/mbgl/geometry/anchor.hpp
+++ b/src/mbgl/geometry/anchor.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/util/geometry.hpp>
+#include <mbgl/util/optional.hpp>
#include <vector>
@@ -11,9 +12,9 @@ public:
Point<float> point;
float angle = 0.0f;
float scale = 0.0f;
- int segment = -1;
+ optional<std::size_t> segment;
- Anchor(float x_, float y_, float angle_, float scale_, int segment_ = -1)
+ Anchor(float x_, float y_, float angle_, float scale_, optional<std::size_t> segment_ = nullopt)
: point(x_, y_), angle(angle_), scale(scale_), segment(segment_) {}
};