diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-18 23:42:07 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-18 23:42:07 +0100 |
commit | 4d9a82b720c8ce74b94f43f72ddd819ef21abbdf (patch) | |
tree | c0a5d21b8e19fbb60c286faec8e302e6f32b6679 /test | |
parent | 32b8c22828315292857e2cd9909fba620f30ff70 (diff) |
pre-declare integer types without cstddef/cstdint
Diffstat (limited to 'test')
-rw-r--r-- | test/bitmask.cpp | 6 | ||||
-rw-r--r-- | test/entity.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/bitmask.cpp b/test/bitmask.cpp index 5398bce7..1b3deea9 100644 --- a/test/bitmask.cpp +++ b/test/bitmask.cpp @@ -16,7 +16,7 @@ namespace floormat { namespace { -constexpr std::size_t data_nbytes = 128; +constexpr size_t data_nbytes = 128; const unsigned char data_door_close[] = { #include "bitmask.embed.inc" }; @@ -45,7 +45,7 @@ void bitmask_test() { auto img = loader.texture(loader.SCENERY_PATH, "door-close"_s); auto bitmask = anim_atlas::make_bitmask(img); - fm_assert(img.pixelSize() == 4 && (std::size_t)img.size().product() >= data_nbytes); + fm_assert(img.pixelSize() == 4 && (size_t)img.size().product() >= data_nbytes); #ifdef DO_GENERATE for (auto i = 0_uz; i < data_nbytes; i++) { @@ -58,7 +58,7 @@ void bitmask_test() printf("\n"); fflush(stdout); #endif - const auto len = std::min(data_nbytes, (std::size_t)bitmask.size()+7 >> 3); + const auto len = std::min(data_nbytes, (size_t)bitmask.size()+7 >> 3); for (auto i = 0_uz; i < len; i++) if ((unsigned char)bitmask.data()[i] != data_door_close[i]) fm_abort("wrong value at bit %zu, should be' 0x%02hhx'", i, data_door_close[i]); diff --git a/test/entity.cpp b/test/entity.cpp index 88598cb2..40b7eb6b 100644 --- a/test/entity.cpp +++ b/test/entity.cpp @@ -215,7 +215,7 @@ constexpr void test_constraints() static_assert(foo.get_group(x) == "foo"_s); static_assert(m_foo.get_range(x) == constraints::range<int>{}); - static_assert(m_foo.get_max_length(x) == (std::size_t)-1); + static_assert(m_foo.get_max_length(x) == (size_t)-1); static_assert(m_foo.get_group(x) == ""_s); constexpr auto foo2 = entity::type<int>::field { |