Skip to content

Commit b10ba4d

Browse files
committed
entity: handle conversion warnings
1 parent ba70637 commit b10ba4d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: src/entt/entity/group.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ class basic_group<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> {
794794
* @return An iterator to the first entity of the group.
795795
*/
796796
[[nodiscard]] iterator begin() const noexcept {
797-
return *this ? (handle().end() - descriptor->length()) : iterator{};
797+
return *this ? (handle().end() - static_cast<typename iterator::difference_type>(descriptor->length())) : iterator{};
798798
}
799799

800800
/**
@@ -824,7 +824,7 @@ class basic_group<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> {
824824
* reversed group.
825825
*/
826826
[[nodiscard]] reverse_iterator rend() const noexcept {
827-
return *this ? (handle().rbegin() + descriptor->length()) : reverse_iterator{};
827+
return *this ? (handle().rbegin() + static_cast<typename reverse_iterator::difference_type>(descriptor->length())) : reverse_iterator{};
828828
}
829829

830830
/**
@@ -864,7 +864,7 @@ class basic_group<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> {
864864
* @return The identifier that occupies the given position.
865865
*/
866866
[[nodiscard]] entity_type operator[](const size_type pos) const {
867-
return begin()[pos];
867+
return begin()[static_cast<typename iterator::difference_type>(pos)];
868868
}
869869

870870
/**

Diff for: src/entt/entity/registry.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ class basic_registry {
960960
void clear() {
961961
if constexpr(sizeof...(Type) == 0u) {
962962
for(size_type pos = pools.size(); pos; --pos) {
963-
pools.begin()[pos - 1u].second->clear();
963+
pools.begin()[static_cast<typename pool_container_type::difference_type>(pos - 1u)].second->clear();
964964
}
965965

966966
const auto elem = entities.each();

Diff for: src/entt/entity/sparse_set.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ class basic_sparse_set {
904904
++first;
905905
}
906906

907-
count += std::distance(it, first);
907+
count += static_cast<size_type>(std::distance(it, first));
908908
erase(it, first);
909909
}
910910
} else {

0 commit comments

Comments
 (0)