Bugfix : Fixed some compiler warnings and some C99 and C++11 specific syntax. ( merged from GitHub, thanks to Riku Palomäki ).

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1225 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/5/head
kimmi 2012-03-20 21:31:56 +00:00
parent 694cf75070
commit 6c1cb4f159
7 changed files with 13 additions and 12 deletions

View File

@ -63,11 +63,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# endif # endif
#endif #endif
namespace Assimp {
template<> const std::string LogFunctions<BlenderImporter>::log_prefix = "BLEND: ";
}
using namespace Assimp; using namespace Assimp;
using namespace Assimp::Blender; using namespace Assimp::Blender;
using namespace Assimp::Formatter; using namespace Assimp::Formatter;
template<> const std::string LogFunctions<BlenderImporter>::log_prefix = "BLEND: ";
static const aiLoaderDesc blenderDesc = { static const aiLoaderDesc blenderDesc = {
"Blender 3D Importer \nhttp://www.blender3d.org", "Blender 3D Importer \nhttp://www.blender3d.org",
"Assimp Team", "Assimp Team",

View File

@ -95,7 +95,7 @@ enum aiLoaderFlags
aiLoaderFlags_Experimental = 0x10, aiLoaderFlags_Experimental = 0x10,
aiLoaderFlags_Testing = 0x20, aiLoaderFlags_Testing = 0x20,
aiLoaderFlags_Production = 0x40, aiLoaderFlags_Production = 0x40
}; };
struct aiLoaderDesc struct aiLoaderDesc

View File

@ -554,7 +554,7 @@ IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh) {
// The input polygon is arbitrarily shaped, so we might need some tries // 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 // 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 ... ). // 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 (i = base; i < s-1; ++i) {
for (j = i+1; j < s; ++j) { for (j = i+1; j < s; ++j) {
nor = -((out[i]-any_point)^(out[j]-any_point)); nor = -((out[i]-any_point)^(out[j]-any_point));

View File

@ -57,14 +57,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "StreamReader.h" #include "StreamReader.h"
#include "MemoryIOWrapper.h" #include "MemoryIOWrapper.h"
namespace Assimp {
template<> const std::string LogFunctions<IFCImporter>::log_prefix = "IFC: ";
}
using namespace Assimp; using namespace Assimp;
using namespace Assimp::Formatter; using namespace Assimp::Formatter;
using namespace Assimp::IFC; using namespace Assimp::IFC;
template<> const std::string LogFunctions<IFCImporter>::log_prefix = "IFC: ";
/* DO NOT REMOVE this comment block. The genentitylist.sh script /* DO NOT REMOVE this comment block. The genentitylist.sh script
* just looks for names adhering to the IfcSomething naming scheme * just looks for names adhering to the IfcSomething naming scheme
* and includes all matches in the whitelist for code-generation. Thus, * and includes all matches in the whitelist for code-generation. Thus,

View File

@ -63,7 +63,7 @@ void TempOpening::Transform(const IfcMatrix4& mat)
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
aiMesh* TempMesh::ToMesh() 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()) { if (verts.empty()) {
return NULL; return NULL;

View File

@ -119,7 +119,6 @@ void M3Importer::InternReadFile( const std::string& pFile, aiScene* pScene, IOSy
uint16* faces( NULL ); uint16* faces( NULL );
uint32 nVertices = 0; uint32 nVertices = 0;
uint32 nFaces = 0;
bool ok = true; bool ok = true;
switch( m_pRefs[ m_pHead->MODL.ref ].type ) { 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 // Get the face data
faces = GetEntries<uint16>( pViews->faces ); faces = GetEntries<uint16>( pViews->faces );
nFaces = pViews->faces.nEntries;
// Convert the vertices // Convert the vertices
std::vector<aiVector3D> vertices; std::vector<aiVector3D> vertices;
@ -319,8 +317,6 @@ void M3Importer::createVertexData( aiMesh *pMesh, const std::vector<aiVector3D>
const std::vector<aiVector3D> &uvCoords, const std::vector<aiVector3D> &uvCoords,
const std::vector<aiVector3D> &normals ) const std::vector<aiVector3D> &normals )
{ {
unsigned int numIndices = 0;
pMesh->mNumVertices = pMesh->mNumFaces * 3; pMesh->mNumVertices = pMesh->mNumFaces * 3;
pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ]; pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ];
pMesh->mNumUVComponents[ 0 ] = 2; pMesh->mNumUVComponents[ 0 ] = 2;

View File

@ -104,7 +104,9 @@ inline bool IsCCW(T* in, size_t npoints) {
double convex_turn; double convex_turn;
double convex_sum = 0; 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)) + 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)); ((-in[i+2].y + in[i].y) * (-in[i+2].y + in[i].y));