diff --git a/code/D3MFImporter.cpp b/code/D3MFImporter.cpp index 0a3a140f3..e02c5f41d 100644 --- a/code/D3MFImporter.cpp +++ b/code/D3MFImporter.cpp @@ -115,10 +115,10 @@ public: // import the metadata if ( !mMetaData.empty() ) { const size_t numMeta( mMetaData.size() ); - scene->mMetaData = aiMetadata::Alloc( numMeta ); + scene->mMetaData = aiMetadata::Alloc(static_cast( numMeta ) ); for ( size_t i = 0; i < numMeta; ++i ) { aiString val( mMetaData[ i ].value ); - scene->mMetaData->Set( i, mMetaData[ i ].name, val ); + scene->mMetaData->Set(static_cast( i ), mMetaData[ i ].name, val ); } } diff --git a/code/DefaultIOSystem.cpp b/code/DefaultIOSystem.cpp index fee9c3e7f..afa95d364 100644 --- a/code/DefaultIOSystem.cpp +++ b/code/DefaultIOSystem.cpp @@ -76,7 +76,7 @@ bool DefaultIOSystem::Exists( const char* pFile) const #ifdef _WIN32 wchar_t fileName16[PATHLIMIT]; - bool isUnicode = IsTextUnicode(pFile, static_cast(strlen(pFile)), NULL); + bool isUnicode = IsTextUnicode(pFile, static_cast(strlen(pFile)), NULL) != 0; if (isUnicode) { MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, pFile, -1, fileName16, PATHLIMIT); @@ -110,7 +110,7 @@ IOStream* DefaultIOSystem::Open( const char* strFile, const char* strMode) FILE* file; #ifdef _WIN32 wchar_t fileName16[PATHLIMIT]; - bool isUnicode = IsTextUnicode(strFile, static_cast(strlen(strFile)), NULL ); + bool isUnicode = IsTextUnicode(strFile, static_cast(strlen(strFile)), NULL) != 0; if (isUnicode) { MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, strFile, -1, fileName16, PATHLIMIT); std::string mode8(strMode); @@ -158,7 +158,7 @@ inline static void MakeAbsolutePath (const char* in, char* _out) { ai_assert(in && _out); #if defined( _MSC_VER ) || defined( __MINGW32__ ) - bool isUnicode = IsTextUnicode(in, static_cast(strlen(in)), NULL); + bool isUnicode = IsTextUnicode(in, static_cast(strlen(in)), NULL) != 0; if (isUnicode) { wchar_t out16[PATHLIMIT]; wchar_t in16[PATHLIMIT]; diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index bd33848d9..5376788b2 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -638,11 +638,11 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref& meshRef, Refprimitives.back(); Ref vertexJointAccessor = ExportData(mAsset, skinRef->id, bufferRef, aimesh->mNumVertices, vertexJointData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT); if ( vertexJointAccessor ) { - unsigned int offset = vertexJointAccessor->bufferView->byteOffset; - unsigned int bytesLen = vertexJointAccessor->bufferView->byteLength; + size_t offset = vertexJointAccessor->bufferView->byteOffset; + size_t bytesLen = vertexJointAccessor->bufferView->byteLength; unsigned int s_bytesPerComp= ComponentTypeSize(ComponentType_UNSIGNED_SHORT); unsigned int bytesPerComp = ComponentTypeSize(vertexJointAccessor->componentType); - unsigned int s_bytesLen = bytesLen * s_bytesPerComp / bytesPerComp; + size_t s_bytesLen = bytesLen * s_bytesPerComp / bytesPerComp; Ref buf = vertexJointAccessor->bufferView->buffer; uint8_t* arrys = new uint8_t[s_bytesLen]; unsigned int i = 0; diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 70a604de9..8ac8e250a 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -149,7 +149,8 @@ struct aiMetadata { mValues[ i ].mType = rhs.mValues[ i ].mType; switch ( rhs.mValues[ i ].mType ) { case AI_BOOL: - mValues[ i ].mData = new bool( rhs.mValues[i].mData ); + mValues[ i ].mData = new bool; + ::memcpy( mValues[ i ].mData, rhs.mValues[ i ].mData, sizeof(bool) ); break; case AI_INT32: { int32_t v;