summaryrefslogtreecommitdiff
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 03:17:22 +0300
commit2e2df965b3d2f03bcfd40f8a0053f7320cd8bbb6 (patch)
tree480934882e1ccf6aa5d4d612889d8c8b76927d3b
parentc1c0145d3a3ee26217f00378509b5a560d3f3969 (diff)
downloadqtlocation-mapboxgl-2e2df965b3d2f03bcfd40f8a0053f7320cd8bbb6.tar.gz
[core] Fix misc-unconventional-assign-operator errors in header files
As reported by clang-tidy-8.
-rw-r--r--src/mbgl/gl/state.hpp4
-rw-r--r--src/mbgl/gl/uniform.hpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mbgl/gl/state.hpp b/src/mbgl/gl/state.hpp
index 17503cc043..77effb1781 100644
--- a/src/mbgl/gl/state.hpp
+++ b/src/mbgl/gl/state.hpp
@@ -20,11 +20,13 @@ public:
State(Args&&... args) : params(std::forward_as_tuple(::std::forward<Args>(args)...)) {
}
- void operator=(const typename T::Type& value) {
+ State& operator=(const typename T::Type& value) {
if (*this != value) {
setCurrentValue(value);
set(std::index_sequence_for<Args...>{});
}
+
+ return *this;
}
bool operator==(const typename T::Type& value) const {
diff --git a/src/mbgl/gl/uniform.hpp b/src/mbgl/gl/uniform.hpp
index 9f752de8af..6714379217 100644
--- a/src/mbgl/gl/uniform.hpp
+++ b/src/mbgl/gl/uniform.hpp
@@ -39,11 +39,13 @@ class UniformState {
public:
UniformState(UniformLocation location_ = -1) : location(location_) {}
- void operator=(const Value& value) {
+ UniformState& operator=(const Value& value) {
if (location >= 0 && (!current || *current != value)) {
current = value;
bindUniform(location, value);
}
+
+ return *this;
}
UniformLocation location;