fix Inter-Quake Model (IQM) Importer MSVC warnings

pull/4265/head
Garux 2021-12-24 18:27:52 +03:00
parent 46f618a6ef
commit d11d2fc60d
1 changed files with 5 additions and 4 deletions

View File

@ -61,6 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
inline void swap_block( uint32_t *block, size_t size ){ inline void swap_block( uint32_t *block, size_t size ){
(void)block; // suppress 'unreferenced formal parameter' MSVC warning
size >>= 2; size >>= 2;
for ( size_t i = 0; i < size; ++i ) for ( size_t i = 0; i < size; ++i )
AI_SWAP4( block[ i ] ); AI_SWAP4( block[ i ] );
@ -182,7 +183,7 @@ void IQMImporter::InternReadFile(const std::string &file, aiScene *pScene, IOSys
} }
// Read all surfaces from the file // Read all surfaces from the file
for( auto imesh = reinterpret_cast<iqmmesh*>( data + hdr.ofs_meshes ), end = imesh + hdr.num_meshes; imesh != end; ++imesh ) for( auto imesh = reinterpret_cast<iqmmesh*>( data + hdr.ofs_meshes ), end_ = imesh + hdr.num_meshes; imesh != end_; ++imesh )
{ {
swap_block( &imesh->name, sizeof( iqmmesh ) ); swap_block( &imesh->name, sizeof( iqmmesh ) );
// Allocate output mesh & material // Allocate output mesh & material
@ -214,10 +215,10 @@ void IQMImporter::InternReadFile(const std::string &file, aiScene *pScene, IOSys
} }
// Fill in all vertices // Fill in all vertices
for( auto array = reinterpret_cast<const iqmvertexarray*>( data + hdr.ofs_vertexarrays ), end = array + hdr.num_vertexarrays; array != end; ++array ) for( auto array = reinterpret_cast<const iqmvertexarray*>( data + hdr.ofs_vertexarrays ), end__ = array + hdr.num_vertexarrays; array != end__; ++array )
{ {
const size_t nVerts = imesh->num_vertexes; const unsigned int nVerts = imesh->num_vertexes;
const size_t step = array->size; const unsigned int step = array->size;
switch ( array->type ) switch ( array->type )
{ {