fix variable shadowing
This commit is contained in:
@@ -31,8 +31,8 @@ namespace CSSColorParser {
|
||||
|
||||
struct Color {
|
||||
inline Color() {}
|
||||
inline Color(unsigned char r, unsigned char g, unsigned char b, float a)
|
||||
: r(r), g(g), b(b), a(a) {}
|
||||
inline Color(unsigned char r_, unsigned char g_, unsigned char b_, float a_)
|
||||
: r(r_), g(g_), b(b_), a(a_) {}
|
||||
unsigned char r = 0, g = 0, b = 0;
|
||||
float a = 1.0f;
|
||||
};
|
||||
|
||||
@@ -12,10 +12,10 @@ struct Anchor {
|
||||
float scale = 0.0f;
|
||||
int segment = -1;
|
||||
|
||||
explicit Anchor(float x, float y, float angle, float scale)
|
||||
: x(x), y(y), angle(angle), scale(scale) {}
|
||||
explicit Anchor(float x, float y, float angle, float scale, int segment)
|
||||
: x(x), y(y), angle(angle), scale(scale), segment(segment) {}
|
||||
explicit Anchor(float x_, float y_, float angle_, float scale_)
|
||||
: x(x_), y(y_), angle(angle_), scale(scale_) {}
|
||||
explicit Anchor(float x_, float y_, float angle_, float scale_, int segment_)
|
||||
: x(x_), y(y_), angle(angle_), scale(scale_), segment(segment_) {}
|
||||
};
|
||||
|
||||
typedef std::vector<Anchor> Anchors;
|
||||
|
||||
@@ -16,9 +16,9 @@ struct ElementGroup : public util::noncopyable {
|
||||
uint32_t elements_length;
|
||||
|
||||
ElementGroup() : vertex_length(0), elements_length(0) {}
|
||||
ElementGroup(uint32_t vertex_length, uint32_t elements_length)
|
||||
: vertex_length(vertex_length),
|
||||
elements_length(elements_length) {
|
||||
ElementGroup(uint32_t vertex_length_, uint32_t elements_length_)
|
||||
: vertex_length(vertex_length_),
|
||||
elements_length(elements_length_) {
|
||||
}
|
||||
|
||||
ElementGroup(ElementGroup &&rhs) noexcept
|
||||
|
||||
@@ -30,8 +30,8 @@ private:
|
||||
int32_t ox, oy;
|
||||
};
|
||||
|
||||
Geometry::Geometry(pbf& data)
|
||||
: data(data),
|
||||
Geometry::Geometry(pbf& data_)
|
||||
: data(data_),
|
||||
cmd(1),
|
||||
length(0),
|
||||
x(0), y(0),
|
||||
|
||||
@@ -18,8 +18,8 @@ public:
|
||||
|
||||
private:
|
||||
struct GlyphValue {
|
||||
GlyphValue(const Rect<uint16_t>& rect, uint64_t id)
|
||||
: rect(rect), ids({ id }) {}
|
||||
GlyphValue(const Rect<uint16_t>& rect_, uint64_t id)
|
||||
: rect(rect_), ids({ id }) {}
|
||||
Rect<uint16_t> rect;
|
||||
std::set<uint64_t> ids;
|
||||
};
|
||||
|
||||
@@ -37,8 +37,8 @@ public:
|
||||
const int8_t z = 0;
|
||||
const int32_t x = 0, y = 0;
|
||||
|
||||
inline explicit ID(int8_t z, int32_t x, int32_t y)
|
||||
: w((x < 0 ? x - (1 << z) + 1 : x) / (1 << z)), z(z), x(x), y(y) {}
|
||||
inline explicit ID(int8_t z_, int32_t x_, int32_t y_)
|
||||
: w((x_ < 0 ? x_ - (1 << z_) + 1 : x_) / (1 << z_)), z(z_), x(x_), y(y_) {}
|
||||
|
||||
inline uint64_t to_uint64() const {
|
||||
return ((std::pow(2, z) * y + x) * 32) + z;
|
||||
|
||||
@@ -22,8 +22,8 @@ enum MapChange : uint8_t {
|
||||
|
||||
class View {
|
||||
public:
|
||||
virtual void initialize(Map *map) {
|
||||
this->map = map;
|
||||
virtual void initialize(Map *map_) {
|
||||
map = map_;
|
||||
}
|
||||
|
||||
// Called from the render (=GL) thread. Signals that the context should
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace mbgl {
|
||||
|
||||
struct FrameSnapshot {
|
||||
explicit inline FrameSnapshot(timestamp t, float z) : t(t), z(z) {}
|
||||
explicit inline FrameSnapshot(timestamp t_, float z_) : t(t_), z(z_) {}
|
||||
float t;
|
||||
float z;
|
||||
};
|
||||
|
||||
@@ -154,10 +154,10 @@ public:
|
||||
|
||||
// used to composite images and flips the geometry upside down
|
||||
const mat4 flipMatrix = []{
|
||||
mat4 flipMatrix;
|
||||
matrix::ortho(flipMatrix, 0, 4096, -4096, 0, 0, 1);
|
||||
matrix::translate(flipMatrix, flipMatrix, 0, -4096, 0);
|
||||
return flipMatrix;
|
||||
mat4 flip;
|
||||
matrix::ortho(flip, 0, 4096, -4096, 0, 0, 1);
|
||||
matrix::translate(flip, flip, 0, -4096, 0);
|
||||
return flip;
|
||||
}();
|
||||
|
||||
const mat4 identityMatrix = []{
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace mbgl {
|
||||
class ClassProperties {
|
||||
public:
|
||||
inline ClassProperties() {}
|
||||
inline ClassProperties(ClassProperties &&properties)
|
||||
: properties(std::move(properties.properties)) {}
|
||||
inline ClassProperties(ClassProperties &&properties_)
|
||||
: properties(std::move(properties_.properties)) {}
|
||||
|
||||
inline void set(PropertyKey key, const PropertyValue &value) {
|
||||
properties.emplace(key, value);
|
||||
|
||||
@@ -24,8 +24,8 @@ public:
|
||||
|
||||
class Instance {
|
||||
public:
|
||||
Instance(Operator op, std::vector<Value> &&values)
|
||||
: op(op), values(values) {}
|
||||
Instance(Operator op_, std::vector<Value> &&values_)
|
||||
: op(op_), values(values_) {}
|
||||
|
||||
bool compare(const std::vector<Value> &property_values) const;
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
FilterComparison(const std::string &field) : field(field) {};
|
||||
FilterComparison(const std::string &field_) : field(field_) {};
|
||||
|
||||
const std::string &getField() const;
|
||||
template <typename Extractor> inline bool compare(const Extractor &extractor) const;
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
|
||||
public:
|
||||
FilterExpression() = default;
|
||||
FilterExpression(Operator op) : op(op) {};
|
||||
FilterExpression(Operator op_) : op(op_) {};
|
||||
|
||||
bool empty() const;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace mbgl {
|
||||
|
||||
template <typename T>
|
||||
struct ConstantFunction {
|
||||
inline ConstantFunction(const T &value) : value(value) {}
|
||||
inline ConstantFunction(const T &value_) : value(value_) {}
|
||||
inline T evaluate(float) const { return value; }
|
||||
|
||||
private:
|
||||
@@ -18,7 +18,7 @@ private:
|
||||
|
||||
template <typename T>
|
||||
struct StopsFunction {
|
||||
inline StopsFunction(const std::vector<std::pair<float, T>> &values, float base) : values(values), base(base) {}
|
||||
inline StopsFunction(const std::vector<std::pair<float, T>> &values_, float base_) : values(values_), base(base_) {}
|
||||
T evaluate(float z) const;
|
||||
|
||||
private:
|
||||
@@ -36,7 +36,7 @@ using Function = mapbox::util::variant<
|
||||
template <typename T>
|
||||
struct FunctionEvaluator {
|
||||
typedef T result_type;
|
||||
inline FunctionEvaluator(float z) : z(z) {}
|
||||
inline FunctionEvaluator(float z_) : z(z_) {}
|
||||
|
||||
inline result_type operator()(const std::false_type &) {
|
||||
return result_type();
|
||||
|
||||
@@ -36,8 +36,8 @@ public:
|
||||
bool enabled = false;
|
||||
util::ptr<Source> source;
|
||||
|
||||
StyleSource(const util::ptr<SourceInfo> &info)
|
||||
: info(info)
|
||||
StyleSource(const util::ptr<SourceInfo> &info_)
|
||||
: info(info_)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#ifdef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-register"
|
||||
#else
|
||||
|
||||
@@ -30,9 +30,9 @@ struct GlyphMetrics {
|
||||
|
||||
struct Glyph {
|
||||
inline explicit Glyph() : rect(0, 0, 0, 0), metrics() {}
|
||||
inline explicit Glyph(const Rect<uint16_t> &rect,
|
||||
const GlyphMetrics &metrics)
|
||||
: rect(rect), metrics(metrics) {}
|
||||
inline explicit Glyph(const Rect<uint16_t> &rect_,
|
||||
const GlyphMetrics &metrics_)
|
||||
: rect(rect_), metrics(metrics_) {}
|
||||
|
||||
operator bool() const {
|
||||
return metrics || rect;
|
||||
@@ -46,8 +46,8 @@ typedef std::map<uint32_t, Glyph> GlyphPositions;
|
||||
|
||||
class PositionedGlyph {
|
||||
public:
|
||||
inline explicit PositionedGlyph(uint32_t glyph, float x, float y)
|
||||
: glyph(glyph), x(x), y(y) {}
|
||||
inline explicit PositionedGlyph(uint32_t glyph_, float x_, float y_)
|
||||
: glyph(glyph_), x(x_), y(y_) {}
|
||||
|
||||
uint32_t glyph = 0;
|
||||
float x = 0;
|
||||
|
||||
@@ -28,24 +28,24 @@ struct CollisionRect {
|
||||
CollisionPoint::Type bx,
|
||||
CollisionPoint::Type by)
|
||||
: tl(ax, ay), br(bx, by) {}
|
||||
inline explicit CollisionRect(const CollisionPoint &tl,
|
||||
const CollisionPoint &br)
|
||||
: tl(tl), br(br) {}
|
||||
inline explicit CollisionRect(const CollisionPoint &tl_,
|
||||
const CollisionPoint &br_)
|
||||
: tl(tl_), br(br_) {}
|
||||
};
|
||||
|
||||
// These are the glyph boxes that we want to have placed.
|
||||
struct GlyphBox {
|
||||
explicit GlyphBox() {}
|
||||
explicit GlyphBox(const CollisionRect &box,
|
||||
const CollisionAnchor &anchor,
|
||||
float minScale,
|
||||
float maxScale,
|
||||
float padding)
|
||||
: box(box), anchor(anchor), minScale(minScale), maxScale(maxScale), padding(padding) {}
|
||||
explicit GlyphBox(const CollisionRect &box,
|
||||
float minScale,
|
||||
float padding)
|
||||
: box(box), minScale(minScale), padding(padding) {}
|
||||
explicit GlyphBox(const CollisionRect &box_,
|
||||
const CollisionAnchor &anchor_,
|
||||
float minScale_,
|
||||
float maxScale_,
|
||||
float padding_)
|
||||
: box(box_), anchor(anchor_), minScale(minScale_), maxScale(maxScale_), padding(padding_) {}
|
||||
explicit GlyphBox(const CollisionRect &box_,
|
||||
float minScale_,
|
||||
float padding_)
|
||||
: box(box_), minScale(minScale_), padding(padding_) {}
|
||||
|
||||
CollisionRect box;
|
||||
CollisionAnchor anchor;
|
||||
@@ -60,19 +60,19 @@ typedef std::vector<GlyphBox> GlyphBoxes;
|
||||
|
||||
// TODO: Transform the vec2<float>s to vec2<int16_t> to save bytes
|
||||
struct PlacedGlyph {
|
||||
explicit PlacedGlyph(const vec2<float> &tl, const vec2<float> &tr,
|
||||
const vec2<float> &bl, const vec2<float> &br,
|
||||
const Rect<uint16_t> &tex, float angle, const vec2<float> &anchor,
|
||||
float minScale, float maxScale)
|
||||
: tl(tl),
|
||||
tr(tr),
|
||||
bl(bl),
|
||||
br(br),
|
||||
tex(tex),
|
||||
angle(angle),
|
||||
anchor(anchor),
|
||||
minScale(minScale),
|
||||
maxScale(maxScale) {}
|
||||
explicit PlacedGlyph(const vec2<float> &tl_, const vec2<float> &tr_,
|
||||
const vec2<float> &bl_, const vec2<float> &br_,
|
||||
const Rect<uint16_t> &tex_, float angle_, const vec2<float> &anchor_,
|
||||
float minScale_, float maxScale_)
|
||||
: tl(tl_),
|
||||
tr(tr_),
|
||||
bl(bl_),
|
||||
br(br_),
|
||||
tex(tex_),
|
||||
angle(angle_),
|
||||
anchor(anchor_),
|
||||
minScale(minScale_),
|
||||
maxScale(maxScale_) {}
|
||||
|
||||
vec2<float> tl, tr, bl, br;
|
||||
Rect<uint16_t> tex;
|
||||
@@ -96,8 +96,8 @@ struct PlacementBox {
|
||||
|
||||
struct PlacementProperty {
|
||||
explicit PlacementProperty() {}
|
||||
explicit PlacementProperty(float zoom, const PlacementRange &rotationRange)
|
||||
: zoom(zoom), rotationRange(rotationRange) {}
|
||||
explicit PlacementProperty(float zoom_, const PlacementRange &rotationRange_)
|
||||
: zoom(zoom_), rotationRange(rotationRange_) {}
|
||||
|
||||
inline operator bool() const {
|
||||
return !std::isnan(zoom) && zoom != std::numeric_limits<float>::infinity() &&
|
||||
|
||||
@@ -21,11 +21,11 @@ private:
|
||||
static constexpr inline bool compare(const char *a, const char *b) {
|
||||
return *a == *b && (*a == '\0' || compare(a + 1, b + 1));
|
||||
}
|
||||
static constexpr inline const char *lookup_type(Type e, EnumValue<Type> const * const l, size_t r) {
|
||||
return r == 0 ? "" : l->value == e ? l->name : lookup_type(e, l + 1, r - 1);
|
||||
static constexpr inline const char *lookup_type(Type e, EnumValue<Type> const * const list, size_t r) {
|
||||
return r == 0 ? "" : list->value == e ? list->name : lookup_type(e, list + 1, r - 1);
|
||||
}
|
||||
static constexpr inline Type lookup_name(const char *n, EnumValue<Type> const * const l, size_t r) {
|
||||
return r == 0 ? Type(-1) : compare(l->name, n) ? l->value : lookup_name(n, l + 1, r - 1);
|
||||
static constexpr inline Type lookup_name(const char *n, EnumValue<Type> const * const list, size_t r) {
|
||||
return r == 0 ? Type(-1) : compare(list->name, n) ? list->value : lookup_name(n, list + 1, r - 1);
|
||||
}
|
||||
public:
|
||||
inline constexpr Enum(const char *n) : value(lookup_name(n, names, length)) {}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace mbgl {
|
||||
namespace error {
|
||||
|
||||
struct style_parse : std::exception {
|
||||
inline style_parse(size_t offset, const char *msg) : offset(offset), msg(msg) {}
|
||||
inline style_parse(size_t offset_, const char *msg_) : offset(offset_), msg(msg_) {}
|
||||
inline const char* what() const noexcept { return msg.c_str(); }
|
||||
const size_t offset;
|
||||
const std::string msg;
|
||||
|
||||
@@ -49,9 +49,9 @@ struct pbf {
|
||||
uint32_t tag = 0;
|
||||
};
|
||||
|
||||
pbf::pbf(const unsigned char *data, size_t length)
|
||||
: data(data),
|
||||
end(data + length),
|
||||
pbf::pbf(const unsigned char *data_, size_t length)
|
||||
: data(data_),
|
||||
end(data_ + length),
|
||||
value(0),
|
||||
tag(0) {
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace mbgl {
|
||||
template <typename T>
|
||||
struct Rect {
|
||||
inline Rect() {}
|
||||
inline Rect(T x, T y, T w, T h) : x(x), y(y), w(w), h(h) {}
|
||||
inline Rect(T x_, T y_, T w_, T h_) : x(x_), y(y_), w(w_), h(h_) {}
|
||||
T x = 0, y = 0;
|
||||
T w = 0, h = 0;
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ public:
|
||||
complete
|
||||
};
|
||||
|
||||
inline transition(timestamp start, timestamp duration)
|
||||
: start(start),
|
||||
duration(duration) {}
|
||||
inline transition(timestamp start_, timestamp duration_)
|
||||
: start(start_),
|
||||
duration(duration_) {}
|
||||
|
||||
inline float progress(timestamp now) const {
|
||||
if (duration == 0) return 1;
|
||||
@@ -36,11 +36,11 @@ protected:
|
||||
template <typename T>
|
||||
class ease_transition : public transition {
|
||||
public:
|
||||
ease_transition(T from, T to, T& value, timestamp start, timestamp duration)
|
||||
ease_transition(T from_, T to_, T& value_, timestamp start, timestamp duration)
|
||||
: transition(start, duration),
|
||||
from(from),
|
||||
to(to),
|
||||
value(value) {}
|
||||
from(from_),
|
||||
to(to_),
|
||||
value(value_) {}
|
||||
|
||||
state update(timestamp now) const;
|
||||
|
||||
@@ -53,10 +53,10 @@ private:
|
||||
template <typename T>
|
||||
class timeout : public transition {
|
||||
public:
|
||||
timeout(T final_value, T& value, timestamp start, timestamp duration)
|
||||
timeout(T final_value_, T& value_, timestamp start, timestamp duration)
|
||||
: transition(start, duration),
|
||||
final_value(final_value),
|
||||
value(value) {}
|
||||
final_value(final_value_),
|
||||
value(value_) {}
|
||||
|
||||
state update(timestamp now) const {
|
||||
if (progress(now) >= 1) {
|
||||
|
||||
@@ -68,7 +68,7 @@ private:
|
||||
|
||||
class lock {
|
||||
public:
|
||||
lock(mutex &mtx) : mtx(mtx) { mtx.lock(); }
|
||||
lock(mutex &mtx_) : mtx(mtx_) { mtx.lock(); }
|
||||
~lock() { mtx.unlock(); }
|
||||
|
||||
private:
|
||||
@@ -94,8 +94,8 @@ private:
|
||||
|
||||
class readlock {
|
||||
public:
|
||||
inline readlock(rwlock &mtx) : mtx(mtx) { mtx.rdlock(); }
|
||||
inline readlock(const std::unique_ptr<rwlock> &mtx) : mtx(*mtx) { mtx->rdlock(); }
|
||||
inline readlock(rwlock &mtx_) : mtx(mtx_) { mtx.rdlock(); }
|
||||
inline readlock(const std::unique_ptr<rwlock> &mtx_) : mtx(*mtx_) { mtx.rdlock(); }
|
||||
inline ~readlock() { mtx.rdunlock(); }
|
||||
|
||||
private:
|
||||
@@ -104,8 +104,8 @@ private:
|
||||
|
||||
class writelock {
|
||||
public:
|
||||
inline writelock(rwlock &mtx) : mtx(mtx) { mtx.wrlock(); }
|
||||
inline writelock(const std::unique_ptr<rwlock> &mtx) : mtx(*mtx) { mtx->wrlock(); }
|
||||
inline writelock(rwlock &mtx_) : mtx(mtx_) { mtx.wrlock(); }
|
||||
inline writelock(const std::unique_ptr<rwlock> &mtx_) : mtx(*mtx_) { mtx.wrlock(); }
|
||||
inline ~writelock() { mtx.wrunlock(); }
|
||||
|
||||
private:
|
||||
@@ -148,10 +148,10 @@ public:
|
||||
typedef void (*after_work_callback)(T &object);
|
||||
|
||||
template<typename... Args>
|
||||
work(worker &worker, work_callback work_cb, after_work_callback after_work_cb, Args&&... args)
|
||||
work(worker &worker, work_callback work_cb_, after_work_callback after_work_cb_, Args&&... args)
|
||||
: data(std::forward<Args>(args)...),
|
||||
work_cb(work_cb),
|
||||
after_work_cb(after_work_cb) {
|
||||
work_cb(work_cb_),
|
||||
after_work_cb(after_work_cb_) {
|
||||
worker.add(this, do_work, after_work);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ struct vec2 {
|
||||
template<typename U>
|
||||
inline vec2(const U& u) : x(u.x), y(u.y) {}
|
||||
|
||||
inline vec2(T x, T y) : x(x), y(y) {}
|
||||
inline vec2(T x_, T y_) : x(x_), y(y_) {}
|
||||
|
||||
inline bool operator==(const vec2& rhs) const {
|
||||
return x == rhs.x && y == rhs.y;
|
||||
@@ -86,7 +86,7 @@ struct vec3 {
|
||||
|
||||
inline vec3() {}
|
||||
inline vec3(const vec3& o) : x(o.x), y(o.y), z(o.z) {}
|
||||
inline vec3(T x, T y, T z) : x(x), y(y), z(z) {}
|
||||
inline vec3(T x_, T y_, T z_) : x(x_), y(y_), z(z_) {}
|
||||
inline bool operator==(const vec3& rhs) const {
|
||||
return x == rhs.x && y == rhs.y && z == rhs.z;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ struct vec4 {
|
||||
|
||||
inline vec4() {}
|
||||
inline vec4(const vec4& o) : x(o.x), y(o.y), z(o.z), w(o.w) {}
|
||||
inline vec4(T x, T y, T z, T w) : x(x), y(y), z(z), w(w) {}
|
||||
inline vec4(T x_, T y_, T z_, T w_) : x(x_), y(y_), z(z_), w(w_) {}
|
||||
inline bool operator==(const vec4& rhs) const {
|
||||
return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user