- 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
pull/5/head
aramis_acg 2012-04-22 23:22:40 +00:00
parent adfef670cc
commit ec6c62e005
8 changed files with 16 additions and 17 deletions

View File

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

View File

@ -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 // 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 // convert all bones of the source mesh which influence vertices in this newly created mesh
const std::vector<XFile::Bone>& bones = sourceMesh->mBones; const std::vector<XFile::Bone>& bones = sourceMesh->mBones;

View File

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

View File

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

View File

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

View File

@ -689,7 +689,7 @@ void WriteBinaryDump(const aiScene* scene, FILE* _out, const char* src, const ch
// == 435 bytes // == 435 bytes
// ==== total header size: 512 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 // Up to here the data is uncompressed. For compressed files, the rest
// is compressed using standard DEFLATE from zlib. // is compressed using standard DEFLATE from zlib.

View File

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

View File

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