diff --git a/code/BlenderLoader.cpp b/code/BlenderLoader.cpp index 002259fb3..c1827dcc2 100644 --- a/code/BlenderLoader.cpp +++ b/code/BlenderLoader.cpp @@ -63,11 +63,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # endif #endif +namespace Assimp { + template<> const std::string LogFunctions::log_prefix = "BLEND: "; +} + using namespace Assimp; using namespace Assimp::Blender; using namespace Assimp::Formatter; -template<> const std::string LogFunctions::log_prefix = "BLEND: "; static const aiLoaderDesc blenderDesc = { "Blender 3D Importer \nhttp://www.blender3d.org", "Assimp Team", diff --git a/code/BlenderLoader.h b/code/BlenderLoader.h index fcd8cbabd..6a3b17127 100644 --- a/code/BlenderLoader.h +++ b/code/BlenderLoader.h @@ -95,7 +95,7 @@ enum aiLoaderFlags aiLoaderFlags_Experimental = 0x10, aiLoaderFlags_Testing = 0x20, - aiLoaderFlags_Production = 0x40, + aiLoaderFlags_Production = 0x40 }; struct aiLoaderDesc diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 0a96027b6..9f8610ecc 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -554,7 +554,7 @@ IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh) { // The input polygon is arbitrarily shaped, so we might need some tries // until we find a suitable normal (and it does not even need to be // right in all cases, Newell's algorithm would be the correct one ... ). - size_t base = s-curmesh.vertcnt.back(), t = base, i, j; + size_t base = s-curmesh.vertcnt.back(), i, j; for (i = base; i < s-1; ++i) { for (j = i+1; j < s; ++j) { nor = -((out[i]-any_point)^(out[j]-any_point)); diff --git a/code/IFCLoader.cpp b/code/IFCLoader.cpp index 836c852d8..f2a361dea 100644 --- a/code/IFCLoader.cpp +++ b/code/IFCLoader.cpp @@ -57,14 +57,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StreamReader.h" #include "MemoryIOWrapper.h" +namespace Assimp { + template<> const std::string LogFunctions::log_prefix = "IFC: "; +} using namespace Assimp; using namespace Assimp::Formatter; using namespace Assimp::IFC; -template<> const std::string LogFunctions::log_prefix = "IFC: "; - - /* DO NOT REMOVE this comment block. The genentitylist.sh script * just looks for names adhering to the IfcSomething naming scheme * and includes all matches in the whitelist for code-generation. Thus, diff --git a/code/IFCUtil.cpp b/code/IFCUtil.cpp index cb566ed2b..1f1633462 100644 --- a/code/IFCUtil.cpp +++ b/code/IFCUtil.cpp @@ -63,7 +63,7 @@ void TempOpening::Transform(const IfcMatrix4& mat) // ------------------------------------------------------------------------------------------------ aiMesh* TempMesh::ToMesh() { - ai_assert(verts.size() == std::accumulate(vertcnt.begin(),vertcnt.end(),0)); + ai_assert(verts.size() == std::accumulate(vertcnt.begin(),vertcnt.end(),size_t(0))); if (verts.empty()) { return NULL; diff --git a/code/M3Importer.cpp b/code/M3Importer.cpp index e02248250..1f4954e04 100644 --- a/code/M3Importer.cpp +++ b/code/M3Importer.cpp @@ -119,7 +119,6 @@ void M3Importer::InternReadFile( const std::string& pFile, aiScene* pScene, IOSy uint16* faces( NULL ); uint32 nVertices = 0; - uint32 nFaces = 0; bool ok = true; switch( m_pRefs[ m_pHead->MODL.ref ].type ) { @@ -168,7 +167,6 @@ void M3Importer::InternReadFile( const std::string& pFile, aiScene* pScene, IOSy // Get the face data faces = GetEntries( pViews->faces ); - nFaces = pViews->faces.nEntries; // Convert the vertices std::vector vertices; @@ -319,8 +317,6 @@ void M3Importer::createVertexData( aiMesh *pMesh, const std::vector const std::vector &uvCoords, const std::vector &normals ) { - unsigned int numIndices = 0; - pMesh->mNumVertices = pMesh->mNumFaces * 3; pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ]; pMesh->mNumUVComponents[ 0 ] = 2; diff --git a/code/PolyTools.h b/code/PolyTools.h index 847c7e448..3a2089a56 100644 --- a/code/PolyTools.h +++ b/code/PolyTools.h @@ -104,7 +104,9 @@ inline bool IsCCW(T* in, size_t npoints) { double convex_turn; double convex_sum = 0; - for (int i = 0; i < npoints - 2; i++) { + ai_assert(npoints >= 3); + + for (size_t i = 0; i < npoints - 2; i++) { aa = ((in[i+2].x - in[i].x) * (in[i+2].x - in[i].x)) + ((-in[i+2].y + in[i].y) * (-in[i+2].y + in[i].y));