From 51d73e37df4e225f9df01afc0f72290880645a21 Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 9 Mar 2025 17:07:06 +0100 Subject: [PATCH] Fix msvc warnings components\lua\configuration.cpp(133): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data components\esm3\effectlist.cpp(35): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data components_tests\misc\testmathutil.cpp(54): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type' components_tests\misc\testmathutil.cpp(62): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type' components_tests\misc\testmathutil.cpp(131): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type' components_tests\misc\testmathutil.cpp(135): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type' components_tests\misc\testmathutil.cpp(135): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type' components_tests\misc\testmathutil.cpp(139): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type' --- apps/components_tests/misc/testmathutil.cpp | 10 +++++----- components/esm3/effectlist.cpp | 2 +- components/lua/l10n.cpp | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/components_tests/misc/testmathutil.cpp b/apps/components_tests/misc/testmathutil.cpp index c4b545c2f4..099bd6db9e 100644 --- a/apps/components_tests/misc/testmathutil.cpp +++ b/apps/components_tests/misc/testmathutil.cpp @@ -51,7 +51,7 @@ namespace Misc const std::pair eulerAnglesXZQuat[] = { { osg::Quat(1, 0, 0, 0), - osg::Vec3f(0, 0, osg::PI), + osg::Vec3f(0, 0, osg::PIf), }, { osg::Quat(0, 1, 0, 0), @@ -59,7 +59,7 @@ namespace Misc }, { osg::Quat(0, 0, 1, 0), - osg::Vec3f(0, 0, osg::PI), + osg::Vec3f(0, 0, osg::PIf), }, { osg::Quat(0, 0, 0, 1), @@ -128,15 +128,15 @@ namespace Misc const std::pair eulerAnglesZYXQuat[] = { { osg::Quat(1, 0, 0, 0), - osg::Vec3f(osg::PI, 0, 0), + osg::Vec3f(osg::PIf, 0, 0), }, { osg::Quat(0, 1, 0, 0), - osg::Vec3f(osg::PI, 0, osg::PI), + osg::Vec3f(osg::PIf, 0, osg::PIf), }, { osg::Quat(0, 0, 1, 0), - osg::Vec3f(0, 0, osg::PI), + osg::Vec3f(0, 0, osg::PIf), }, { osg::Quat(0, 0, 0, 1), diff --git a/components/esm3/effectlist.cpp b/components/esm3/effectlist.cpp index a71eccfb84..5a1fa91f28 100644 --- a/components/esm3/effectlist.cpp +++ b/components/esm3/effectlist.cpp @@ -32,7 +32,7 @@ namespace ESM void EffectList::updateIndexes() { for (size_t i = 0; i < mList.size(); i++) - mList[i].mIndex = i; + mList[i].mIndex = static_cast(i); } void EffectList::add(ESMReader& esm) diff --git a/components/lua/l10n.cpp b/components/lua/l10n.cpp index 542c81009a..15177bea65 100644 --- a/components/lua/l10n.cpp +++ b/components/lua/l10n.cpp @@ -32,7 +32,8 @@ namespace // Argument names const auto str = LuaUtil::cast(key); - argNames.push_back(icu::UnicodeString::fromUTF8(icu::StringPiece(str.data(), str.size()))); + argNames.push_back( + icu::UnicodeString::fromUTF8(icu::StringPiece(str.data(), static_cast(str.size())))); } } }