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

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

parent 9c0c8925
Loading
Loading
Loading
Loading
+67 −50
Original line number Original line Diff line number Diff line
@@ -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 )
    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
{
{
    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
        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,7 +184,7 @@ 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() );
@@ -214,7 +220,7 @@ 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() );
@@ -251,7 +257,7 @@ 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() );
@@ -342,7 +348,7 @@ 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() );
@@ -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
            {
            {
@@ -393,7 +400,8 @@ int VRML2_MODEL_PARSER::read_Transform()
        {
        {
            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,15 +486,15 @@ 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() );
@@ -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,7 +563,7 @@ 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(),
@@ -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()
                }
                }
                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()
    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()
            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()
                }
                }
                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()


                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()
        }
        }
    }
    }


    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()
        {
        {
            // 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()


        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;