summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-05-15 14:42:43 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-05-15 14:42:43 +0200
commit8dd32e7d22088716225ab5f0926c465d452832a7 (patch)
tree0cd2848a692c84fb97569afdfb3f67ca15a89254 /src
parentc7b513ad4276d4f1bce0949d2af7b0c669edb3a8 (diff)
downloadqtlocation-mapboxgl-8dd32e7d22088716225ab5f0926c465d452832a7.tar.gz
make sure bit shifts happen with unsigned integers
fixes #1407 and #1408
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/util/clip_id.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/util/clip_id.cpp b/src/mbgl/util/clip_id.cpp
index be359c18c3..c475369c20 100644
--- a/src/mbgl/util/clip_id.cpp
+++ b/src/mbgl/util/clip_id.cpp
@@ -75,14 +75,14 @@ void ClipIDGenerator::update(std::forward_list<Tile *> tiles) {
if (pool.size()) {
const uint32_t bit_count = util::ceil_log2(pool.size() + 1);
- const std::bitset<8> mask = uint64_t(((1 << bit_count) - 1) << bit_offset);
+ const std::bitset<8> mask = uint64_t(((1ul << bit_count) - 1) << bit_offset);
// We are starting our count with 1 since we need at least 1 bit set to distinguish between
// areas without any tiles whatsoever and the current area.
uint8_t count = 1;
for (auto& leaf : pool) {
leaf.tile.clip.mask = mask;
- leaf.tile.clip.reference = count++ << bit_offset;
+ leaf.tile.clip.reference = uint32_t(count++) << bit_offset;
}
bit_offset += bit_count;