From f612865f2274e5d7e5174a3ed4a40655a55c0458 Mon Sep 17 00:00:00 2001 From: Gargaj Date: Sun, 29 May 2022 01:35:48 +0200 Subject: [PATCH 1/2] fix msvc warnings-as-errors --- code/AssetLib/FBX/FBXConverter.cpp | 2 +- code/Common/FileSystemFilter.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index 4de142075..b19a58df8 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -2151,7 +2151,7 @@ void FBXConverter::SetShadingPropertiesCommon(aiMaterial *out_mat, const Propert if (ok) { out_mat->AddProperty(&ShininessExponent, 1, AI_MATKEY_SHININESS); // Match Blender behavior to extract roughness when only shininess is present - const float roughness = 1.0 - (sqrt(ShininessExponent) / 10.0); + const float roughness = 1.0f - (sqrt(ShininessExponent) / 10.0f); out_mat->AddProperty(&roughness, 1, AI_MATKEY_ROUGHNESS_FACTOR); } diff --git a/code/Common/FileSystemFilter.h b/code/Common/FileSystemFilter.h index 81576aa6c..ffd407577 100644 --- a/code/Common/FileSystemFilter.h +++ b/code/Common/FileSystemFilter.h @@ -300,7 +300,7 @@ private: const char separator = getOsSeparator(); for (it = in.begin(); it != in.end(); ++it) { - int remaining = std::distance(in.end(), it); + int remaining = (int)std::distance(in.end(), it); // Exclude :// and \\, which remain untouched. // https://sourceforge.net/tracker/?func=detail&aid=3031725&group_id=226462&atid=1067632 if (remaining >= 3 && !strncmp(&*it, "://", 3 )) { From 234e55fbb196a021050c6e12b946eb80c1ad9d14 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 31 May 2022 07:29:54 +0200 Subject: [PATCH 2/2] Use size_t --- code/Common/FileSystemFilter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/Common/FileSystemFilter.h b/code/Common/FileSystemFilter.h index ffd407577..9ab3812e2 100644 --- a/code/Common/FileSystemFilter.h +++ b/code/Common/FileSystemFilter.h @@ -300,10 +300,10 @@ private: const char separator = getOsSeparator(); for (it = in.begin(); it != in.end(); ++it) { - int remaining = (int)std::distance(in.end(), it); + const size_t remaining = std::distance(in.end(), it); // Exclude :// and \\, which remain untouched. // https://sourceforge.net/tracker/?func=detail&aid=3031725&group_id=226462&atid=1067632 - if (remaining >= 3 && !strncmp(&*it, "://", 3 )) { + if (remaining >= 3u && !strncmp(&*it, "://", 3 )) { it += 3; continue; }