diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-24 19:31:29 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-24 19:39:36 +0100 |
commit | 0f140e2de05b10cca6307054a268d4d058ceeb0c (patch) | |
tree | 2ce60fa5f476f59a076534005f332b187e34e944 | |
parent | bf67006acb9937d9e784cb5fb68f576ae858d610 (diff) |
src: clean up warnings
-rw-r--r-- | src/chunk-region.cpp | 7 | ||||
-rw-r--r-- | src/object.cpp | 8 |
2 files changed, 2 insertions, 13 deletions
diff --git a/src/chunk-region.cpp b/src/chunk-region.cpp index 79114219..6640758c 100644 --- a/src/chunk-region.cpp +++ b/src/chunk-region.cpp @@ -67,7 +67,6 @@ struct tmp_s static uint32_t get_index(Vector2i pos); void append(std::bitset<chunk_bits>& passable, Vector2i pos); [[nodiscard]] bool check_visited(std::bitset<chunk_bits>& passable, Vector2i pos, int from); - void clear(); }; uint32_t tmp_s::get_index(Vector2i pos) @@ -96,12 +95,6 @@ bool tmp_s::check_visited(std::bitset<chunk_bits>& passable, Vector2i pos, int f return true; } -void tmp_s::clear() -{ - arrayResize(stack, 0); - visited = {}; -} - tmp_s& get_tmp() { static Pointer<tmp_s> tmp = [] { diff --git a/src/object.cpp b/src/object.cpp index 34659aa5..010c1aa5 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -19,10 +19,6 @@ namespace { constexpr auto object_id_lessp = [](const auto& a, const auto& b) { return a->id < b->id; }; -#if defined __GNUG__ && !defined __clang__ -#pragma GCC diagnostic ignored "-Wignored-qualifiers" -#endif - // todo rewrite using bitwise ops. try this instead: x = 31; int((x+64+32)/64), (x + 64 + 32)%64 - 1 template<int tile_size> constexpr inline Pair<int, int8_t> normalize_coord(const int8_t cur, const int new_off) @@ -34,8 +30,8 @@ constexpr inline Pair<int, int8_t> normalize_coord(const int8_t cur, const int n auto a = Math::abs(x); auto s = Math::sign(x); bool b = x >= half_tile | x < -half_tile; - int tmask = -(volatile int)b; - int8_t xmask = -(volatile int8_t)b; + auto tmask = -(int)b; + auto xmask = (int8_t)-(int8_t)b; t += s & tmask; x = (int8_t)((tile_size - a)*-s) & xmask | (int8_t)(x & ~xmask); return { t, (int8_t)x }; |