From 2ac9b0ce45dc581ebbae92863006d4033ab2879e Mon Sep 17 00:00:00 2001 From: Jared Mulconry Date: Sat, 19 Nov 2016 23:50:03 +1100 Subject: [PATCH] Fixed build warnings on MSVC14 x64 in the FBX format sources. --- code/FBXConverter.cpp | 8 ++++---- code/FBXDocument.h | 2 +- code/FBXImporter.cpp | 2 +- code/FBXParser.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 365d7fe..26e5efc 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -1076,7 +1076,7 @@ void Converter::SetupNodeMetadata( const Model& model, aiNode& nd ) // create metadata on node std::size_t numStaticMetaData = 2; aiMetadata* data = new aiMetadata(); - data->mNumProperties = unparsedProperties.size() + numStaticMetaData; + data->mNumProperties = static_cast(unparsedProperties.size() + numStaticMetaData); data->mKeys = new aiString[ data->mNumProperties ](); data->mValues = new aiMetadataEntry[ data->mNumProperties ](); nd.mMetaData = data; @@ -2964,10 +2964,10 @@ Converter::KeyFrameListList Converter::GetKeyframeList( const std::vector Keys( new KeyTimeList() ); std::shared_ptr Values( new KeyValueList() ); - const int count = curve->GetKeys().size(); + const size_t count = curve->GetKeys().size(); Keys->reserve( count ); Values->reserve( count ); - for ( int n = 0; n < count; n++ ) + for (size_t n = 0; n < count; n++ ) { int64_t k = curve->GetKeys().at( n ); if ( k >= adj_start && k <= adj_stop ) @@ -3068,7 +3068,7 @@ void Converter::InterpolateKeys( aiVectorKey* valOut, const KeyTimeList& keys, c const KeyTimeList::value_type timeA = std::get<0>(kfl)->at( id0 ); const KeyTimeList::value_type timeB = std::get<0>(kfl)->at( id1 ); - const ai_real factor = timeB == timeA ? 0. : static_cast( ( time - timeA ) ) / ( timeB - timeA ); + const ai_real factor = timeB == timeA ? ai_real(0.) : static_cast( ( time - timeA ) ) / ( timeB - timeA ); const ai_real interpValue = static_cast( valueA + ( valueB - valueA ) * factor ); result[ std::get<2>(kfl) ] = interpValue; diff --git a/code/FBXDocument.h b/code/FBXDocument.h index 6016805..be67e32 100644 --- a/code/FBXDocument.h +++ b/code/FBXDocument.h @@ -600,7 +600,7 @@ public: } const int textureCount() const { - return textures.size(); + return static_cast(textures.size()); } const BlendMode GetBlendMode() const { diff --git a/code/FBXImporter.cpp b/code/FBXImporter.cpp index b319da8..7cf5dfa 100644 --- a/code/FBXImporter.cpp +++ b/code/FBXImporter.cpp @@ -165,7 +165,7 @@ void FBXImporter::InternReadFile( const std::string& pFile, bool is_binary = false; if (!strncmp(begin,"Kaydara FBX Binary",18)) { is_binary = true; - TokenizeBinary(tokens,begin,contents.size()); + TokenizeBinary(tokens,begin,static_cast(contents.size())); } else { Tokenize(tokens,begin); diff --git a/code/FBXParser.cpp b/code/FBXParser.cpp index beca20b..8e9d40b 100644 --- a/code/FBXParser.cpp +++ b/code/FBXParser.cpp @@ -583,7 +583,7 @@ void ReadBinaryDataArray(char type, uint32_t count, const char*& data, const cha zstream.next_in = reinterpret_cast( const_cast(data) ); zstream.avail_in = comp_len; - zstream.avail_out = buff.size(); + zstream.avail_out = static_cast(buff.size()); zstream.next_out = reinterpret_cast(&*buff.begin()); const int ret = inflate(&zstream, Z_FINISH); -- 2.7.4