diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-13 07:48:51 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-13 07:48:51 +0100 |
commit | 4766b404d5fa96fbb23a121cbe01336d1eb7dd29 (patch) | |
tree | 46f8f342b6b8c1b7e5093e36e712ca1597a4a528 | |
parent | d87c0cb28720610ca7483f2d8de0613f583dc354 (diff) |
fix msvc
-rw-r--r-- | compat/map.hpp | 9 | ||||
-rw-r--r-- | serialize/packbits.cpp | 8 | ||||
-rw-r--r-- | src/chunk-walls.cpp | 4 | ||||
-rw-r--r-- | test/map.cpp | 4 |
4 files changed, 10 insertions, 15 deletions
diff --git a/compat/map.hpp b/compat/map.hpp index 7983a805..3c1610d4 100644 --- a/compat/map.hpp +++ b/compat/map.hpp @@ -14,11 +14,6 @@ constexpr auto map0(const F& fun, const std::array<T, N>& array, std::index_sequ return std::array { fun(array[Indexes])... }; } -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -#endif - template<typename T, typename F> [[deprecated("zero-length array!")]] CORRADE_ALWAYS_INLINE @@ -27,10 +22,6 @@ constexpr auto map0(const F&, const std::array<T, 0>&, std::index_sequence<>) return std::array<std::decay_t<std::invoke_result_t<std::decay_t<F>, const std::remove_cvref_t<T>&>>, 0>{}; } -#ifdef _MSC_VER -#pragma warning(pop) -#endif - } // namespace floormat::detail::map namespace floormat { diff --git a/serialize/packbits.cpp b/serialize/packbits.cpp index 701cc121..1428b203 100644 --- a/serialize/packbits.cpp +++ b/serialize/packbits.cpp @@ -12,10 +12,10 @@ constexpr bool test1() constexpr size_t bits[] = { 5, 2, 1, 0 }; constexpr size_t vals[] = { 3, 1, 0 }; - constexpr auto S0 = Storage<uint8_t, 8>{0b10111011uz}; - constexpr auto S1 = Storage<uint8_t, bits[0]>{0b00000101uz}; - constexpr auto S2 = Storage<uint8_t, bits[1]>{0b00000001uz}; - constexpr auto S3 = Storage<uint8_t, bits[2]>{0b00000000uz}; + constexpr auto S0 = Storage<uint8_t, 8>{0b10111011}; + constexpr auto S1 = Storage<uint8_t, bits[0]>{0b00000101}; + constexpr auto S2 = Storage<uint8_t, bits[1]>{0b00000001}; + constexpr auto S3 = Storage<uint8_t, bits[2]>{0b00000000}; using P0 = std::decay_t<decltype(S0)>; using P1 = P0::next<bits[0]>; diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp index 74a975fb..98d12684 100644 --- a/src/chunk-walls.cpp +++ b/src/chunk-walls.cpp @@ -208,7 +208,7 @@ GL::Mesh chunk::make_wall_mesh() { const auto frames = atlas->frames(dir.top); auto variant = (variant_ != (uint8_t)-1 ? variant_ : vpos); - variant += !is_west ? frames.size() - 1 : 1; + variant += (uint8_t)(!is_west ? frames.size() - 1 : 1); variant = variant % frames.size(); constexpr Vector2 half_tile = TILE_SIZE2*.5f; constexpr float X = half_tile.x(), Y = half_tile.y(), Z = TILE_SIZE.z(); @@ -274,7 +274,7 @@ GL::Mesh chunk::make_wall_mesh() fm_assert(i < vertexes.size()); _walls->mesh_indexes[i] = (uint16_t)k; auto& v = vertexes[i]; - auto quad = get_quad(D, Group_::corner, Depth); + auto quad = get_quad(D, Group_::corner, (float)Depth); for (auto& v : quad) v += center; for (uint8_t j = 0; j < 4; j++) diff --git a/test/map.cpp b/test/map.cpp index 69c9942c..97007b73 100644 --- a/test/map.cpp +++ b/test/map.cpp @@ -2,6 +2,10 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif +#ifdef _MSC_VER +#pragma warning(disable : 4996) // zero-length array +#endif + #include "compat/map.hpp" #include "compat/assert.hpp" |