Browse Source

helper: suppress warning with gcc from to_entity

Michele Caini 3 years ago
parent
commit
14ed666b91
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/entt/entity/helper.hpp

+ 1 - 1
src/entt/entity/helper.hpp

@@ -145,7 +145,7 @@ Entity to_entity(const basic_registry<Entity> &reg, const Component &instance) {
     const auto *addr = std::addressof(instance);
 
     for(auto it = base.rbegin(), last = base.rend(); it < last; it += component_traits<Component>::page_size) {
-        if(const auto dist = (addr - std::addressof(storage.get(*it))); dist >= 0 && dist < component_traits<Component>::page_size) {
+        if(const auto dist = (addr - std::addressof(storage.get(*it))); dist >= 0 && dist < static_cast<decltype(dist)>(component_traits<Component>::page_size)) {
             return *(it + dist);
         }
     }