Browse Source

fix a few Coverity warnings.

pull/7/merge
jean-pierre charras 8 years ago
parent
commit
b8c621a991
  1. 2
      common/pgm_base.cpp
  2. 4
      include/geometry/poly_grid_partition.h
  3. 2
      include/math/vector2d.h
  4. 3
      pcbnew/class_board_connected_item.cpp
  5. 1
      pcbnew/class_zone.cpp
  6. 3
      pcbnew/microwave/microwave_inductor.cpp
  7. 1
      pcbnew/tools/position_relative_tool.cpp

2
common/pgm_base.cpp

@ -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;

4
include/geometry/poly_grid_partition.h

@ -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;
}
};

2
include/math/vector2d.h

@ -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;
}

3
pcbnew/class_board_connected_item.cpp

@ -37,8 +37,9 @@
#include <connectivity.h>
BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED_ITEM )
BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED_ITEM )
{
m_localRatsnestVisible = false;
}

1
pcbnew/class_zone.cpp

@ -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 );

3
pcbnew/microwave/microwave_inductor.cpp

@ -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)

1
pcbnew/tools/position_relative_tool.cpp

@ -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;
}

Loading…
Cancel
Save