From 4f7b624fe818b2929e27a95b1bd89eb8eb44658a Mon Sep 17 00:00:00 2001 From: Chris Russ Date: Mon, 18 Jul 2016 08:23:46 +1000 Subject: [PATCH] fix precision issue within memory copy --- code/Exporter.cpp | 2 +- code/SceneCombiner.cpp | 6 +++--- include/assimp/scene.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/Exporter.cpp b/code/Exporter.cpp index 0707a4f56..e510b7642 100644 --- a/code/Exporter.cpp +++ b/code/Exporter.cpp @@ -321,7 +321,7 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const // Always create a full copy of the scene. We might optimize this one day, // but for now it is the most pragmatic way. - aiScene* scenecopy_tmp; + aiScene* scenecopy_tmp = NULL; SceneCombiner::CopyScene(&scenecopy_tmp,pScene); std::unique_ptr scenecopy(scenecopy_tmp); diff --git a/code/SceneCombiner.cpp b/code/SceneCombiner.cpp index 51541a34b..68c595b26 100644 --- a/code/SceneCombiner.cpp +++ b/code/SceneCombiner.cpp @@ -942,7 +942,7 @@ void SceneCombiner::MergeMaterials(aiMaterial** dest, // ------------------------------------------------------------------------------------------------ template -inline void CopyPtrArray (Type**& dest, const Type* const * src, unsigned int num) +inline void CopyPtrArray (Type**& dest, const Type* const * src, ai_uint num) { if (!num) { @@ -950,14 +950,14 @@ inline void CopyPtrArray (Type**& dest, const Type* const * src, unsigned int nu return; } dest = new Type*[num]; - for (unsigned int i = 0; i < num;++i) { + for (ai_uint i = 0; i < num;++i) { SceneCombiner::Copy(&dest[i],src[i]); } } // ------------------------------------------------------------------------------------------------ template -inline void GetArrayCopy (Type*& dest, unsigned int num ) +inline void GetArrayCopy (Type*& dest, ai_uint num ) { if (!dest)return; Type* old = dest; diff --git a/include/assimp/scene.h b/include/assimp/scene.h index b3c56c7f1..31bb8b6a1 100644 --- a/include/assimp/scene.h +++ b/include/assimp/scene.h @@ -111,7 +111,7 @@ struct aiNode /** The number of meshes of this node. */ unsigned int mNumMeshes; - /** The meshes of this node. Each entry is an index into the + /** The meshes of this node. Each entry is an index into the * mesh list of the #aiScene. */ unsigned int* mMeshes;