diff options
-rw-r--r-- | draw/anim.cpp | 2 | ||||
-rw-r--r-- | serialize/world-writer.cpp | 2 | ||||
-rw-r--r-- | src/object.cpp | 2 | ||||
-rw-r--r-- | src/world.cpp | 4 | ||||
-rw-r--r-- | test/bitmask.cpp | 2 | ||||
-rw-r--r-- | userconfig-sthalik@Windows-GNU.cmake | 1 |
6 files changed, 7 insertions, 6 deletions
diff --git a/draw/anim.cpp b/draw/anim.cpp index e83bf5e5..12d5d0c4 100644 --- a/draw/anim.cpp +++ b/draw/anim.cpp @@ -77,7 +77,7 @@ void anim_mesh::draw(tile_shader& shader, const Vector2i& win_size, chunk& c, st { fm_assert(i < size); GL::MeshView mesh{mesh_}; - mesh.setCount((int)(quad_index_count * 1)); + mesh.setCount(quad_index_count * 1); mesh.setIndexOffset((int)(x.mesh_idx*quad_index_count), 0, max_index); shader.draw(atlas.texture(), mesh); i++; diff --git a/serialize/world-writer.cpp b/serialize/world-writer.cpp index 0c15291a..78ce3ac2 100644 --- a/serialize/world-writer.cpp +++ b/serialize/world-writer.cpp @@ -600,7 +600,7 @@ ArrayView<const char> writer_state::serialize_world() copy(atlas_buf); copy(scenery_buf); copy(string_buf); - copy_int((object_id)_world->object_counter()); + copy_int(_world->object_counter()); copy_int((chunksiz)_world->size()); for (const auto& buf : chunk_bufs) copy(buf); diff --git a/src/object.cpp b/src/object.cpp index b7439d31..3316dac8 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -242,7 +242,7 @@ void object::move_to(size_t& i, Vector2i delta, rotation new_r) void object::move_to(Magnum::Vector2i delta) { auto i = index(); - (void)move_to(i, delta, r); + move_to(i, delta, r); } void object::set_bbox_(Vector2b offset_, Vector2b bbox_offset_, Vector2ub bbox_size_, pass_mode pass_) diff --git a/src/world.cpp b/src/world.cpp index fd6e4cbb..29c9378e 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -6,7 +6,7 @@ using namespace floormat; -size_t world::object_id_hasher::operator()(object_id id) const noexcept { return (size_t)int_hash(id); } +size_t world::object_id_hasher::operator()(object_id id) const noexcept { return int_hash(id); } size_t world::chunk_coords_hasher::operator()(const chunk_coords_& coord) const noexcept { @@ -14,7 +14,7 @@ size_t world::chunk_coords_hasher::operator()(const chunk_coords_& coord) const x |= uint64_t((uint16_t)coord.x) << 0; x |= uint64_t((uint16_t)coord.y) << 16; x |= uint64_t( (uint8_t)coord.z) << 32; - return (size_t)int_hash(x); + return int_hash(x); } namespace floormat { diff --git a/test/bitmask.cpp b/test/bitmask.cpp index dd5f2759..63fc9d15 100644 --- a/test/bitmask.cpp +++ b/test/bitmask.cpp @@ -34,7 +34,7 @@ const unsigned char data_door_close[] = { { auto time0 = clock.now(); for (int i = 0; i < cycles; i++) - (void)anim_atlas::make_bitmask_(img, bitmask); + anim_atlas::make_bitmask_(img, bitmask); std::chrono::duration<double, std::milli> time = clock.now() - time0; fm_log("[BENCH] bitmask %d/%d took %.1f ms", i, runs, time.count()); diff --git a/userconfig-sthalik@Windows-GNU.cmake b/userconfig-sthalik@Windows-GNU.cmake index 7b7759ae..e29a21cf 100644 --- a/userconfig-sthalik@Windows-GNU.cmake +++ b/userconfig-sthalik@Windows-GNU.cmake @@ -65,6 +65,7 @@ function(fm-userconfig-src) -Wall -Wextra -Wpedantic -Wno-old-style-cast -Wno-padded #-fconcepts-diagnostics-depth=2 ) + #add_compile_options(-Wuseless-cast) add_link_options(-Wno-lto-type-mismatch -Wno-odr) add_compile_options( #-Wno-c++20-compat |