From e4d512a2933da0ee5057336756b690ac71ace5b0 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 14 Mar 2018 15:38:53 +0100 Subject: [PATCH] Eagle PCB import: mute uninitialized variable warning In fact radius is not used initialized, as the scope where it is used (while loop) is dependent on the preceding if( w.curve ) clause that initializes 'radius' variable. --- pcbnew/eagle_plugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 7f9d075eff..11c15d6cc4 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -1782,8 +1782,8 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) { wxPoint start( kicad_x( w.x1 ), kicad_y( w.y1 ) ); double angle = 0.0; - double end_angle; - double radius; + double end_angle = 0.0; + double radius = 0.0; wxPoint center; int width = w.width.ToPcbUnits(); @@ -1808,6 +1808,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) while( fabs( angle ) > DEG2RAD( EAGLE_CURVE_DELTA ) ) { + wxASSERT( radius > 0.0 ); wxPoint end( int( radius * cos( end_angle + angle ) + center.x ), int( radius * sin( end_angle + angle ) + center.y ) );