summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-25 14:36:29 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-25 14:36:29 +0100
commit947a8d3ab773b539dfc18da20d8e5934b5ea9d62 (patch)
treef1a2ce5e913c8553a3fd6087a70f84f82c00669b
parent7d659dbe06cd8efc1d6eb4ef2c5fbc8ae27a4568 (diff)
use operator""uz c++23 polyfill
-rw-r--r--compat/format.hpp2
-rw-r--r--draw/anim.cpp4
-rw-r--r--editor/imgui-inspect.cpp2
-rw-r--r--editor/imgui-tiles.cpp2
-rw-r--r--editor/inspect.cpp2
-rw-r--r--entity/erased-constraints.cpp10
-rw-r--r--main/draw.cpp2
-rw-r--r--serialize/binary-reader.inl6
-rw-r--r--serialize/binary-writer.inl4
-rw-r--r--serialize/magnum-vector.hpp4
-rw-r--r--serialize/world-reader.cpp12
-rw-r--r--serialize/world-writer.cpp12
-rw-r--r--src/anim-atlas.cpp10
-rw-r--r--src/chunk-collision.cpp4
-rw-r--r--src/chunk-render.cpp16
-rw-r--r--src/chunk.cpp2
-rw-r--r--src/entity.cpp4
-rw-r--r--src/random.cpp2
-rw-r--r--src/tile-atlas.cpp2
-rw-r--r--test/bitmask.cpp4
-rw-r--r--test/serializer.cpp4
21 files changed, 55 insertions, 55 deletions
diff --git a/compat/format.hpp b/compat/format.hpp
index 2a88abab..6eaf10d8 100644
--- a/compat/format.hpp
+++ b/compat/format.hpp
@@ -27,7 +27,7 @@ struct fmt_string final {
template <size_t... Is>
consteval fmt_string(const char (&arr)[N]) noexcept {
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
data[i] = arr[i];
}
};
diff --git a/draw/anim.cpp b/draw/anim.cpp
index 7f1d5cda..84afbfe3 100644
--- a/draw/anim.cpp
+++ b/draw/anim.cpp
@@ -71,7 +71,7 @@ void anim_mesh::draw(tile_shader& shader, chunk& c)
} last;
size_t i = 0;
- for (auto k = 0_uz; k < size; k++)
+ for (auto k = 0uz; k < size; k++)
{
fm_assert(es[k].e);
const auto& e = *es[k].e;
@@ -118,7 +118,7 @@ void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, size_t
const auto& g = atlas.group(r);
const auto texcoords = atlas.texcoords_for_frame(r, frame, !g.mirror_from.isEmpty());
quad_data array;
- for (auto i = 0_uz; i < 4; i++)
+ for (auto i = 0uz; i < 4; i++)
array[i] = { pos[i], texcoords[i], depth };
_vertex_buffer.setSubData(0, array);
atlas.texture().bind(0);
diff --git a/editor/imgui-inspect.cpp b/editor/imgui-inspect.cpp
index b1ea923c..534dd1cf 100644
--- a/editor/imgui-inspect.cpp
+++ b/editor/imgui-inspect.cpp
@@ -26,7 +26,7 @@ void app::draw_inspector()
const auto dpi = M->dpi_scale();
- for (auto i = inspectors.size()-1; i != -1_uz; i--)
+ for (auto i = inspectors.size()-1; i != -1uz; i--)
{
auto [e, target] = inspectors[i];
fm_debug_assert(e);
diff --git a/editor/imgui-tiles.cpp b/editor/imgui-tiles.cpp
index ead843a8..0dbe10d3 100644
--- a/editor/imgui-tiles.cpp
+++ b/editor/imgui-tiles.cpp
@@ -49,7 +49,7 @@ void app::draw_editor_tile_pane_atlas(tile_editor& ed, StringView name, const st
};
const bool perm_selected = ed.is_permutation_selected(atlas);
constexpr size_t per_row = 8;
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
{
const bool selected = ed.is_tile_selected(atlas, i);
if (i > 0 && i % per_row == 0)
diff --git a/editor/inspect.cpp b/editor/inspect.cpp
index df286391..415dcdff 100644
--- a/editor/inspect.cpp
+++ b/editor/inspect.cpp
@@ -153,7 +153,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
ret = ImGui::SliderScalarN(label, igdt, &value, T::Size, &min, &max);
break;
}
- for (auto i = 0_uz; i < T::Size; i++)
+ for (auto i = 0uz; i < T::Size; i++)
value[i] = std::clamp(value[i], min[i], max[i]);
}
diff --git a/entity/erased-constraints.cpp b/entity/erased-constraints.cpp
index 552556cd..028b4881 100644
--- a/entity/erased-constraints.cpp
+++ b/entity/erased-constraints.cpp
@@ -23,7 +23,7 @@ template<typename T> std::pair<T, T> range::convert() const
using U = typename T::Type;
constexpr auto Size = T::Size;
T a, b;
- for (auto i = 0_uz; i < Size; i++)
+ for (auto i = 0uz; i < Size; i++)
a[i] = std::numeric_limits<U>::min(), b[i] = std::numeric_limits<U>::max();
return {a, b};
}
@@ -64,14 +64,14 @@ template<typename T> std::pair<T, T> range::convert() const
if constexpr(std::is_signed_v<U>)
{
fm_assert(type == type_int4);
- for (auto i = 0_uz; i < Size; i++)
+ for (auto i = 0uz; i < Size; i++)
a[i] = U(min.i4[i]), b[i] = U(max.i4[i]);
}
else
{
if (type == type_int4)
{
- for (auto i = 0_uz; i < Size; i++)
+ for (auto i = 0uz; i < Size; i++)
{
fm_assert(min.i4[i] >= 0 && max.i4[i] >= 0);
a[i] = U(min.i4[i]), b[i] = U(max.i4[i]);
@@ -80,7 +80,7 @@ template<typename T> std::pair<T, T> range::convert() const
else
{
fm_assert(type == type_uint4);
- for (auto i = 0_uz; i < Size; i++)
+ for (auto i = 0uz; i < Size; i++)
a[i] = U(min.u4[i]), b[i] = U(max.u4[i]);
}
}
@@ -89,7 +89,7 @@ template<typename T> std::pair<T, T> range::convert() const
{
static_assert(std::is_floating_point_v<U>);
fm_assert(type == type_float4);
- for (auto i = 0_uz; i < Size; i++)
+ for (auto i = 0uz; i < Size; i++)
a[i] = U(min.f4[i]), b[i] = U(max.f4[i]);
}
return { a, b };
diff --git a/main/draw.cpp b/main/draw.cpp
index 5c36e8d1..cf8ab20a 100644
--- a/main/draw.cpp
+++ b/main/draw.cpp
@@ -82,7 +82,7 @@ auto main_impl::get_draw_bounds() const noexcept -> draw_bounds
void main_impl::update_collect_threshold()
{
const auto [minx, maxx, miny, maxy] = get_draw_bounds();
- const auto value = std::max(64_uz, (size_t)(maxx-minx+4)*(size_t)(maxy-minx+4));
+ const auto value = std::max(64uz, (size_t)(maxx-minx+4)*(size_t)(maxy-minx+4));
if (!(GL::Context::current().configurationFlags() & GL::Implementation::ContextConfigurationFlag::QuietLog))
fm_debug("collect threshold is now %zu", value);
_world.set_collect_threshold(value);
diff --git a/serialize/binary-reader.inl b/serialize/binary-reader.inl
index b83fefc6..432b2fa0 100644
--- a/serialize/binary-reader.inl
+++ b/serialize/binary-reader.inl
@@ -23,7 +23,7 @@ constexpr T binary_reader<It>::read() noexcept(false)
fm_soft_assert((ptrdiff_t)N <= std::distance(it, end));
num_bytes_read += N;
char buf[N];
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
buf[i] = *it++;
return maybe_byteswap(std::bit_cast<T, decltype(buf)>(buf));
}
@@ -37,7 +37,7 @@ constexpr std::array<char, N> binary_reader<It>::read() noexcept(false)
array = {};
fm_soft_assert(N <= (size_t)std::distance(it, end));
num_bytes_read += N;
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
array[i] = *it++;
return array;
}
@@ -73,7 +73,7 @@ constexpr auto binary_reader<It>::read_asciiz_string() noexcept(false)
};
fixed_string ret;
- for (auto i = 0_uz; i < MAX && it != end; i++)
+ for (auto i = 0uz; i < MAX && it != end; i++)
{
const char c = *it++;
ret.buf[i] = c;
diff --git a/serialize/binary-writer.inl b/serialize/binary-writer.inl
index 3a5b83d6..e2428c5e 100644
--- a/serialize/binary-writer.inl
+++ b/serialize/binary-writer.inl
@@ -17,7 +17,7 @@ constexpr void binary_writer<It>::write(T x) noexcept
_bytes_written += sizeof(T);
constexpr size_t N = sizeof(T);
const auto buf = std::bit_cast<std::array<char, N>, T>(maybe_byteswap(x));
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
*it++ = buf[i];
}
@@ -34,7 +34,7 @@ constexpr void binary_writer<It>::write_asciiz_string(StringView str) noexcept
fm_debug_assert(str.flags() & StringViewFlag::NullTerminated);
const auto sz = str.size();
_bytes_written += sz + 1;
- for (auto i = 0_uz; i < sz; i++)
+ for (auto i = 0uz; i < sz; i++)
*it++ = str[i];
*it++ = '\0';
}
diff --git a/serialize/magnum-vector.hpp b/serialize/magnum-vector.hpp
index d1afc0db..a45103d8 100644
--- a/serialize/magnum-vector.hpp
+++ b/serialize/magnum-vector.hpp
@@ -16,7 +16,7 @@ template <size_t N, typename T>
void adl_serializer<Magnum::Math::Vector<N, T>>::to_json(json& j, const vec& val)
{
std::array<T, N> array{};
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
array[i] = val[i];
using nlohmann::to_json;
to_json(j, array);
@@ -28,7 +28,7 @@ void adl_serializer<Magnum::Math::Vector<N, T>>::from_json(const json& j, vec& v
std::array<T, N> array{};
using nlohmann::from_json;
from_json(j, array);
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
val[i] = array[i];
}
diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp
index 83ee7629..c5f504c9 100644
--- a/serialize/world-reader.cpp
+++ b/serialize/world-reader.cpp
@@ -91,14 +91,14 @@ void reader_state::read_sceneries(reader_t& s)
fm_soft_assert(sz < scenery_id_max);
sceneries.resize(sz);
- auto i = 0_uz;
+ auto i = 0uz;
while (i < sz)
{
uint8_t num; num << s;
fm_soft_assert(num > 0);
auto str = s.read_asciiz_string<atlas_name_max>();
auto sc = loader.scenery(str);
- for (auto n = 0_uz; n < num; n++)
+ for (auto n = 0uz; n < num; n++)
{
atlasid id; id << s;
fm_soft_assert(id < sz);
@@ -121,7 +121,7 @@ void reader_state::read_strings(reader_t& s)
{
uint32_t size; size << s;
strings.reserve(size);
- for (auto i = 0_uz; i < size; i++)
+ for (auto i = 0uz; i < size; i++)
{
auto str = s.read_asciiz_string<string_max>();
strings.emplace_back(StringView{str});
@@ -164,7 +164,7 @@ void reader_state::read_chunks(reader_t& s)
[[maybe_unused]] size_t nbytes_read = 0;
#endif
- for (auto k = 0_uz; k < N; k++)
+ for (auto k = 0uz; k < N; k++)
{
const auto nbytes_start = s.bytes_read();
@@ -177,7 +177,7 @@ void reader_state::read_chunks(reader_t& s)
ch.y << s;
auto& c = (*_world)[ch];
c.mark_modified();
- for (auto i = 0_uz; i < TILE_COUNT; i++)
+ for (auto i = 0uz; i < TILE_COUNT; i++)
{
SET_CHUNK_SIZE();
const tilemeta flags = s.read<tilemeta>();
@@ -219,7 +219,7 @@ void reader_state::read_chunks(reader_t& s)
SET_CHUNK_SIZE();
- for (auto i = 0_uz; i < entity_count; i++)
+ for (auto i = 0uz; i < entity_count; i++)
{
object_id _id; _id << s;
const auto oid = _id & (1ULL << 60)-1;
diff --git a/serialize/world-writer.cpp b/serialize/world-writer.cpp
index 043e015a..5fe835bf 100644
--- a/serialize/world-writer.cpp
+++ b/serialize/world-writer.cpp
@@ -269,7 +269,7 @@ void writer_state::serialize_scenery()
s << (atlasid)sz;
StringView last;
- for (auto i = 0_uz; i < sz; i++)
+ for (auto i = 0uz; i < sz; i++)
{
fm_debug_assert(s.bytes_written() + atlasbuf_size1 < atlasbuf_size);
const auto& [sc, idx] = vec[i];
@@ -277,7 +277,7 @@ void writer_state::serialize_scenery()
{
fm_assert(sc->name.size() < atlas_name_max);
last = sc->name;
- auto num = 1_uz;
+ auto num = 1uz;
for (auto j = i+1; j < sz && vec[j].s->name == sc->name; j++)
num++;
fm_assert(num < int_max<uint8_t>);
@@ -298,7 +298,7 @@ void writer_state::serialize_scenery()
void writer_state::serialize_strings()
{
static_assert(character_name_max <= string_max);
- auto len = 0_uz;
+ auto len = 0uz;
for (const auto& [k, v] : string_map)
{
fm_assert(k.size()+1 < string_max);
@@ -408,7 +408,7 @@ void writer_state::serialize_chunk(const chunk& c, chunk_coords coord)
s << chunk_magic << coord.x << coord.y;
- for (auto i = 0_uz; i < TILE_COUNT; i++)
+ for (auto i = 0uz; i < TILE_COUNT; i++)
{
const tile_proto x = c[i];
const auto ground = x.ground(), wall_north = x.wall_north(), wall_west = x.wall_west();
@@ -506,7 +506,7 @@ ArrayView<const char> writer_state::serialize_world()
fm_assert(_world->size() <= int_max<chunksiz>);
const auto len = fm_begin(
- auto len = 0_uz;
+ auto len = 0uz;
len += std::size(file_magic)-1;
len += sizeof(proto_t);
len += atlas_buf.size();
@@ -519,7 +519,7 @@ ArrayView<const char> writer_state::serialize_world()
return len;
);
file_buf.resize(len);
- auto bytes_written = 0_uz;
+ auto bytes_written = 0uz;
auto it = file_buf.begin();
const auto copy = [&](const auto& in) {
auto len1 = std::distance(std::cbegin(in), std::cend(in)),
diff --git a/src/anim-atlas.cpp b/src/anim-atlas.cpp
index 64bdbdbc..f5370cb5 100644
--- a/src/anim-atlas.cpp
+++ b/src/anim-atlas.cpp
@@ -30,7 +30,7 @@ decltype(anim_atlas::_group_indices) anim_atlas::make_group_indices(const anim_d
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
const auto ngroups = a.groups.size();
- for (auto i = 0_uz; i < ngroups; i++)
+ for (auto i = 0uz; i < ngroups; i++)
array[rotation_to_index(a.groups[i].name)] = uint8_t(i);
return array;
}
@@ -140,10 +140,10 @@ void anim_atlas::make_bitmask_(const ImageView2D& tex, BitArray& array)
fm_soft_assert(tex.pixelSize() == 4);
fm_soft_assert(pixels.stride()[1] == 4);
- for (auto j = 0_uz; j < height; j++)
+ for (auto j = 0uz; j < height; j++)
{
constexpr unsigned char amin = 32;
- auto i = 0_uz;
+ auto i = 0uz;
for (; i < width0; i += 8)
{
const auto src_idx = (j*stride + i*4)+3, dst_idx = (height-j-1)*width+i >> 3;
@@ -189,7 +189,7 @@ rotation anim_atlas::next_rotation_from(rotation r) const noexcept
for (auto i = size_t(r)+1; i < count; i++)
if (_group_indices[i] != 0xff)
return rotation(i);
- for (auto i = 0_uz; i < count; i++)
+ for (auto i = 0uz; i < count; i++)
if (_group_indices[i] != 0xff)
return rotation(i);
fm_abort("where did the rotations go?!");
@@ -216,7 +216,7 @@ bool anim_atlas::check_rotation(rotation r) const noexcept
rotation anim_atlas::first_rotation() const noexcept
{
- for (auto i = 0_uz; i < rot_count; i++)
+ for (auto i = 0uz; i < rot_count; i++)
if (_group_indices[i] == 0)
return rotation(i);
fm_abort("unreachable! can't find first rotation");
diff --git a/src/chunk-collision.cpp b/src/chunk-collision.cpp
index 438b6a61..f0548df6 100644
--- a/src/chunk-collision.cpp
+++ b/src/chunk-collision.cpp
@@ -68,7 +68,7 @@ void chunk::ensure_passability() noexcept
_add_bbox(box);
}
- for (auto i = 0_uz; i < TILE_COUNT; i++)
+ for (auto i = 0uz; i < TILE_COUNT; i++)
{
if (const auto* atlas = ground_atlas_at(i))
if (auto p = atlas->pass_mode(pass_mode::pass); p != pass_mode::pass)
@@ -78,7 +78,7 @@ void chunk::ensure_passability() noexcept
_rtree.Insert(min.data(), max.data(), id);
}
}
- for (auto i = 0_uz; i < TILE_COUNT; i++)
+ for (auto i = 0uz; i < TILE_COUNT; i++)
{
auto tile = operator[](i);
if (const auto* atlas = tile.wall_north_atlas().get())
diff --git a/src/chunk-render.cpp b/src/chunk-render.cpp
index 27a0367c..9d7787e3 100644
--- a/src/chunk-render.cpp
+++ b/src/chunk-render.cpp
@@ -13,7 +13,7 @@ template<size_t N = 1>
static auto make_index_array(size_t max)
{
std::array<std::array<UnsignedShort, 6>, N*TILE_COUNT> array; // NOLINT(cppcoreguidelines-pro-type-member-init)
- for (auto i = 0_uz; i < max; i++)
+ for (auto i = 0uz; i < max; i++)
array[i] = tile_atlas::indices(i);
return array;
}
@@ -25,7 +25,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple
_ground_modified = false;
size_t count = 0;
- for (auto i = 0_uz; i < TILE_COUNT; i++)
+ for (auto i = 0uz; i < TILE_COUNT; i++)
if (_ground_atlases[i])
ground_indexes[count++] = uint8_t(i);
@@ -35,7 +35,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple
});
std::array<std::array<vertex, 4>, TILE_COUNT> vertexes;
- for (auto k = 0_uz; k < count; k++)
+ for (auto k = 0uz; k < count; k++)
{
const uint8_t i = ground_indexes[k];
const auto& atlas = _ground_atlases[i];
@@ -44,7 +44,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple
const auto texcoords = atlas->texcoords_for_id(_ground_variants[i]);
const float depth = tile_shader::depth_value(pos);
auto& v = vertexes[k];
- for (auto j = 0_uz; j < 4; j++)
+ for (auto j = 0uz; j < 4; j++)
v[j] = { quad[j], texcoords[j], depth };
}
@@ -67,7 +67,7 @@ auto chunk::ensure_wall_mesh() noexcept -> wall_mesh_tuple
_walls_modified = false;
size_t count = 0;
- for (auto i = 0_uz; i < TILE_COUNT*2; i++)
+ for (auto i = 0uz; i < TILE_COUNT*2; i++)
if (_wall_atlases[i])
wall_indexes[count++] = uint16_t(i);
@@ -77,7 +77,7 @@ auto chunk::ensure_wall_mesh() noexcept -> wall_mesh_tuple
});
std::array<std::array<vertex, 4>, TILE_COUNT*2> vertexes;
- for (auto k = 0_uz; k < count; k++)
+ for (auto k = 0uz; k < count; k++)
{
const uint16_t i = wall_indexes[k];
const auto& atlas = _wall_atlases[i];
@@ -88,7 +88,7 @@ auto chunk::ensure_wall_mesh() noexcept -> wall_mesh_tuple
const float depth = tile_shader::depth_value(pos);
const auto texcoords = atlas->texcoords_for_id(variant);
auto& v = vertexes[k];
- for (auto j = 0_uz; j < 4; j++)
+ for (auto j = 0uz; j < 4; j++)
v[j] = { quad[j], texcoords[j], depth, };
}
@@ -180,7 +180,7 @@ auto chunk::ensure_scenery_mesh(Array<draw_entity>& array) noexcept -> scenery_m
const float depth = tile_shader::depth_value(pos, tile_shader::scenery_depth_offset);
scenery_vertexes.emplace_back();
auto& v = scenery_vertexes.back();
- for (auto j = 0_uz; j < 4; j++)
+ for (auto j = 0uz; j < 4; j++)
v[j] = { quad[j], texcoords[j], depth };
}
diff --git a/src/chunk.cpp b/src/chunk.cpp
index 2c65ccae..21ebe800 100644
--- a/src/chunk.cpp
+++ b/src/chunk.cpp
@@ -25,7 +25,7 @@ bool chunk::empty(bool force) const noexcept
{
if (!force && !_maybe_empty)
return false;
- for (auto i = 0_uz; i < TILE_COUNT; i++)
+ for (auto i = 0uz; i < TILE_COUNT; i++)
if (_ground_atlases[i] || _wall_atlases[i*2 + 0] || _wall_atlases[i*2 + 1] || !_entities.empty())
return _maybe_empty = false;
if (!_entities.empty())
diff --git a/src/entity.cpp b/src/entity.cpp
index 42ae5c4b..e0c060ff 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -112,7 +112,7 @@ Pair<global_coords, Vector2b> entity::normalize_coords(global_coords coord, Vect
auto off_tmp = Vector2i(cur_offset) + new_offset;
auto off_new = off_tmp % iTILE_SIZE2;
constexpr auto half_tile = iTILE_SIZE2/2;
- for (auto i = 0_uz; i < 2; i++)
+ for (auto i = 0uz; i < 2; i++)
{
auto sign = sgn(off_new[i]);
auto absval = std::abs(off_new[i]);
@@ -184,7 +184,7 @@ bool entity::move_to(size_t& i, Vector2i delta, rotation new_r)
const_cast<global_coords&>(coord) = coord_;
set_bbox_(offset_, bb_offset, bb_size, pass);
const_cast<rotation&>(r) = new_r;
- //for (auto i = 0_uz; const auto& x : es) fm_debug("%zu %s %f", i++, x->atlas->name().data(), x->ordinal());
+ //for (auto i = 0uz; const auto& x : es) fm_debug("%zu %s %f", i++, x->atlas->name().data(), x->ordinal());
//fm_debug("insert (%hd;%hd|%hhd;%hhd) %td -> %zu | %f", coord_.chunk().x, coord_.chunk().y, coord_.local().x, coord_.local().y, pos1, es.size(), e.ordinal());
return false;
}
diff --git a/src/random.cpp b/src/random.cpp
index 6bb70808..442d198e 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -23,7 +23,7 @@ size_t random_engine_impl::operator()()
size_t x;
uint32_t a[N];
} ret;
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
ret.a[i] = g();
return ret.x;
}
diff --git a/src/tile-atlas.cpp b/src/tile-atlas.cpp
index f7d29864..ed2f6d24 100644
--- a/src/tile-atlas.cpp
+++ b/src/tile-atlas.cpp
@@ -51,7 +51,7 @@ auto tile_atlas::make_texcoords_array(Vector2ui pixel_size, Vector2ub tile_count
{
const size_t N = Vector2ui{tile_count}.product();
auto ptr = std::make_unique<std::array<Vector2, 4>[]>(N);
- for (auto i = 0_uz; i < N; i++)
+ for (auto i = 0uz; i < N; i++)
ptr[i] = make_texcoords(pixel_size, tile_count, i);
return ptr;
}
diff --git a/test/bitmask.cpp b/test/bitmask.cpp
index 1b3deea9..dd5f2759 100644
--- a/test/bitmask.cpp
+++ b/test/bitmask.cpp
@@ -47,7 +47,7 @@ void bitmask_test()
auto bitmask = anim_atlas::make_bitmask(img);
fm_assert(img.pixelSize() == 4 && (size_t)img.size().product() >= data_nbytes);
#ifdef DO_GENERATE
- for (auto i = 0_uz; i < data_nbytes; i++)
+ for (auto i = 0uz; i < data_nbytes; i++)
{
if (i && i % 16 == 0)
printf("\n");
@@ -59,7 +59,7 @@ void bitmask_test()
fflush(stdout);
#endif
const auto len = std::min(data_nbytes, (size_t)bitmask.size()+7 >> 3);
- for (auto i = 0_uz; i < len; i++)
+ for (auto i = 0uz; 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/serializer.cpp b/test/serializer.cpp
index 236003cf..0e10b899 100644
--- a/test/serializer.cpp
+++ b/test/serializer.cpp
@@ -49,13 +49,13 @@ void assert_chunks_equal(const chunk& a, const chunk& b)
{
fm_assert(a.entities().size() == b.entities().size());
- for (auto i = 0_uz; i < TILE_COUNT; i++)
+ for (auto i = 0uz; i < TILE_COUNT; i++)
{
const auto &a1 = a[i], &b1 = b[i];
fm_assert(a1 == b1);
}
- for (auto i = 0_uz; i < a.entities().size(); i++)
+ for (auto i = 0uz; i < a.entities().size(); i++)
{
const auto& ae = *a.entities()[i];
const auto& be = *b.entities()[i];