fix compiler warnings.

pull/1352/head
Kim Kulling 2017-07-16 01:02:33 +02:00
parent c9d18ebe1f
commit 3346fb517f
2 changed files with 64 additions and 59 deletions

View File

@ -371,6 +371,11 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
case AI_AIVECTOR3D: case AI_AIVECTOR3D:
Write<aiVector3D>(&chunk, *((aiVector3D*) value)); Write<aiVector3D>(&chunk, *((aiVector3D*) value));
break; break;
#ifdef SWIG
case FORCE_32BIT:
#endif // SWIG
default:
break;
} }
} }
} }

View File

@ -198,8 +198,7 @@ template <typename T> void ReadBounds( IOStream * stream, T* /*p*/, unsigned int
stream->Seek( sizeof(T) * n, aiOrigin_CUR ); stream->Seek( sizeof(T) * n, aiOrigin_CUR );
} }
void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node, aiNode* parent ) void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node, aiNode* parent ) {
{
uint32_t chunkID = Read<uint32_t>(stream); uint32_t chunkID = Read<uint32_t>(stream);
ai_assert(chunkID == ASSBIN_CHUNK_AINODE); ai_assert(chunkID == ASSBIN_CHUNK_AINODE);
/*uint32_t size =*/ Read<uint32_t>(stream); /*uint32_t size =*/ Read<uint32_t>(stream);
@ -212,34 +211,30 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node, aiNode* p
(*node)->mNumMeshes = Read<unsigned int>(stream); (*node)->mNumMeshes = Read<unsigned int>(stream);
unsigned int nb_metadata = Read<unsigned int>(stream); unsigned int nb_metadata = Read<unsigned int>(stream);
if(parent) if(parent) {
{
(*node)->mParent = parent; (*node)->mParent = parent;
} }
if ((*node)->mNumMeshes) if ((*node)->mNumMeshes) {
{
(*node)->mMeshes = new unsigned int[(*node)->mNumMeshes]; (*node)->mMeshes = new unsigned int[(*node)->mNumMeshes];
for (unsigned int i = 0; i < (*node)->mNumMeshes; ++i) { for (unsigned int i = 0; i < (*node)->mNumMeshes; ++i) {
(*node)->mMeshes[i] = Read<unsigned int>(stream); (*node)->mMeshes[i] = Read<unsigned int>(stream);
} }
} }
if ((*node)->mNumChildren) if ((*node)->mNumChildren) {
{
(*node)->mChildren = new aiNode*[(*node)->mNumChildren]; (*node)->mChildren = new aiNode*[(*node)->mNumChildren];
for (unsigned int i = 0; i < (*node)->mNumChildren; ++i) { for (unsigned int i = 0; i < (*node)->mNumChildren; ++i) {
ReadBinaryNode( stream, &(*node)->mChildren[i], *node ); ReadBinaryNode( stream, &(*node)->mChildren[i], *node );
} }
} }
if (nb_metadata) if ( nb_metadata > 0 ) {
{
(*node)->mMetaData = aiMetadata::Alloc(nb_metadata); (*node)->mMetaData = aiMetadata::Alloc(nb_metadata);
for (unsigned int i = 0; i < nb_metadata; ++i) { for (unsigned int i = 0; i < nb_metadata; ++i) {
(*node)->mMetaData->mKeys[i] = Read<aiString>(stream); (*node)->mMetaData->mKeys[i] = Read<aiString>(stream);
(*node)->mMetaData->mValues[i].mType = (aiMetadataType) Read<uint16_t>(stream); (*node)->mMetaData->mValues[i].mType = (aiMetadataType) Read<uint16_t>(stream);
void* data = NULL; void* data( nullptr );
switch ((*node)->mMetaData->mValues[i].mType) { switch ((*node)->mMetaData->mValues[i].mType) {
case AI_BOOL: case AI_BOOL:
@ -263,6 +258,11 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node, aiNode* p
case AI_AIVECTOR3D: case AI_AIVECTOR3D:
data = new aiVector3D(Read<aiVector3D>(stream)); data = new aiVector3D(Read<aiVector3D>(stream));
break; break;
#ifndef SWIG
case FORCE_32BIT:
#endif // SWIG
default:
break;
} }
(*node)->mMetaData->mValues[i].mData = data; (*node)->mMetaData->mValues[i].mData = data;