소스 검색

build system: suppress a few other warnings here and there

Michele Caini 6 년 전
부모
커밋
7aaa6dd986
3개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 1
      src/entt/core/hashed_string.hpp
  2. 2 2
      test/lib/registry/lib.cpp
  3. 2 2
      test/lib/registry_std/lib.cpp

+ 3 - 1
src/entt/core/hashed_string.hpp

@@ -25,6 +25,7 @@ struct fnv1a_traits;
 
 template<>
 struct fnv1a_traits<std::uint32_t> {
+    using type = std::uint32_t;
     static constexpr std::uint32_t offset = 2166136261;
     static constexpr std::uint32_t prime = 16777619;
 };
@@ -32,6 +33,7 @@ struct fnv1a_traits<std::uint32_t> {
 
 template<>
 struct fnv1a_traits<std::uint64_t> {
+    using type = std::uint64_t;
     static constexpr std::uint64_t offset = 14695981039346656037ull;
     static constexpr std::uint64_t prime = 1099511628211ull;
 };
@@ -72,7 +74,7 @@ class basic_hashed_string {
         auto value = traits_type::offset;
 
         while(*curr != 0) {
-            value = (value ^ (*(curr++))) * traits_type::prime;
+            value = (value ^ static_cast<traits_type::type>(*(curr++))) * traits_type::prime;
         }
 
         return value;

+ 2 - 2
test/lib/registry/lib.cpp

@@ -4,8 +4,8 @@
 
 ENTT_API void update_position(entt::registry &registry) {
     registry.view<position, velocity>().each([](auto &pos, auto &vel) {
-        pos.x += 16 * vel.dx;
-        pos.y += 16 * vel.dy;
+        pos.x += static_cast<int>(16 * vel.dx);
+        pos.y += static_cast<int>(16 * vel.dy);
     });
 }
 

+ 2 - 2
test/lib/registry_std/lib.cpp

@@ -4,8 +4,8 @@
 
 ENTT_API void update_position(entt::registry &registry) {
     registry.view<position, velocity>().each([](auto &pos, auto &vel) {
-        pos.x += 16 * vel.dx;
-        pos.y += 16 * vel.dy;
+        pos.x += static_cast<int>(16 * vel.dx);
+        pos.y += static_cast<int>(16 * vel.dy);
     });
 }