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

Fix some coverity warnings (mainly not initialized vars).

parent 30acc07e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -452,7 +452,8 @@ void PDF_PLOTTER::closePdfStream()
{
    wxASSERT( workFile );

    int stream_len = ftell( workFile );
    long stream_len = ftell( workFile );
    wxASSERT( stream_len >= 0 );

    // Rewind the file, read in the page stream and DEFLATE it
    fseek( workFile, 0, SEEK_SET );
@@ -468,7 +469,7 @@ void PDF_PLOTTER::closePdfStream()
    ::wxRemoveFile( workFilename );

    // NULL means memos owns the memory, but provide a hint on optimum size needed.
    wxMemoryOutputStream    memos( NULL, std::max( 2000, stream_len ) ) ;
    wxMemoryOutputStream    memos( NULL, std::max( 2000l, stream_len ) ) ;

    {
        /* Somewhat standard parameters to compress in DEFLATE. The PDF spec is
+2 −4
Original line number Diff line number Diff line
@@ -208,8 +208,6 @@ void LIB_VIEW_FRAME::SelectAndViewLibraryPart( int option )
void LIB_VIEW_FRAME::ViewOneLibraryContent( PART_LIB* Lib, int Flag )
{
    int        NumOfParts = 0;
    LIB_ALIAS* entry;
    wxString   CmpName;

    if( Lib )
        NumOfParts = Lib->GetCount();
@@ -220,8 +218,8 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( PART_LIB* Lib, int Flag )
        return;
    }

    if( Lib == NULL )
        return;
    LIB_ALIAS* entry;
    wxString   CmpName;

    if( Flag == NEW_PART )
        DisplayListComponentsInLib( Lib, CmpName, m_entryName );
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ public:
    {
        int x, y;

        TPos() { }
        TPos() : x( 0 ), y( 0 ) { }
        TPos( int _x, int _y ) : x( _x ), y( _y ) { }

        bool operator ==( const TPos& p ) const { return x == p.x && y == p.y; }
@@ -36,7 +36,7 @@ public:
    {
        int w, h;

        TRect() { }
        TRect() : w( 0 ), h( 0 ) { }
        TRect( int _x, int _y, int _w, int _h ) : TPos( _x, _y ), w( _w > 0 ? _w : 0 ), h(
                _h > 0 ? _h : 0 ) { }

+8 −8
Original line number Diff line number Diff line
@@ -662,12 +662,12 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
        if( !pad->IsSelected() && !force_all )
            continue;

        wxPoint pos = pad->GetPosition();
        wxPoint pos = pad->GetPos0();
        ROTATE( pos );
        pad->SetPosition( pos );

        pad->SetPos0( pad->GetPosition() );
        pad->SetPos0( pos );
        pad->SetOrientation( pad->GetOrientation() + 900 );

        pad->SetDrawCoord();
    }

    for( EDA_ITEM* item = module->GraphicalItems();  item;  item = item->Next() )
@@ -681,15 +681,15 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
        {
            EDGE_MODULE* em = (EDGE_MODULE*) item;

            wxPoint tmp = em->GetStart();
            wxPoint tmp = em->GetStart0();
            ROTATE( tmp );
            em->SetStart( tmp );
            em->SetStart0( tmp );

            tmp = em->GetEnd();
            tmp = em->GetEnd0();
            ROTATE( tmp );
            em->SetEnd( tmp );
            em->SetEnd0( tmp );

            em->SetDrawCoord();
        }
        break;

+2 −3
Original line number Diff line number Diff line
@@ -233,7 +233,8 @@ void BOARD::chainMarkedSegments( wxPoint aPosition, LSET aLayerMask, TRACK_PTRS*
         *  if > 1 segment:
         *      end of track (more than 2 segment connected at this location)
         */
        segment = m_Track; candidate = NULL;
        segment = m_Track;
        candidate = NULL;
        NbSegm  = 0;

        while( ( segment = ::GetTrack( segment, NULL, aPosition, aLayerMask ) ) != NULL )
@@ -280,8 +281,6 @@ void BOARD::chainMarkedSegments( wxPoint aPosition, LSET aLayerMask, TRACK_PTRS*
                aPosition = candidate->GetStart();
            }

            segment = m_Track; /* restart list of tracks to analyze */

            /* flag this item an push it in list of selected items */
            aList->push_back( candidate );
            candidate->SetState( BUSY, true );
Loading