Commit 4b22e8ed authored by Wayne Stambaugh's avatar Wayne Stambaugh

Fix wxLogTrace string argument format specifiers for size_t types in vrml_v2_parser.cpp

parent 9c0c8925
...@@ -69,16 +69,19 @@ VRML2_MODEL_PARSER::~VRML2_MODEL_PARSER() ...@@ -69,16 +69,19 @@ VRML2_MODEL_PARSER::~VRML2_MODEL_PARSER()
{ {
} }
void VRML2_MODEL_PARSER::debug_enter() void VRML2_MODEL_PARSER::debug_enter()
{ {
m_debugSpacer.Append(' '); m_debugSpacer.Append(' ');
} }
void VRML2_MODEL_PARSER::debug_exit() void VRML2_MODEL_PARSER::debug_exit()
{ {
m_debugSpacer.RemoveLast(); m_debugSpacer.RemoveLast();
} }
bool VRML2_MODEL_PARSER::Load( const wxString& aFilename ) bool VRML2_MODEL_PARSER::Load( const wxString& aFilename )
{ {
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Loading: %s" ), GetChars( aFilename ) ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Loading: %s" ), GetChars( aFilename ) );
...@@ -89,7 +92,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename ) ...@@ -89,7 +92,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename )
if( m_file == NULL ) if( m_file == NULL )
{ {
debug_exit(); debug_exit();
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Failed to open file: %s" ), GetChars( aFilename ) ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Failed to open file: %s" ),
GetChars( aFilename ) );
return false; return false;
} }
...@@ -111,7 +115,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename, S3D_MESH_PTR aTransfor ...@@ -111,7 +115,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename, S3D_MESH_PTR aTransfor
{ {
if( aTransformationModel ) if( aTransformationModel )
{ {
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Loading: %s" ), GetChars( aFilename ) ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Loading: %s" ),
GetChars( aFilename ) );
debug_enter(); debug_enter();
m_file = wxFopen( aFilename, wxT( "rt" ) ); m_file = wxFopen( aFilename, wxT( "rt" ) );
...@@ -119,7 +124,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename, S3D_MESH_PTR aTransfor ...@@ -119,7 +124,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename, S3D_MESH_PTR aTransfor
if( m_file == NULL ) if( m_file == NULL )
{ {
debug_exit(); debug_exit();
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Failed to open file: %s" ), GetChars( aFilename ) ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Failed to open file: %s" ),
GetChars( aFilename ) );
return false; return false;
} }
...@@ -178,10 +184,10 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel ) ...@@ -178,10 +184,10 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
m_model->m_rotation = aTransformationModel->m_rotation; m_model->m_rotation = aTransformationModel->m_rotation;
m_model->m_scale = aTransformationModel->m_scale; m_model->m_scale = aTransformationModel->m_scale;
} }
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "loadFileModel: Add model with %lu points, %lu coordIndex, %lu childs." ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "loadFileModel: Add model with %zu points, %zu coordIndex, %zu childs." ),
m_model->m_Point.size(), m_model->m_Point.size(),
m_model->m_CoordIndex.size(), m_model->m_CoordIndex.size(),
m_model->childs.size() ); m_model->childs.size() );
m_ModelParser->childs.push_back( m_model ); m_ModelParser->childs.push_back( m_model );
} }
} }
...@@ -214,10 +220,10 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel ) ...@@ -214,10 +220,10 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
m_model->m_rotation = aTransformationModel->m_rotation; m_model->m_rotation = aTransformationModel->m_rotation;
m_model->m_scale = aTransformationModel->m_scale; m_model->m_scale = aTransformationModel->m_scale;
} }
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "loadFileModel: Add model with %lu points, %lu coordIndex, %lu childs." ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "loadFileModel: Add model with %zu points, %zu coordIndex, %zu childs." ),
m_model->m_Point.size(), m_model->m_Point.size(),
m_model->m_CoordIndex.size(), m_model->m_CoordIndex.size(),
m_model->childs.size() ); m_model->childs.size() );
m_ModelParser->childs.push_back( m_model ); m_ModelParser->childs.push_back( m_model );
} }
} }
...@@ -251,10 +257,10 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel ) ...@@ -251,10 +257,10 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
m_model->m_scale = aTransformationModel->m_scale; m_model->m_scale = aTransformationModel->m_scale;
} }
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "loadFileModel: Add model with %lu points, %lu coordIndex, %lu childs." ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "loadFileModel: Add model with %zu points, %zu coordIndex, %zu childs." ),
m_model->m_Point.size(), m_model->m_Point.size(),
m_model->m_CoordIndex.size(), m_model->m_CoordIndex.size(),
m_model->childs.size() ); m_model->childs.size() );
m_ModelParser->childs.push_back( m_model ); m_ModelParser->childs.push_back( m_model );
} }
...@@ -342,10 +348,10 @@ int VRML2_MODEL_PARSER::read_Transform() ...@@ -342,10 +348,10 @@ int VRML2_MODEL_PARSER::read_Transform()
} }
else else
{ {
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: Add child model with %lu points, %lu coordIndex, %lu childs." ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: Add child model with %zu points, %zu coordIndex, %zu childs." ),
m_model->m_Point.size(), m_model->m_Point.size(),
m_model->m_CoordIndex.size(), m_model->m_CoordIndex.size(),
m_model->childs.size() ); m_model->childs.size() );
m_ModelParser->childs.push_back( m_model ); m_ModelParser->childs.push_back( m_model );
} }
...@@ -360,9 +366,9 @@ int VRML2_MODEL_PARSER::read_Transform() ...@@ -360,9 +366,9 @@ int VRML2_MODEL_PARSER::read_Transform()
ParseVertex( m_file, m_model->m_translation ); ParseVertex( m_file, m_model->m_translation );
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "translation (%f,%f,%f)" ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "translation (%f,%f,%f)" ),
m_model->m_translation.x, m_model->m_translation.x,
m_model->m_translation.y, m_model->m_translation.y,
m_model->m_translation.z ); m_model->m_translation.z );
} }
else if( strcmp( text, "rotation" ) == 0 ) else if( strcmp( text, "rotation" ) == 0 )
{ {
...@@ -376,7 +382,8 @@ int VRML2_MODEL_PARSER::read_Transform() ...@@ -376,7 +382,8 @@ int VRML2_MODEL_PARSER::read_Transform()
m_model->m_rotation[2] = 0.0f; m_model->m_rotation[2] = 0.0f;
m_model->m_rotation[3] = 0.0f; m_model->m_rotation[3] = 0.0f;
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "rotation failed, setting to zeros" ) ); wxLogTrace( traceVrmlV2Parser,
m_debugSpacer + wxT( "rotation failed, setting to zeros" ) );
} }
else else
{ {
...@@ -384,16 +391,17 @@ int VRML2_MODEL_PARSER::read_Transform() ...@@ -384,16 +391,17 @@ int VRML2_MODEL_PARSER::read_Transform()
} }
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "rotation (%f,%f,%f,%f)" ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "rotation (%f,%f,%f,%f)" ),
m_model->m_rotation[0], m_model->m_rotation[0],
m_model->m_rotation[1], m_model->m_rotation[1],
m_model->m_rotation[2], m_model->m_rotation[2],
m_model->m_rotation[3] ); m_model->m_rotation[3] );
} }
else if( strcmp( text, "scale" ) == 0 ) else if( strcmp( text, "scale" ) == 0 )
{ {
ParseVertex( m_file, m_model->m_scale ); ParseVertex( m_file, m_model->m_scale );
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "scale (%f,%f,%f)" ), m_model->m_scale.x, m_model->m_scale.y, m_model->m_scale.z ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "scale (%f,%f,%f)" ),
m_model->m_scale.x, m_model->m_scale.y, m_model->m_scale.z );
} }
else if( strcmp( text, "scaleOrientation" ) == 0 ) else if( strcmp( text, "scaleOrientation" ) == 0 )
{ {
...@@ -478,18 +486,18 @@ int VRML2_MODEL_PARSER::read_Transform() ...@@ -478,18 +486,18 @@ int VRML2_MODEL_PARSER::read_Transform()
{ {
m_model = save_ptr; m_model = save_ptr;
if( ((m_model->m_Point.size() == 0) || (m_model->m_CoordIndex.size() == 0)) && if( ((m_model->m_Point.size() == 0) || (m_model->m_CoordIndex.size() == 0))
(m_model->childs.size() == 0) ) && (m_model->childs.size() == 0) )
{ {
m_model.reset(); m_model.reset();
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: Shape, skipping model with no points or childs" ) ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: Shape, skipping model with no points or childs" ) );
} }
else else
{ {
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: Shape, Add child model with %lu points, %lu coordIndex, %lu childs." ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: Shape, Add child model with %zu points, %zu coordIndex, %zu childs." ),
m_model->m_Point.size(), m_model->m_Point.size(),
m_model->m_CoordIndex.size(), m_model->m_CoordIndex.size(),
m_model->childs.size() ); m_model->childs.size() );
parent->childs.push_back( m_model ); parent->childs.push_back( m_model );
} }
...@@ -498,7 +506,8 @@ int VRML2_MODEL_PARSER::read_Transform() ...@@ -498,7 +506,8 @@ int VRML2_MODEL_PARSER::read_Transform()
{ {
m_model.reset(); m_model.reset();
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: Shape, discard child." ) ); wxLogTrace( traceVrmlV2Parser,
m_debugSpacer + wxT( "read_Transform: Shape, discard child." ) );
} }
} }
else else
...@@ -554,11 +563,11 @@ int VRML2_MODEL_PARSER::read_Transform() ...@@ -554,11 +563,11 @@ int VRML2_MODEL_PARSER::read_Transform()
m_counter_USE_GROUP++; m_counter_USE_GROUP++;
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: USE %s Add child model with %lu points, %lu coordIndex, %lu childs." ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: USE %s Add child model with %zu points, %zu coordIndex, %zu childs." ),
useLabel, useLabel,
ptrModel->m_Point.size(), ptrModel->m_Point.size(),
ptrModel->m_CoordIndex.size(), ptrModel->m_CoordIndex.size(),
ptrModel->childs.size() ); ptrModel->childs.size() );
m_model->childs.push_back( ptrModel ); m_model->childs.push_back( ptrModel );
} }
...@@ -566,13 +575,15 @@ int VRML2_MODEL_PARSER::read_Transform() ...@@ -566,13 +575,15 @@ int VRML2_MODEL_PARSER::read_Transform()
else else
{ {
debug_exit(); debug_exit();
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: USE Failed to get the label name" ) ); wxLogTrace( traceVrmlV2Parser,
m_debugSpacer + wxT( "read_Transform: USE Failed to get the label name" ) );
return -1; return -1;
} }
} }
else else
{ {
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Transform: %s NotImplemented" ), text ); wxLogTrace( traceVrmlV2Parser,
m_debugSpacer + wxT( "read_Transform: %s NotImplemented" ), text );
Read_NotImplemented( m_file, '}' ); Read_NotImplemented( m_file, '}' );
} }
} }
...@@ -652,7 +663,8 @@ int VRML2_MODEL_PARSER::read_Inline() ...@@ -652,7 +663,8 @@ int VRML2_MODEL_PARSER::read_Inline()
} }
else else
{ {
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "URL Failed to open file: %s" ), text ); wxLogTrace( traceVrmlV2Parser,
m_debugSpacer + wxT( "URL Failed to open file: %s" ), text );
} }
} }
else else
...@@ -681,7 +693,8 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate() ...@@ -681,7 +693,8 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate()
if( !GetNextTag( m_file, text, sizeof(text) ) ) if( !GetNextTag( m_file, text, sizeof(text) ) )
{ {
debug_exit(); debug_exit();
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_DEF_Coordinate failed to get next tag" ) ); wxLogTrace( traceVrmlV2Parser,
m_debugSpacer + wxT( "read_DEF_Coordinate failed to get next tag" ) );
return -1; return -1;
} }
...@@ -706,7 +719,8 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate() ...@@ -706,7 +719,8 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate()
if( retVal == 0 ) if( retVal == 0 )
{ {
m_defCoordinateMap.insert( std::make_pair( coordinateName, m_model->m_Point ) ); m_defCoordinateMap.insert( std::make_pair( coordinateName, m_model->m_Point ) );
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_DEF_Coordinate insert %s" ), coordinateName ); wxLogTrace( traceVrmlV2Parser,
m_debugSpacer + wxT( "read_DEF_Coordinate insert %s" ), coordinateName );
} }
debug_exit(); debug_exit();
...@@ -799,7 +813,7 @@ int VRML2_MODEL_PARSER::read_DEF() ...@@ -799,7 +813,7 @@ int VRML2_MODEL_PARSER::read_DEF()
} }
else else
{ {
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_DEF: Shape, Add child model with %lu points, %lu coordIndex, %lu childs." ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_DEF: Shape, Add child model with %zu points, %zu coordIndex, %zu childs." ),
m_model->m_Point.size(), m_model->m_Point.size(),
m_model->m_CoordIndex.size(), m_model->m_CoordIndex.size(),
m_model->childs.size() ); m_model->childs.size() );
...@@ -840,7 +854,7 @@ int VRML2_MODEL_PARSER::read_DEF() ...@@ -840,7 +854,7 @@ int VRML2_MODEL_PARSER::read_DEF()
m_defGroupMap[groupName] = new_mesh_model; m_defGroupMap[groupName] = new_mesh_model;
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Group %s: inserted model with %lu points, %lu coordIndex, %lu childs." ), wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "Group %s: inserted model with %zu points, %zu coordIndex, %zu childs." ),
tagName, tagName,
new_mesh_model->m_Point.size(), new_mesh_model->m_Point.size(),
new_mesh_model->m_CoordIndex.size(), new_mesh_model->m_CoordIndex.size(),
...@@ -1538,7 +1552,8 @@ int VRML2_MODEL_PARSER::read_coordIndex() ...@@ -1538,7 +1552,8 @@ int VRML2_MODEL_PARSER::read_coordIndex()
} }
} }
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_coordIndex m_CoordIndex.size: %lu" ), m_model->m_CoordIndex.size() ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_coordIndex m_CoordIndex.size: %zu" ),
m_model->m_CoordIndex.size() );
debug_exit(); debug_exit();
return 0; return 0;
} }
...@@ -1595,9 +1610,9 @@ int VRML2_MODEL_PARSER::read_Normal() ...@@ -1595,9 +1610,9 @@ int VRML2_MODEL_PARSER::read_Normal()
{ {
// Debug // Debug
if( m_normalPerVertex == false ) if( m_normalPerVertex == false )
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal m_PerFaceNormalsNormalized.size: %lu" ), m_model->m_PerFaceNormalsNormalized.size() ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal m_PerFaceNormalsNormalized.size: %zu" ), m_model->m_PerFaceNormalsNormalized.size() );
else else
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal m_PerVertexNormalsNormalized.size: %lu" ), m_model->m_PerVertexNormalsNormalized.size() ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal m_PerVertexNormalsNormalized.size: %zu" ), m_model->m_PerVertexNormalsNormalized.size() );
debug_exit(); debug_exit();
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal exit" ) ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal exit" ) );
return 0; return 0;
...@@ -1637,7 +1652,9 @@ int VRML2_MODEL_PARSER::read_Coordinate() ...@@ -1637,7 +1652,9 @@ int VRML2_MODEL_PARSER::read_Coordinate()
if( *text == '}' ) if( *text == '}' )
{ {
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Coordinate m_Point.size: %lu" ), m_model->m_Point.size() ); wxLogTrace( traceVrmlV2Parser,
m_debugSpacer + wxT( "read_Coordinate m_Point.size: %zu" ),
m_model->m_Point.size() );
debug_exit(); debug_exit();
wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Coordinate exit" ) ); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Coordinate exit" ) );
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment