From 60a86853ec7f81293c4a96b9763483f7f0e59778 Mon Sep 17 00:00:00 2001
From: Bernhard Stegmaier <stegmaier@sw-systems.de>
Date: Thu, 5 Jun 2014 12:40:26 +0200
Subject: [PATCH] Removed a few warnings.

---
 common/gal/cairo/cairo_gal.cpp            |  4 ++++
 common/gal/graphics_abstraction_layer.cpp |  4 ++++
 common/view/view.cpp                      |  2 +-
 include/gal/cairo/cairo_gal.h             |  2 +-
 include/gal/graphics_abstraction_layer.h  |  2 +-
 pcbnew/router/direction.h                 | 12 +++++++-----
 pcbnew/router/pns_line.cpp                |  6 +++---
 pcbnew/router/pns_shove.cpp               |  1 -
 pcbnew/router/pns_shove.h                 |  2 --
 pcbnew/router/router_tool.h               |  2 --
 10 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp
index a6f1429721..73ca64294d 100644
--- a/common/gal/cairo/cairo_gal.cpp
+++ b/common/gal/cairo/cairo_gal.cpp
@@ -35,6 +35,10 @@
 
 using namespace KIGFX;
 
+
+const float CAIRO_GAL::LAYER_ALPHA = 0.8;
+
+
 CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
         wxEvtHandler* aPaintListener, const wxString& aName ) :
     wxWindow( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxEXPAND, aName )
diff --git a/common/gal/graphics_abstraction_layer.cpp b/common/gal/graphics_abstraction_layer.cpp
index 6d08461fe0..821df4969f 100644
--- a/common/gal/graphics_abstraction_layer.cpp
+++ b/common/gal/graphics_abstraction_layer.cpp
@@ -31,6 +31,10 @@
 
 using namespace KIGFX;
 
+
+const double GAL::METRIC_UNIT_LENGTH = 1e9;
+
+
 GAL::GAL() :
     strokeFont( this )
 {
diff --git a/common/view/view.cpp b/common/view/view.cpp
index 5e213c0c1d..2d8556a916 100644
--- a/common/view/view.cpp
+++ b/common/view/view.cpp
@@ -893,7 +893,7 @@ void VIEW::updateItemGeometry( VIEW_ITEM* aItem, int aLayer )
     group = m_gal->BeginGroup();
     aItem->setGroup( aLayer, group );
 
-    if( !m_painter->Draw( static_cast<EDA_ITEM*>( aItem ), aLayer ) );
+    if( !m_painter->Draw( static_cast<EDA_ITEM*>( aItem ), aLayer ) )
         aItem->ViewDraw( aLayer, m_gal ); // Alternative drawing method
 
     m_gal->EndGroup();
diff --git a/include/gal/cairo/cairo_gal.h b/include/gal/cairo/cairo_gal.h
index 6b44b1d476..e0b1dba963 100644
--- a/include/gal/cairo/cairo_gal.h
+++ b/include/gal/cairo/cairo_gal.h
@@ -389,7 +389,7 @@ private:
     static const cairo_format_t GAL_FORMAT = CAIRO_FORMAT_RGB24;
 
     ///> Opacity of a single layer
-    static const float LAYER_ALPHA = 0.8;
+    static const float LAYER_ALPHA;
 };
 } // namespace KIGFX
 
diff --git a/include/gal/graphics_abstraction_layer.h b/include/gal/graphics_abstraction_layer.h
index 304634ba2b..d6dccd0d61 100644
--- a/include/gal/graphics_abstraction_layer.h
+++ b/include/gal/graphics_abstraction_layer.h
@@ -820,7 +820,7 @@ public:
     /// Depth level on which the grid is drawn
     static const int GRID_DEPTH = 1024;
 
-    static const double METRIC_UNIT_LENGTH = 1e9;
+    static const double METRIC_UNIT_LENGTH;
 
 protected:
     std::stack<double> depthStack;             ///< Stored depth values
diff --git a/pcbnew/router/direction.h b/pcbnew/router/direction.h
index cd872fccb5..90edd1be56 100644
--- a/pcbnew/router/direction.h
+++ b/pcbnew/router/direction.h
@@ -331,13 +331,15 @@ private:
         if( mag < 0.0 )
             mag += 360.0;
 
-        m_dir = (Directions)( ( mag + 22.5 ) / 45.0 );
+        int dir = ( mag + 22.5 ) / 45.0;
 
-        if( m_dir >= 8 )
-            m_dir = (Directions)( m_dir - 8 );
+        if( dir >= 8 )
+            dir = dir - 8;
 
-        if( m_dir < 0 )
-            m_dir = (Directions)( m_dir + 8 );
+        if( dir < 0 )
+            dir = dir + 8;
+            
+        m_dir = (Directions) dir;
 
         return;
 
diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp
index d7663c4e7d..971851c811 100644
--- a/pcbnew/router/pns_line.cpp
+++ b/pcbnew/router/pns_line.cpp
@@ -626,19 +626,19 @@ void PNS_LINE::DragSegment ( const VECTOR2I& aP, int aIndex, int aSnappingThresh
 
             OPT_VECTOR2I ip;
 
-            if( ip = s1.Intersect( s_next ) )
+            if( (ip = s1.Intersect( s_next )) )
             {
                 np.Append ( s1.A );
                 np.Append ( *ip );
                 np.Append ( s_next.B );
             }
-            else if( ip = s3.Intersect( s_prev ) )
+            else if( (ip = s3.Intersect( s_prev )) )
             {
                 np.Append ( s_prev.A );
                 np.Append ( *ip );
                 np.Append ( s3.B );
             }
-            else if( ip = s1.Intersect( s3 ) )
+            else if( (ip = s1.Intersect( s3 )) )
             {
                 np.Append( s_prev.A );
                 np.Append( *ip );
diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp
index 8b46a503db..ed82b947bf 100644
--- a/pcbnew/router/pns_shove.cpp
+++ b/pcbnew/router/pns_shove.cpp
@@ -560,7 +560,6 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingVia (PNS_ITEM* aCurrent, PNS_VIA*
 {
     int clearance = m_currentNode->GetClearance( aCurrent, aObstacleVia ) ;
     LINE_PAIR_VEC draggedLines;
-    VECTOR2I p0( aObstacleVia->Pos() );
     bool colLine = false, colVia = false;
     PNS_LINE *currentLine = NULL;
     VECTOR2I mtvLine, mtvVia, mtv, mtvSolid;
diff --git a/pcbnew/router/pns_shove.h b/pcbnew/router/pns_shove.h
index 53568ab281..dae355a5f4 100644
--- a/pcbnew/router/pns_shove.h
+++ b/pcbnew/router/pns_shove.h
@@ -126,8 +126,6 @@ private:
 
     PNS_NODE*                   m_root;
     PNS_NODE*                   m_currentNode;
-    PNS_LINE*                   m_currentHead;
-    PNS_LINE*                   m_collidingLine;
     
     OPT_LINE                     m_newHead;
 
diff --git a/pcbnew/router/router_tool.h b/pcbnew/router/router_tool.h
index e2e1119fe3..4ad339f3a5 100644
--- a/pcbnew/router/router_tool.h
+++ b/pcbnew/router/router_tool.h
@@ -77,8 +77,6 @@ private:
     PNS_ITEM* m_endItem;
     VECTOR2I m_endSnapPoint;
 
-    CONTEXT_MENU* m_menu;
-
     ///> Flag marking that the router's world needs syncing.
     bool m_needsSync;
 };