diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-05-15 14:42:43 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-05-15 14:42:43 +0200 |
commit | 8dd32e7d22088716225ab5f0926c465d452832a7 (patch) | |
tree | 0cd2848a692c84fb97569afdfb3f67ca15a89254 /src/mbgl/util/clip_id.cpp | |
parent | c7b513ad4276d4f1bce0949d2af7b0c669edb3a8 (diff) | |
download | qtlocation-mapboxgl-8dd32e7d22088716225ab5f0926c465d452832a7.tar.gz |
make sure bit shifts happen with unsigned integers
fixes #1407 and #1408
Diffstat (limited to 'src/mbgl/util/clip_id.cpp')
-rw-r--r-- | src/mbgl/util/clip_id.cpp | 4 |
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; |