Bladeren bron

minor changes

Michele Caini 8 jaren geleden
bovenliggende
commit
367fd3e87f

+ 2 - 2
src/entt/core/hashed_string.hpp

@@ -24,8 +24,8 @@ class HashedString final {
         const char *str;
     };
 
-    static constexpr std::uint64_t offset = 14695981039346656037u;
-    static constexpr std::uint64_t prime = 1099511628211u;
+    static constexpr std::uint64_t offset = 14695981039346656037ull;
+    static constexpr std::uint64_t prime = 1099511628211ull;
 
     // Fowler–Noll–Vo hash function v. 1a - the good
     static constexpr std::uint64_t helper(std::uint64_t partial, const char *str) noexcept {

+ 2 - 2
src/entt/process/scheduler.hpp

@@ -110,7 +110,7 @@ class Scheduler final {
     }
 
     auto then(ProcessHandler *handler) {
-        auto lambda = [this](ProcessHandler *handler, auto next, auto... args) {
+        auto lambda = [](ProcessHandler *handler, auto next, auto... args) {
             using Proc = typename decltype(next)::type;
 
             if(handler) {
@@ -280,7 +280,7 @@ public:
         }
 
         if(clean) {
-            handlers.erase(std::remove_if(handlers.begin(), handlers.end(), [delta](auto &handler) {
+            handlers.erase(std::remove_if(handlers.begin(), handlers.end(), [](auto &handler) {
                 return !handler.instance;
             }), handlers.end());
         }

+ 2 - 2
test/entt/core/hashed_string.cpp

@@ -21,8 +21,8 @@ TEST(HashedString, Functionalities) {
 
     const char *bar = "bar";
 
-    auto fooHs = entt::HashedString("foo");
-    auto barHs = entt::HashedString(bar);
+    auto fooHs = entt::HashedString{"foo"};
+    auto barHs = entt::HashedString{bar};
 
     ASSERT_NE(static_cast<hash_type>(fooHs), static_cast<hash_type>(barHs));
     ASSERT_EQ(static_cast<const char *>(fooHs), "foo");

+ 3 - 3
test/entt/entity/sparse_set.cpp

@@ -159,7 +159,7 @@ TEST(SparseSetWithType, SortOrdered) {
     ASSERT_EQ(set.get(3), 3);
     ASSERT_EQ(set.get(9), 1);
 
-    set.sort([&set](auto lhs, auto rhs) {
+    set.sort([](auto lhs, auto rhs) {
         return lhs < rhs;
     });
 
@@ -195,7 +195,7 @@ TEST(SparseSetWithType, SortReverse) {
     ASSERT_EQ(set.get(3), 9);
     ASSERT_EQ(set.get(9), 12);
 
-    set.sort([&set](auto lhs, auto rhs) {
+    set.sort([](auto lhs, auto rhs) {
         return lhs < rhs;
     });
 
@@ -231,7 +231,7 @@ TEST(SparseSetWithType, SortUnordered) {
     ASSERT_EQ(set.get(3), 9);
     ASSERT_EQ(set.get(9), 12);
 
-    set.sort([&set](auto lhs, auto rhs) {
+    set.sort([](auto lhs, auto rhs) {
         return lhs < rhs;
     });