- 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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user