Просмотр исходного кода

- consistent use of ai_assert instead of assert.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1241 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 13 лет назад
Родитель
Сommit
ec6c62e005

+ 3 - 3
code/ColladaParser.cpp

@@ -2115,7 +2115,7 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pPer
 		for( size_t b = 0; b < numPoints; b++)
 		{
 			// read all indices for this vertex. Yes, in a hacky local array
-			assert( numOffsets < 20 && perVertexOffset < 20);
+			ai_assert( numOffsets < 20 && perVertexOffset < 20);
 			size_t vindex[20];
 			for( size_t offsets = 0; offsets < numOffsets; ++offsets)
 				vindex[offsets] = *idx++;
@@ -2313,7 +2313,7 @@ void ColladaParser::ReadSceneNode( Node* pNode)
 					child->mName = mReader->getAttributeValue( attrName);
 
 				// TODO: (thom) support SIDs
-				// assert( TestAttribute( "sid") == -1);
+				// ai_assert( TestAttribute( "sid") == -1);
 
 				if (pNode) 
 				{
@@ -2781,7 +2781,7 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform
 				break;
 			}
 			default: 
-				assert( false);
+				ai_assert( false);
 				break;
 		}
 	}

+ 1 - 1
code/XFileImporter.cpp

@@ -355,7 +355,7 @@ void XFileImporter::CreateMeshes( aiScene* pScene, aiNode* pNode, const std::vec
 			}
 
 			// there should be as much new vertices as we calculated before
-			assert( newIndex == numVertices);
+			ai_assert( newIndex == numVertices);
 
 			// convert all bones of the source mesh which influence vertices in this newly created mesh
 			const std::vector<XFile::Bone>& bones = sourceMesh->mBones;

+ 2 - 2
code/XFileParser.cpp

@@ -1240,7 +1240,7 @@ void XFileParser::ReadUntilEndOfLine()
 // ------------------------------------------------------------------------------------------------
 unsigned short XFileParser::ReadBinWord()
 {
-	assert(End - P >= 2);
+	ai_assert(End - P >= 2);
 	const unsigned char* q = (const unsigned char*) P;
 	unsigned short tmp = q[0] | (q[1] << 8);
 	P += 2;
@@ -1250,7 +1250,7 @@ unsigned short XFileParser::ReadBinWord()
 // ------------------------------------------------------------------------------------------------
 unsigned int XFileParser::ReadBinDWord()
 {
-	assert(End - P >= 4);
+	ai_assert(End - P >= 4);
 	const unsigned char* q = (const unsigned char*) P;
 	unsigned int tmp = q[0] | (q[1] << 8) | (q[2] << 16) | (q[3] << 24);
 	P += 4;

+ 0 - 1
include/assimp/Importer.hpp

@@ -52,7 +52,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // Public ASSIMP data structures
 #include "types.h"
 #include "config.h"
-#include "assert.h"
 
 namespace Assimp	{
 	// =======================================================================

+ 6 - 6
tools/assimp_cmd/CompareDump.cpp

@@ -113,8 +113,8 @@ public:
 		, expect(expect)
 		, cnt_chunks(0)
 	{
-		assert(actual);
-		assert(expect);
+		ai_assert(actual);
+		ai_assert(expect);
 
 		fseek(actual,0,SEEK_END);
 		lengths.push(std::make_pair(static_cast<uint32_t>(ftell(actual)),0));
@@ -142,7 +142,7 @@ public:
 
 	/* leave current scope */
 	void pop_elem() {
-		assert(history.size());
+		ai_assert(history.size());
 		history.pop_back();
 	}
 
@@ -155,19 +155,19 @@ public:
 
 	/* pop the chunk length stack */
 	void pop_length() {
-		assert(lengths.size());
+		ai_assert(lengths.size());
 		lengths.pop();
 	}
 
 	/* access the current chunk length */
 	uint32_t get_latest_chunk_length() {
-		assert(lengths.size());
+		ai_assert(lengths.size());
 		return lengths.top().first;
 	}
 
 	/* access the current chunk start offset */
 	uint32_t get_latest_chunk_start() {
-		assert(lengths.size());
+		ai_assert(lengths.size());
 		return lengths.top().second;
 	}
 

+ 1 - 1
tools/assimp_cmd/WriteDumb.cpp

@@ -689,7 +689,7 @@ void WriteBinaryDump(const aiScene* scene, FILE* _out, const char* src, const ch
 	// == 435 bytes
 
 	// ==== total header size: 512 bytes
-	assert(ftell(out)==ASSBIN_HEADER_LENGTH);
+	ai_assert(ftell(out)==ASSBIN_HEADER_LENGTH);
 
 	// Up to here the data is uncompressed. For compressed files, the rest
 	// is compressed using standard DEFLATE from zlib.

+ 2 - 2
tools/assimp_view/MessageProc.cpp

@@ -91,7 +91,7 @@ void MakeFileAssociations()
 	do
 	{
 		char buf[256];
-		assert(sz[0] == '*');
+		ai_assert(sz[0] == '*');
 		sprintf(buf,"Software\\Classes\\%s",sz+1);
 
 		RegCreateKeyEx(HKEY_CURRENT_USER,buf,NULL,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL);
@@ -1035,7 +1035,7 @@ void DoExport(size_t formatId)
 
 	Exporter exp;
 	const aiExportFormatDesc* const e = exp.GetExportFormatDescription(formatId);
-	assert(e);
+	ai_assert(e);
 
 	char szFileName[MAX_PATH*2];
 	DWORD dwTemp;

+ 1 - 1
tools/assimp_view/assimp_view.cpp

@@ -505,7 +505,7 @@ int CreateAssetData()
 				nidx = 2;break;
 			case aiPrimitiveType_TRIANGLE:
 				nidx = 3;break;
-			default: assert(false);
+			default: ai_assert(false);
 		};
 
 		// check whether we can use 16 bit indices