diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-28 18:29:02 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-28 20:13:32 +0100 |
commit | 78a3eec9be053a1f82cf2e6235bbaa4deb4a1335 (patch) | |
tree | 4539ba47695bc7b5fd974e2508067cb2fd168636 /serialize | |
parent | 75508e3c03f659080df7db2211fb5a80cc1afeee (diff) |
switch to using unqualified calls to {move,forward,swap}
Diffstat (limited to 'serialize')
-rw-r--r-- | serialize/binary-reader.inl | 2 | ||||
-rw-r--r-- | serialize/ground-atlas.cpp | 3 | ||||
-rw-r--r-- | serialize/packbits-read.hpp | 5 | ||||
-rw-r--r-- | serialize/savegame.cpp | 14 | ||||
-rw-r--r-- | serialize/wall-atlas.cpp | 8 |
5 files changed, 15 insertions, 17 deletions
diff --git a/serialize/binary-reader.inl b/serialize/binary-reader.inl index b8bf6484..d19534f9 100644 --- a/serialize/binary-reader.inl +++ b/serialize/binary-reader.inl @@ -12,7 +12,7 @@ constexpr binary_reader<It>::binary_reader(const Seq& seq) noexcept template<string_input_iterator It> constexpr binary_reader<It>::binary_reader(It begin, It end) noexcept : - it{std::move(begin)}, end{std::move(end)} + it{move(begin)}, end{move(end)} {} template<string_input_iterator It> diff --git a/serialize/ground-atlas.cpp b/serialize/ground-atlas.cpp index 6844019c..d563bb05 100644 --- a/serialize/ground-atlas.cpp +++ b/serialize/ground-atlas.cpp @@ -8,7 +8,6 @@ #include "serialize/magnum-vector.hpp" #include "serialize/pass-mode.hpp" #include <tuple> -#include <Corrade/Utility/Move.h> #include <Magnum/Trade/ImageData.h> #include <Magnum/ImageView.h> #include <nlohmann/json.hpp> @@ -58,7 +57,7 @@ void adl_serializer<std::shared_ptr<ground_atlas>>::to_json(json& j, const std:: void adl_serializer<std::shared_ptr<ground_atlas>>::from_json(const json& j, std::shared_ptr<ground_atlas>& val) { ground_def def = j; - val = std::make_shared<ground_atlas>(std::move(def), loader.texture(loader.GROUND_TILESET_PATH, def.name)); + val = std::make_shared<ground_atlas>(move(def), loader.texture(loader.GROUND_TILESET_PATH, def.name)); } } // namespace nlohmann diff --git a/serialize/packbits-read.hpp b/serialize/packbits-read.hpp index d2622d49..4ad3aa74 100644 --- a/serialize/packbits-read.hpp +++ b/serialize/packbits-read.hpp @@ -4,7 +4,6 @@ #include <type_traits> #include <concepts> #include <tuple> -#include <Corrade/Utility/Move.h> namespace floormat::Pack_impl { @@ -103,7 +102,7 @@ constexpr CORRADE_ALWAYS_INLINE void read_(Tuple&& tuple, input<T, Left> st, std using next_type = typename input<T, Left>::template next<Size>; std::get<I>(tuple).value = st.template get<Size>(); T next_value = st.template advance<Size>(); - read_(Utility::forward<Tuple>(tuple), next_type{ next_value }, std::index_sequence<Is...>{}); + read_(floormat::forward<Tuple>(tuple), next_type{ next_value }, std::index_sequence<Is...>{}); } template<std::unsigned_integral T, typename Tuple, size_t Left> @@ -125,7 +124,7 @@ requires requires (const Tuple& tuple) { { constexpr size_t nbits = sizeof(T)*8, tuple_size = std::tuple_size_v<std::decay_t<Tuple>>; - Pack_impl::read_(Utility::forward<Tuple>(tuple), + Pack_impl::read_(floormat::forward<Tuple>(tuple), Pack_impl::input<T, nbits>{value}, std::make_index_sequence<tuple_size>{}); } diff --git a/serialize/savegame.cpp b/serialize/savegame.cpp index d84ce143..10f4d1cf 100644 --- a/serialize/savegame.cpp +++ b/serialize/savegame.cpp @@ -473,7 +473,7 @@ ok: intern_atlas_(atlas, type, byte_writer{s}); auto id = (uint32_t)atlas_array.size(); fm_assert(s.bytes_written() == s.bytes_allocated()); - atlas_array.emplace_back(std::move(buf), atlas, type); + atlas_array.emplace_back(move(buf), atlas, type); kv.value() = id; fm_assert(id < null<atlasid>); return atlasid{id}; @@ -628,7 +628,7 @@ ok: b.write_asciiz_string(s); } fm_assert(b.bytes_written() == b.bytes_allocated()); - string_buf = std::move(buf); + string_buf = move(buf); } void serialize_world() @@ -659,7 +659,7 @@ ok: binary_writer s{&hdr.data[0], hdr.size}; serialize_header_(byte_writer{s}); fm_assert(s.bytes_written() == s.bytes_allocated()); - header_buf = std::move(hdr); + header_buf = move(hdr); } serialize_strings_(); @@ -982,19 +982,19 @@ ok: deserialize_tile_part<atlasid>([&](uint32_t i, uint32_t id) { auto name = get_atlas<atlas_type::ground>(id); auto a = loader.ground_atlas(name, loader_policy::warn); - c[i].ground() = { std::move(a), (variant_t)-1 }; + c[i].ground() = { move(a), (variant_t)-1 }; }, i, r); for (uint32_t i = 0; i < TILE_COUNT; i++) deserialize_tile_part<atlasid>([&](uint32_t i, uint32_t id) { auto name = get_atlas<atlas_type::wall>(id); auto a = loader.wall_atlas(name, loader_policy::warn); - c[i].wall_north() = { std::move(a), (variant_t)-1 }; + c[i].wall_north() = { move(a), (variant_t)-1 }; }, i, r); for (uint32_t i = 0; i < TILE_COUNT; i++) deserialize_tile_part<atlasid>([&](uint32_t i, uint32_t id) { auto name = get_atlas<atlas_type::wall>(id); auto a = loader.wall_atlas(name, loader_policy::warn); - c[i].wall_west() = { std::move(a), (variant_t)-1 }; + c[i].wall_west() = { move(a), (variant_t)-1 }; }, i, r); for (uint32_t i = 0; i < TILE_COUNT; i++) deserialize_tile_part<variant_t>([&](uint32_t i, variant_t id) { @@ -1052,7 +1052,7 @@ class world world::deserialize(StringView filename, loader_policy asset_policy) if (auto ret = std::fread(&buf_[0], 1, len+1, f); ret != len) fm_throw("fread short read: {}"_cf, get_error_string(errbuf)); - buf.data = std::move(buf_); + buf.data = move(buf_); buf.size = len; } diff --git a/serialize/wall-atlas.cpp b/serialize/wall-atlas.cpp index 4e661674..3e120bb5 100644 --- a/serialize/wall-atlas.cpp +++ b/serialize/wall-atlas.cpp @@ -109,7 +109,7 @@ wall_atlas_def wall_atlas_def::deserialize(StringView filename) auto [dirs, dir_indexes, mask] = read_all_directions(jroot); fm_soft_assert(!dirs.isEmpty()); fm_soft_assert(dir_indexes != std::array<Wall::DirArrayIndex, Direction_COUNT>{}); - atlas.direction_array = std::move(dirs); + atlas.direction_array = move(dirs); atlas.direction_map = dir_indexes; atlas.direction_mask = mask; @@ -268,9 +268,9 @@ void write_all_frames(json& jroot, ArrayView<const Frame> array) for (const Frame& frame : array) { json jframe = frame; - jframes.push_back(std::move(jframe)); + jframes.push_back(move(jframe)); } - jroot["frames"] = std::move(jframes); + jroot["frames"] = move(jframes); } void write_group_metadata(json& jgroup, const Group& val) @@ -318,7 +318,7 @@ void write_all_directions(json& jroot, const wall_atlas& a) { auto jdir = json{}; write_direction_metadata(jdir, *dir); - jroot[name] = std::move(jdir); + jroot[name] = move(jdir); } } } |