Commit a367dea4 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Fix most GCC 4.6 compiler warnings and minor bug fix.

* Remove most (not all) variables that were initialized but never used that
  cause GCC 4.6 to generate a warning.
* Fix bug in schematic library editor best zoom calculation.
parent e42591af
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -630,7 +630,6 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
        wxYield();
        wxYield();
    }
    }


    wxSize image_size = GetClientSize();
    struct vieport_params
    struct vieport_params
    {
    {
        GLint originx;
        GLint originx;
+1 −2
Original line number Original line Diff line number Diff line
@@ -237,7 +237,7 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
                                   GRTraceMode trace_mode )
                                   GRTraceMode trace_mode )
{
{
    wxASSERT( output_file );
    wxASSERT( output_file );
    int rayon, deltaxy, cx, cy;
    int deltaxy, cx, cy;


    /* The pad is reduced to an oval with size.y > size.x
    /* The pad is reduced to an oval with size.y > size.x
     * (Oval vertical orientation 0)
     * (Oval vertical orientation 0)
@@ -249,7 +249,6 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
            orient -= 3600;
            orient -= 3600;
    }
    }
    deltaxy = size.y - size.x;     /* distance between centers of the oval */
    deltaxy = size.y - size.x;     /* distance between centers of the oval */
    rayon   = size.x / 2;


    if( trace_mode == FILLED )
    if( trace_mode == FILLED )
    {
    {
+0 −3
Original line number Original line Diff line number Diff line
@@ -880,9 +880,6 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
    INSTALL_UNBUFFERED_DC( DC, this );
    INSTALL_UNBUFFERED_DC( DC, this );
    DC.SetBackground( *wxBLACK_BRUSH );
    DC.SetBackground( *wxBLACK_BRUSH );


    /* Compute the cursor position in screen (device) units. */
    wxPoint pos = CalcUnscrolledPosition( event.GetPosition() );

    /* Compute the cursor position in drawing (logical) units. */
    /* Compute the cursor position in drawing (logical) units. */
    screen->SetMousePosition( event.GetLogicalPosition( DC ) );
    screen->SetMousePosition( event.GetLogicalPosition( DC ) );


+2 −4
Original line number Original line Diff line number Diff line
@@ -438,19 +438,17 @@ bool WinEDA_App::SetBinDir()
    char     Line[1024];
    char     Line[1024];
    char     FileName[1024];
    char     FileName[1024];
    wxString str_arg0;
    wxString str_arg0;
    int      ii;
    char*    res;


    FileName[0] = 0;
    FileName[0] = 0;
    str_arg0    = argv[0];
    str_arg0    = argv[0];
    if( strchr( (const char*) argv[0], '/' ) == NULL ) // no path
    if( strchr( (const char*) argv[0], '/' ) == NULL ) // no path
    {
    {
        sprintf( FileName, "which %s > %s", TO_UTF8( str_arg0 ), TMP_FILE );
        sprintf( FileName, "which %s > %s", TO_UTF8( str_arg0 ), TMP_FILE );
        ii = system( FileName );
        system( FileName );


        if( ( ftmp = fopen( TMP_FILE, "rt" ) ) != NULL )
        if( ( ftmp = fopen( TMP_FILE, "rt" ) ) != NULL )
        {
        {
            res = fgets( Line, 1000, ftmp );
            fgets( Line, 1000, ftmp );
            fclose( ftmp );
            fclose( ftmp );
            remove( TMP_FILE );
            remove( TMP_FILE );
        }
        }
+0 −4
Original line number Original line Diff line number Diff line
@@ -98,19 +98,16 @@ void SCH_EDIT_FRAME::InitBlockPasteInfos()
 */
 */
void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{
{
    bool            err   = false;
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;


    if( !DrawPanel->IsMouseCaptured() )
    if( !DrawPanel->IsMouseCaptured() )
    {
    {
        err = true;
        DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
        DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
    }
    }


    if( block->GetCount() == 0 )
    if( block->GetCount() == 0 )
    {
    {
        wxString msg;
        wxString msg;
        err = true;
        msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd %d, state %d)" ),
        msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd %d, state %d)" ),
                    block->m_Command, block->m_State );
                    block->m_Command, block->m_State );
        DisplayError( this, msg );
        DisplayError( this, msg );
@@ -121,7 +118,6 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
    switch( block->m_Command )
    switch( block->m_Command )
    {
    {
    case BLOCK_IDLE:
    case BLOCK_IDLE:
        err = true;
        break;
        break;


    case BLOCK_ROTATE:
    case BLOCK_ROTATE:
Loading