← Back to team overview

kicad-developers team mailing list archive

[PATCH] eeschema cleanup of unused vars and imports and type casts

 

Quick  pass. Removed a little dead includes, unused variables and some
type casts. No functional or anything changes. Manually performed.
From 8ae564509c801dab287004e9fe532f34c7100b4a Mon Sep 17 00:00:00 2001
From: Mark Roszko <mark.roszko@xxxxxxxxx>
Date: Tue, 3 Nov 2015 00:17:06 -0500
Subject: [PATCH] Remove unused variables, remove redundant casts, remove a
 little unused headers, tweak a boolean cast or two.

---
 eeschema/annotate.cpp                                   | 4 ----
 eeschema/block.cpp                                      | 3 ---
 eeschema/block_libedit.cpp                              | 3 +--
 eeschema/bus-wire-junction.cpp                          | 4 +---
 eeschema/busentry.cpp                                   | 3 ---
 eeschema/class_library.cpp                              | 6 ------
 eeschema/controle.cpp                                   | 1 -
 eeschema/eeschema.cpp                                   | 2 +-
 eeschema/eeschema_config.cpp                            | 1 -
 eeschema/files-io.cpp                                   | 1 -
 eeschema/find.cpp                                       | 9 ++-------
 eeschema/lib_bezier.cpp                                 | 6 ++----
 eeschema/lib_polyline.cpp                               | 6 ++----
 eeschema/libeditframe.cpp                               | 2 +-
 eeschema/netlist_exporters/netlist_exporter_cadstar.cpp | 1 -
 eeschema/onleftclick.cpp                                | 1 -
 eeschema/plot_schematic_DXF.cpp                         | 2 +-
 eeschema/plot_schematic_PDF.cpp                         | 1 -
 eeschema/plot_schematic_PS.cpp                          | 1 -
 eeschema/sch_collectors.cpp                             | 4 ++--
 eeschema/sch_sheet.cpp                                  | 4 ++--
 eeschema/sch_sheet_path.cpp                             | 2 +-
 eeschema/sch_sheet_pin.cpp                              | 4 ++--
 eeschema/schematic_undo_redo.cpp                        | 4 +---
 eeschema/schframe.cpp                                   | 2 +-
 eeschema/sheet.cpp                                      | 2 --
 eeschema/viewlib_frame.cpp                              | 6 ------
 27 files changed, 20 insertions(+), 65 deletions(-)

diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp
index cb47703..2d297c6 100644
--- a/eeschema/annotate.cpp
+++ b/eeschema/annotate.cpp
@@ -35,10 +35,6 @@
 
 #include <sch_reference_list.h>
 #include <class_library.h>
-#include <sch_component.h>
-#include <lib_pin.h>
-
-#include <boost/foreach.hpp>
 
 void SCH_EDIT_FRAME::DeleteAnnotation( bool aCurrentSheetOnly )
 {
diff --git a/eeschema/block.cpp b/eeschema/block.cpp
index af140e1..e4b38e9 100644
--- a/eeschema/block.cpp
+++ b/eeschema/block.cpp
@@ -48,9 +48,6 @@
 #include <sch_sheet.h>
 #include <sch_sheet_path.h>
 
-#include <boost/foreach.hpp>
-
-
 // Imported functions:
 extern void SetSchItemParent( SCH_ITEM* Struct, SCH_SCREEN* Screen );
 extern void MoveItemsInList( PICKED_ITEMS_LIST& aItemsList, const wxPoint aMoveVector );
diff --git a/eeschema/block_libedit.cpp b/eeschema/block_libedit.cpp
index 256f74e..5dc235f 100644
--- a/eeschema/block_libedit.cpp
+++ b/eeschema/block_libedit.cpp
@@ -87,7 +87,7 @@ int LIB_EDIT_FRAME::BlockCommand( int key )
 bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
 {
     int ItemCount = 0;
-    int nextCmd = false;
+    bool nextCmd = false;
     wxPoint pt;
 
     if( GetScreen()->m_BlockLocate.GetCount() )
@@ -323,7 +323,6 @@ void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
 {
     BLOCK_SELECTOR* block;
     BASE_SCREEN* screen = aPanel->GetScreen();
-    wxPoint move_offset;
     block = &screen->m_BlockLocate;
 
     LIB_EDIT_FRAME* parent = (LIB_EDIT_FRAME*) aPanel->GetParent();
diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp
index 7eb6b35..18e3bd1 100644
--- a/eeschema/bus-wire-junction.cpp
+++ b/eeschema/bus-wire-junction.cpp
@@ -30,7 +30,6 @@
 #include <fctsys.h>
 #include <gr_basic.h>
 #include <class_drawpanel.h>
-#include <confirm.h>
 #include <schframe.h>
 
 #include <lib_draw_item.h>
@@ -43,7 +42,6 @@
 #include <sch_text.h>
 #include <sch_component.h>
 #include <sch_sheet.h>
-#include <trigo.h>
 
 
 static void AbortCreateNewLine( EDA_DRAW_PANEL* aPanel, wxDC* aDC );
@@ -208,7 +206,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
     }
     else    // A segment is in progress: terminates the current segment and add a new segment.
     {
-        SCH_LINE* prevSegment = (SCH_LINE*) segment->Back();
+        SCH_LINE* prevSegment = segment->Back();
 
         // Be aware prevSegment can be null when the horizontal and vertical lines only switch is off
         // when we create the first segment.
diff --git a/eeschema/busentry.cpp b/eeschema/busentry.cpp
index 20d266c..06c3ba3 100644
--- a/eeschema/busentry.cpp
+++ b/eeschema/busentry.cpp
@@ -31,11 +31,8 @@
 #include <fctsys.h>
 #include <gr_basic.h>
 #include <class_drawpanel.h>
-#include <eeschema_id.h>
-#include <confirm.h>
 #include <schframe.h>
 
-#include <general.h>
 #include <sch_bus_entry.h>
 
 
diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp
index bbda657..93a5331 100644
--- a/eeschema/class_library.cpp
+++ b/eeschema/class_library.cpp
@@ -39,7 +39,6 @@
 #include <config_params.h>
 #include <wildcards_and_files_ext.h>
 #include <project_rescue.h>
-//#include <richio.h>
 
 #include <general.h>
 #include <class_library.h>
@@ -487,8 +486,6 @@ bool PART_LIB::Load( wxString& aErrorMsg )
     // There is no header if this is a symbol library.
     if( type == LIBRARY_TYPE_EESCHEMA )
     {
-        wxString tmp;
-
         line = reader.Line();
 
         header = FROM_UTF8( line );
@@ -648,7 +645,6 @@ bool PART_LIB::LoadDocs( wxString& aErrorMsg )
     char       line[8000], * name, * text;
     LIB_ALIAS* entry;
     FILE*      file;
-    wxString   msg;
     wxFileName fn = fileName;
 
     fn.SetExt( DOC_EXT );
@@ -1066,8 +1062,6 @@ void PART_LIBS::LibNamesAndPaths( PROJECT* aProject, bool doSave,
     }
     else
     {
-        wxString pro = aProject->GetProjectFullName();
-
         if( !aProject->ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, ca ) )
         {
             wxString msg = wxString::Format( _(
diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp
index 7e42bee..cfd7c6e 100644
--- a/eeschema/controle.cpp
+++ b/eeschema/controle.cpp
@@ -52,7 +52,6 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
                                              int aHotKeyCommandId )
 {
     SCH_ITEM*      item;
-    wxString       msg;
     LIB_PIN*       Pin     = NULL;
     SCH_COMPONENT* LibItem = NULL;
     wxPoint        gridPosition = GetNearestGridPosition( aPosition );
diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp
index 9472f55..cfc062a 100644
--- a/eeschema/eeschema.cpp
+++ b/eeschema/eeschema.cpp
@@ -139,7 +139,7 @@ KIFACE_I& Kiface() { return kiface; }
 // KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
 MY_API( KIFACE* ) KIFACE_GETTER(  int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
 {
-    process = (PGM_BASE*) aProgram;
+    process = aProgram;
     return &kiface;
 }
 
diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp
index 4603253..144d212 100644
--- a/eeschema/eeschema_config.cpp
+++ b/eeschema/eeschema_config.cpp
@@ -167,7 +167,6 @@ void LIB_EDIT_FRAME::OnColorConfig( wxCommandEvent& aEvent )
 void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
 {
     int        id = event.GetId();
-    wxFileName fn;
 
     switch( id )
     {
diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp
index c898c38..b9b122d 100644
--- a/eeschema/files-io.cpp
+++ b/eeschema/files-io.cpp
@@ -337,7 +337,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
 bool SCH_EDIT_FRAME::AppendOneEEProject()
 {
     wxString    fullFileName;
-    wxString    msg;
 
     SCH_SCREEN* screen = GetScreen();
 
diff --git a/eeschema/find.cpp b/eeschema/find.cpp
index fc7aeb4..5f40218 100644
--- a/eeschema/find.cpp
+++ b/eeschema/find.cpp
@@ -65,7 +65,6 @@ void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
     SCH_SHEET_LIST     schematic;
     SCH_SHEET_PATH*    sheetFoundIn = NULL;
     bool               wrap = ( event.GetFlags() & FR_SEARCH_WRAP ) != 0;
-    wxRect             clientRect( wxPoint( 0, 0 ), GetClientSize() );
     bool               warpCursor = ( ( event.GetId() == wxEVT_COMMAND_FIND_CLOSE ) ||
                                       !( event.GetFlags() & FR_NO_WARP_CURSOR ) );
 
@@ -118,7 +117,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
     SCH_SHEET_PATH* sheetWithComponentFound = NULL;
     SCH_ITEM*       item = NULL;
     SCH_COMPONENT*  Component = NULL;
-    wxPoint         pos, curpos;
+    wxPoint         pos;
     bool            centerAndRedraw = false;
     bool            notFound = true;
     LIB_PIN*        pin;
@@ -131,7 +130,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
 
     for( ; sheet != NULL; sheet = sheetList.GetNext() )
     {
-        item = (SCH_ITEM*) sheet->LastDrawList();
+        item = sheet->LastDrawList();
 
         for( ; ( item != NULL ) && ( notFound == true ); item = item->Next() )
         {
@@ -306,10 +305,6 @@ bool SCH_EDIT_FRAME::IsSearchCacheObsolete( const SCH_FIND_REPLACE_DATA& aSearch
 
 void SCH_EDIT_FRAME::OnFindSchematicItem( wxFindDialogEvent& aEvent )
 {
-    static wxPoint          itemPosition;  // the actual position of the matched item.
-
-    SCH_SHEET_LIST          schematic;
-    wxString                msg;
     SCH_FIND_REPLACE_DATA   searchCriteria;
     SCH_FIND_COLLECTOR_DATA data;
 
diff --git a/eeschema/lib_bezier.cpp b/eeschema/lib_bezier.cpp
index 98102fe..35c3187 100644
--- a/eeschema/lib_bezier.cpp
+++ b/eeschema/lib_bezier.cpp
@@ -93,11 +93,10 @@ bool LIB_BEZIER::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
     strtok( line + 2, " \t\n" );     // Skip field
     strtok( NULL, " \t\n" );         // Skip field
     strtok( NULL, " \t\n" );         // Skip field
-    p = strtok( NULL, " \t\n" );
+    strtok( NULL, " \t\n" );
 
     for( i = 0; i < ccount; i++ )
     {
-        wxPoint point;
         p = strtok( NULL, " \t\n" );
 
         if( sscanf( p, "%d", &pt.x ) != 1 )
@@ -289,7 +288,6 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
                               EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode, void* aData,
                               const TRANSFORM& aTransform )
 {
-    wxPoint              pos1;
     std::vector<wxPoint> PolyPointsTraslated;
 
     EDA_COLOR_T color = GetLayerColor( LAYER_DEVICE );
@@ -358,7 +356,7 @@ bool LIB_BEZIER::HitTest( const wxPoint& aRefPos ) const
 
 bool LIB_BEZIER::HitTest( const wxPoint &aPosRef, int aThreshold, const TRANSFORM& aTransform ) const
 {
-    wxPoint ref, start, end;
+    wxPoint start, end;
 
     if( aThreshold < 0 )
         aThreshold = GetPenSize() / 2;
diff --git a/eeschema/lib_polyline.cpp b/eeschema/lib_polyline.cpp
index 2ee1360..9c24899 100644
--- a/eeschema/lib_polyline.cpp
+++ b/eeschema/lib_polyline.cpp
@@ -98,11 +98,10 @@ bool LIB_POLYLINE::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
     strtok( line + 2, " \t\n" );     // Skip field
     strtok( NULL, " \t\n" );         // Skip field
     strtok( NULL, " \t\n" );         // Skip field
-    p = strtok( NULL, " \t\n" );
+    strtok( NULL, " \t\n" );
 
     for( i = 0; i < ccount; i++ )
     {
-        wxPoint point;
         p = strtok( NULL, " \t\n" );
 
         if( p == NULL || sscanf( p, "%d", &pt.x ) != 1 )
@@ -244,7 +243,6 @@ void LIB_POLYLINE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
     {
         aPlotter->SetColor( GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
         aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 );
-        aFill = false;  // body is now filled, do not fill it later.
     }
 
     bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
@@ -337,7 +335,7 @@ bool LIB_POLYLINE::HitTest( const wxPoint& aPosition ) const
 
 bool LIB_POLYLINE::HitTest( const wxPoint &aPosition, int aThreshold, const TRANSFORM& aTransform ) const
 {
-    wxPoint ref, start, end;
+    wxPoint start, end;
 
     if( aThreshold < 0 )
         aThreshold = GetPenSize() / 2;
diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp
index 97f738e..bd489a0 100644
--- a/eeschema/libeditframe.cpp
+++ b/eeschema/libeditframe.cpp
@@ -533,7 +533,7 @@ void LIB_EDIT_FRAME::OnUpdatePinByPin( wxUpdateUIEvent& event )
 void LIB_EDIT_FRAME::OnUpdatePinTable( wxUpdateUIEvent& event )
 {
     LIB_PART* part = GetCurPart();
-    event.Enable( part );
+    event.Enable( part != NULL );
 }
 
 void LIB_EDIT_FRAME::OnUpdatePartNumber( wxUpdateUIEvent& event )
diff --git a/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp b/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp
index 1d175a9..2b5b7fb 100644
--- a/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp
+++ b/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp
@@ -53,7 +53,6 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig
 
     wxString StartCmpDesc = StartLine + wxT( "ADD_COM" );
     wxString msg;
-    wxString footprint;
     SCH_SHEET_PATH* sheet;
     EDA_ITEM* DrawList;
     SCH_COMPONENT* component;
diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp
index 39cc14d..35ba87d 100644
--- a/eeschema/onleftclick.cpp
+++ b/eeschema/onleftclick.cpp
@@ -30,7 +30,6 @@
 #include <fctsys.h>
 #include <eeschema_id.h>
 #include <class_drawpanel.h>
-#include <confirm.h>
 #include <schframe.h>
 #include <menus_helpers.h>
 
diff --git a/eeschema/plot_schematic_DXF.cpp b/eeschema/plot_schematic_DXF.cpp
index e613893..a571c73 100644
--- a/eeschema/plot_schematic_DXF.cpp
+++ b/eeschema/plot_schematic_DXF.cpp
@@ -38,7 +38,7 @@
 
 void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
 {
-    SCH_EDIT_FRAME* schframe  = (SCH_EDIT_FRAME*) m_parent;
+    SCH_EDIT_FRAME* schframe  = m_parent;
     SCH_SCREEN*     screen    = schframe->GetScreen();
     SCH_SHEET_PATH* sheetpath;
     SCH_SHEET_PATH  oldsheetpath = schframe->GetCurrentSheet();
diff --git a/eeschema/plot_schematic_PDF.cpp b/eeschema/plot_schematic_PDF.cpp
index b549a6f..900e1fb 100644
--- a/eeschema/plot_schematic_PDF.cpp
+++ b/eeschema/plot_schematic_PDF.cpp
@@ -43,7 +43,6 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
     SCH_SCREEN*     screen = m_parent->GetScreen();
     SCH_SHEET_PATH* sheetpath;
     SCH_SHEET_PATH  oldsheetpath = m_parent->GetCurrentSheet();     // sheetpath is saved here
-    wxPoint         plot_offset;
 
     /* When printing all pages, the printed page is not the current page.  In
      * complex hierarchies, we must update component references and others
diff --git a/eeschema/plot_schematic_PS.cpp b/eeschema/plot_schematic_PS.cpp
index e7af7aa..0c42e53 100644
--- a/eeschema/plot_schematic_PS.cpp
+++ b/eeschema/plot_schematic_PS.cpp
@@ -105,7 +105,6 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
         wxPoint plot_offset;
 
         wxString outputDirName = m_outputDirectoryName->GetValue();
-        wxFileName outputDir = wxFileName::DirName( outputDirName );
 
         wxString msg;
         REPORTER& reporter = m_MessagesBox->Reporter();
diff --git a/eeschema/sch_collectors.cpp b/eeschema/sch_collectors.cpp
index 4590501..7fb47ed 100644
--- a/eeschema/sch_collectors.cpp
+++ b/eeschema/sch_collectors.cpp
@@ -248,8 +248,8 @@ bool SCH_COLLECTOR::IsCorner() const
     if( GetCount() != 2 )
         return false;
 
-    bool is_busentry0 = dynamic_cast<SCH_BUS_ENTRY_BASE*>( m_List[0] );
-    bool is_busentry1 = dynamic_cast<SCH_BUS_ENTRY_BASE*>( m_List[1] );
+    bool is_busentry0 = (dynamic_cast<SCH_BUS_ENTRY_BASE*>( m_List[0] ) != NULL);
+    bool is_busentry1 = (dynamic_cast<SCH_BUS_ENTRY_BASE*>( m_List[1] ) != NULL);
 
     if( (m_List[0]->Type() == SCH_LINE_T) && (m_List[1]->Type() == SCH_LINE_T) )
         return true;
diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp
index ddce303..0a03994 100644
--- a/eeschema/sch_sheet.cpp
+++ b/eeschema/sch_sheet.cpp
@@ -601,7 +601,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
 
     Text = wxT( "Sheet: " ) + m_name;
     DrawGraphicText( clipbox, aDC, pos_sheetname,
-                     (EDA_COLOR_T) txtcolor, Text, name_orientation,
+                     txtcolor, Text, name_orientation,
                      wxSize( m_sheetNameSize, m_sheetNameSize ),
                      GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, lineWidth,
                      false, false );
@@ -614,7 +614,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
 
     Text = wxT( "File: " ) + m_fileName;
     DrawGraphicText( clipbox, aDC, pos_filename,
-                     (EDA_COLOR_T) txtcolor, Text, name_orientation,
+                     txtcolor, Text, name_orientation,
                      wxSize( m_fileNameSize, m_fileNameSize ),
                      GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, lineWidth,
                      false, false );
diff --git a/eeschema/sch_sheet_path.cpp b/eeschema/sch_sheet_path.cpp
index 52027e3..4c875a2 100644
--- a/eeschema/sch_sheet_path.cpp
+++ b/eeschema/sch_sheet_path.cpp
@@ -213,7 +213,7 @@ wxString SCH_SHEET_PATH::Path() const
 
 wxString SCH_SHEET_PATH::PathHumanReadable() const
 {
-    wxString s, t;
+    wxString s;
 
     s = wxT( "/" );
 
diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp
index b6febf9..048ffb1 100644
--- a/eeschema/sch_sheet_pin.cpp
+++ b/eeschema/sch_sheet_pin.cpp
@@ -117,7 +117,7 @@ void SCH_SHEET_PIN::SetNumber( int aNumber )
 
 void SCH_SHEET_PIN::SetEdge( SCH_SHEET_PIN::SHEET_SIDE aEdge )
 {
-    SCH_SHEET* Sheet = (SCH_SHEET*) GetParent();
+    SCH_SHEET* Sheet = GetParent();
 
     // use SHEET_UNDEFINED_SIDE to adjust text orientation without changing edge
 
@@ -161,7 +161,7 @@ enum SCH_SHEET_PIN::SHEET_SIDE SCH_SHEET_PIN::GetEdge() const
 
 void SCH_SHEET_PIN::ConstrainOnEdge( wxPoint Pos )
 {
-    SCH_SHEET* sheet = (SCH_SHEET*) GetParent();
+    SCH_SHEET* sheet = GetParent();
 
     if( sheet == NULL )
         return;
diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp
index 4dcbbe1..7c539d0 100644
--- a/eeschema/schematic_undo_redo.cpp
+++ b/eeschema/schematic_undo_redo.cpp
@@ -121,9 +121,7 @@ void SCH_EDIT_FRAME::SaveCopyInUndoList( SCH_ITEM*      aItem,
     commandToUndo->m_TransformPoint = aTransformPoint;
 
     ITEM_PICKER itemWrapper( aItem, aCommandType );
-
-    if( aItem )
-        itemWrapper.SetFlags( aItem->GetFlags() );
+    itemWrapper.SetFlags( aItem->GetFlags() );
 
     switch( aCommandType )
     {
diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp
index 3cd6f4e..2568576 100644
--- a/eeschema/schframe.cpp
+++ b/eeschema/schframe.cpp
@@ -465,7 +465,7 @@ void SCH_EDIT_FRAME::SetRepeatItem( SCH_ITEM* aItem )
 
 void SCH_EDIT_FRAME::SetSheetNumberAndCount()
 {
-    SCH_SCREEN* screen = GetScreen();
+    SCH_SCREEN* screen;
     SCH_SCREENS s_list;
 
     /* Set the sheet count, and the sheet number (1 for root sheet)
diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp
index d4fb0f2..95005c6 100644
--- a/eeschema/sheet.cpp
+++ b/eeschema/sheet.cpp
@@ -96,7 +96,6 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy )
     }
 
     wxString msg;
-    wxString tmp;
     bool loadFromFile = false;
     SCH_SCREEN* useScreen = NULL;
 
@@ -270,7 +269,6 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy )
 static void resizeSheetWithMouseCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
                                         bool aErase )
 {
-    wxPoint        moveVector;
     BASE_SCREEN*   screen = aPanel->GetScreen();
     SCH_SHEET*     sheet = (SCH_SHEET*) screen->GetCurItem();
 
diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp
index 16812ab..ddcefa9 100644
--- a/eeschema/viewlib_frame.cpp
+++ b/eeschema/viewlib_frame.cpp
@@ -140,11 +140,6 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
     ReCreateHToolbar();
     ReCreateVToolbar();
 
-    wxSize  size = GetClientSize();
-    size.y -= m_MsgFrameHeight + 2;
-
-    wxPoint win_pos( 0, 0 );
-
     if( !aLibrary )
     {
         // Creates the libraries window display
@@ -162,7 +157,6 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
     }
 
     // Creates the component window display
-    win_pos.x = m_libListWidth;
     m_cmpList = new wxListBox( this, ID_LIBVIEW_CMP_LIST,
                                wxPoint( 0, 0 ), wxSize(m_cmpListWidth, -1),
                                0, NULL, wxLB_HSCROLL );
-- 
1.9.1


Follow ups