fix a few Coverity warnings.

This commit is contained in:
jean-pierre charras 2017-08-06 13:31:25 +02:00
parent 4e96f9990d
commit b8c621a991
7 changed files with 7 additions and 9 deletions

View File

@ -288,6 +288,8 @@ PGM_BASE::PGM_BASE()
m_pgm_checker = NULL;
m_locale = NULL;
m_common_settings = NULL;
m_iconsScale = 1.0;
m_useIconsInMenus = true; // will be set later after reading the config
m_show_env_var_dialog = true;

View File

@ -72,11 +72,7 @@ private:
{
std::size_t operator()( const SEG& a ) const
{
std::size_t seed = 0;
return a.A.x + a.B.x + a.A.y + a.B.y;
return seed;
}
};

View File

@ -448,7 +448,7 @@ VECTOR2<T> VECTOR2<T>::operator-()
template <class T>
typename VECTOR2<T>::extended_type VECTOR2<T>::operator*( const VECTOR2<T>& aVector ) const
{
return aVector.x * x + aVector.y * y;
return (extended_type)aVector.x * x + (extended_type)aVector.y * y;
}

View File

@ -39,6 +39,7 @@
BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED_ITEM )
{
m_localRatsnestVisible = false;
}

View File

@ -387,7 +387,6 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC,
return;
PCB_LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
BOARD* brd = GetBoard();
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );

View File

@ -244,14 +244,13 @@ static int BuildCornersList_S_Shape( std::vector <wxPoint>& aBuffer,
centre = pt;
centre.y += radius;
gen_arc( aBuffer, pt, centre, 900 * sign );
aBuffer.back();
// Rotate point
angle += 900;
for( unsigned jj = 0; jj < aBuffer.size(); jj++ )
{
RotatePoint( &aBuffer[jj].x, &aBuffer[jj].y, aStartPoint.x, aStartPoint.y, angle );
RotatePoint( &aBuffer[jj], aStartPoint, angle );
}
// push last point (end point)

View File

@ -59,6 +59,7 @@ POSITION_RELATIVE_TOOL::POSITION_RELATIVE_TOOL() :
PCB_TOOL( "pcbnew.PositionRelative" ), m_position_relative_dialog( NULL ),
m_selectionTool( NULL ), m_anchor_item( NULL )
{
m_position_relative_rotation = 0.0;
}