summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-22 18:06:11 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-10-22 18:19:01 +0200
commit214f99673f6f7480f9cc3bf9d6fa32ef8dd2ede5 (patch)
treef06145cf70bf7860abd2c6edf88e2294d4ecb830 /include/mbgl/util
parent74387c54e35e0f8f6bf1dcc7b7b171a3ec6db212 (diff)
downloadqtlocation-mapboxgl-214f99673f6f7480f9cc3bf9d6fa32ef8dd2ede5.tar.gz
fix variable shadowing
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/enum.hpp8
-rw-r--r--include/mbgl/util/error.hpp2
-rw-r--r--include/mbgl/util/pbf.hpp6
-rw-r--r--include/mbgl/util/rect.hpp2
-rw-r--r--include/mbgl/util/transition.hpp20
-rw-r--r--include/mbgl/util/uv_detail.hpp16
-rw-r--r--include/mbgl/util/vec.hpp6
7 files changed, 30 insertions, 30 deletions
diff --git a/include/mbgl/util/enum.hpp b/include/mbgl/util/enum.hpp
index 195aaab5a5..3c3e4a5c4e 100644
--- a/include/mbgl/util/enum.hpp
+++ b/include/mbgl/util/enum.hpp
@@ -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)) {}
diff --git a/include/mbgl/util/error.hpp b/include/mbgl/util/error.hpp
index 99e27f770c..09fa8d3e21 100644
--- a/include/mbgl/util/error.hpp
+++ b/include/mbgl/util/error.hpp
@@ -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;
diff --git a/include/mbgl/util/pbf.hpp b/include/mbgl/util/pbf.hpp
index 1f78a0072f..ab4d60cd37 100644
--- a/include/mbgl/util/pbf.hpp
+++ b/include/mbgl/util/pbf.hpp
@@ -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) {
}
diff --git a/include/mbgl/util/rect.hpp b/include/mbgl/util/rect.hpp
index dedd4afc94..f5c77f93d1 100644
--- a/include/mbgl/util/rect.hpp
+++ b/include/mbgl/util/rect.hpp
@@ -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;
diff --git a/include/mbgl/util/transition.hpp b/include/mbgl/util/transition.hpp
index 8a6836c885..16adc41ceb 100644
--- a/include/mbgl/util/transition.hpp
+++ b/include/mbgl/util/transition.hpp
@@ -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) {
diff --git a/include/mbgl/util/uv_detail.hpp b/include/mbgl/util/uv_detail.hpp
index f80ca1bff5..b4b41f31af 100644
--- a/include/mbgl/util/uv_detail.hpp
+++ b/include/mbgl/util/uv_detail.hpp
@@ -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);
}
diff --git a/include/mbgl/util/vec.hpp b/include/mbgl/util/vec.hpp
index a5fbee477b..0179254fda 100644
--- a/include/mbgl/util/vec.hpp
+++ b/include/mbgl/util/vec.hpp
@@ -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;
}