Commit d4e04dcc authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Fix bugs detected by Cppcheck.

parent 79e2a414
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -812,11 +812,12 @@ void OPENGL_GAL::drawLineQuad( const VECTOR2D& aStartPoint, const VECTOR2D& aEnd

    VECTOR2D startEndVector = aEndPoint - aStartPoint;
    double   lineLength     = startEndVector.EuclideanNorm();
    double   scale          = 0.5 * lineWidth / lineLength;

    if( lineLength <= 0.0 )
        return;
        
    double   scale          = 0.5 * lineWidth / lineLength;

    // The perpendicular vector also needs transformations
    glm::vec4 vector = currentManager->GetTransformation() *
                       glm::vec4( -startEndVector.y * scale, startEndVector.x * scale, 0.0, 0.0 );
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )

            bool equ_is_unique = true;
            unsigned next = idx+1;
            unsigned previous = idx-1;
            int  previous = idx-1;

            if( next < equiv_List.size() &&
                equivItem.m_ComponentValue == equiv_List[next].m_ComponentValue )
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source )
    m_Bold      = source->m_Bold;
    m_HJustify  = source->m_HJustify;
    m_VJustify  = source->m_VJustify;
    m_MultilineAllowed = m_MultilineAllowed;
    m_MultilineAllowed = source->m_MultilineAllowed;

    m_Text = source->m_Text;
}
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
    wxPoint         pos;

    strncpy( line, cmdline, sizeof(line) - 1 );
    line[sizeof(line) - 1] = 0;

    idcmd = strtok( line, " \n\r" );
    text  = strtok( NULL, " \n\r" );