- refraing from using magic numbers like 0xffffffff all over the repository, rather use UINT_MAX/SIZE_MAX ..

- minor re-formatting and refactoring at some old code spots.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@970 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2011-04-22 21:29:18 +00:00
parent 14c6467aac
commit 6f30639d7f
40 changed files with 194 additions and 190 deletions

View File

@@ -71,8 +71,8 @@ aiReturn aiGetMaterialProperty(const aiMaterial* pMat,
if (prop /* just for safety ... */
&& 0 == strcmp( prop->mKey.data, pKey )
&& (0xffffffff == type || prop->mSemantic == type) /* 0xffffffff is a wildcard, but this is undocumented :-) */
&& (0xffffffff == index || prop->mIndex == index))
&& (UINT_MAX == type || prop->mSemantic == type) /* UINT_MAX is a wildcard, but this is undocumented :-) */
&& (UINT_MAX == index || prop->mIndex == index))
{
*pPropOut = pMat->mProperties[i];
return AI_SUCCESS;
@@ -469,7 +469,7 @@ aiReturn MaterialHelper::AddBinaryProperty (const void* pInput,
ai_assert (0 != pSizeInBytes);
// first search the list whether there is already an entry with this key
unsigned int iOutIndex = 0xffffffff;
unsigned int iOutIndex = UINT_MAX;
for (unsigned int i = 0; i < mNumProperties;++i) {
aiMaterialProperty* prop = mProperties[i];
@@ -497,7 +497,7 @@ aiReturn MaterialHelper::AddBinaryProperty (const void* pInput,
ai_assert ( MAXLEN > pcNew->mKey.length);
strcpy( pcNew->mKey.data, pKey );
if (0xffffffff != iOutIndex) {
if (UINT_MAX != iOutIndex) {
mProperties[iOutIndex] = pcNew;
return AI_SUCCESS;
}