diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-06-06 18:20:50 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-06-07 13:55:35 +0200 |
commit | aa88ca4757f182dcab5b66172144701185ec28ab (patch) | |
tree | aa32a9243f956a654c12512f14ebe55226f9e80d /src | |
parent | 83d349ee16f1918d7e0275d47b9c22abc1a4f50c (diff) | |
download | qtlocation-mapboxgl-aa88ca4757f182dcab5b66172144701185ec28ab.tar.gz |
[core] remove unused code
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/geometry/buffer.hpp | 13 | ||||
-rw-r--r-- | src/mbgl/renderer/renderable.hpp | 11 | ||||
-rw-r--r-- | src/mbgl/style/source.hpp | 1 | ||||
-rw-r--r-- | src/mbgl/util/assert.hpp | 10 | ||||
-rw-r--r-- | src/mbgl/util/channel.hpp | 36 |
5 files changed, 0 insertions, 71 deletions
diff --git a/src/mbgl/geometry/buffer.hpp b/src/mbgl/geometry/buffer.hpp index 1712ca9887..6465b6f8e3 100644 --- a/src/mbgl/geometry/buffer.hpp +++ b/src/mbgl/geometry/buffer.hpp @@ -88,19 +88,6 @@ protected: return reinterpret_cast<char *>(array) + (pos - itemSize); } - // Get a pointer to the item at a given index. - inline void *getElement(size_t i) { - if (array == nullptr) { - throw std::runtime_error("Buffer was already deleted or doesn't contain elements"); - } - - if (i * itemSize >= pos) { - throw std::runtime_error("Can't get element after array bounds"); - } else { - return reinterpret_cast<char *>(array) + (i * itemSize); - } - } - public: static const size_t itemSize = item_size; diff --git a/src/mbgl/renderer/renderable.hpp b/src/mbgl/renderer/renderable.hpp deleted file mode 100644 index 27acfc4d0d..0000000000 --- a/src/mbgl/renderer/renderable.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include <mbgl/util/clip_id.hpp> - -namespace mbgl { - -struct Renderable { - ClipID& clip; -}; - -} // namespace mbgl diff --git a/src/mbgl/style/source.hpp b/src/mbgl/style/source.hpp index cadc45c25c..07e1aeaf58 100644 --- a/src/mbgl/style/source.hpp +++ b/src/mbgl/style/source.hpp @@ -4,7 +4,6 @@ #include <mbgl/tile/tile_data.hpp> #include <mbgl/tile/tile_cache.hpp> #include <mbgl/style/types.hpp> -#include <mbgl/renderer/renderable.hpp> #include <mbgl/util/mat4.hpp> #include <mbgl/util/rapidjson.hpp> diff --git a/src/mbgl/util/assert.hpp b/src/mbgl/util/assert.hpp deleted file mode 100644 index 47fc13f94e..0000000000 --- a/src/mbgl/util/assert.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include <cassert> - -// Based on FreeBSD's src/include/assert.h -// Licensed under the original BSD license -#define assert_always(expr) \ - ((void)((expr) ? ((void)0) : ((void)fprintf(stderr, "%s:%u: failed assertion `%s'\n", \ - __FILE__, __LINE__, #expr), \ - abort()))) diff --git a/src/mbgl/util/channel.hpp b/src/mbgl/util/channel.hpp deleted file mode 100644 index 319205b444..0000000000 --- a/src/mbgl/util/channel.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include <mbgl/util/noncopyable.hpp> - -#include <mutex> -#include <condition_variable> -#include <queue> - -namespace mbgl { - -template <class T> -class Channel : public mbgl::util::noncopyable { -public: - void send(const T& t) { - std::unique_lock<std::mutex> lock(mutex); - queue.push(t); - condition.notify_one(); - } - - T receive() { - std::unique_lock<std::mutex> lock(mutex); - condition.wait(lock, [&](){ return !queue.empty(); }); - - T t = queue.front(); - queue.pop(); - - return t; - } - -private: - std::mutex mutex; - std::condition_variable condition; - std::queue<T> queue; -}; - -} |