Browse Source

Fix some Coverity warnings.

7.0
jean-pierre charras 4 years ago
parent
commit
dbfdd3fb56
  1. 3
      eeschema/tools/sch_line_wire_bus_tool.cpp
  2. 1
      libs/kimath/src/md5_hash.cpp
  3. 5
      pcbnew/footprint_libraries_utils.cpp
  4. 1
      pcbnew/graphics_cleaner.cpp
  5. 2
      pcbnew/import_gfx/graphics_importer_buffer.cpp
  6. 2
      pcbnew/zone_settings.cpp

3
eeschema/tools/sch_line_wire_bus_tool.cpp

@ -1031,11 +1031,12 @@ int SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires( const TOOL_EVENT& aEvent )
for( unsigned ii = 0; ii < aSelection->GetSize(); ii++ ) for( unsigned ii = 0; ii < aSelection->GetSize(); ii++ )
{ {
SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aSelection->GetItem( ii ) ); SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aSelection->GetItem( ii ) );
std::vector<VECTOR2I> pts = item->GetConnectionPoints();
if( !item || !item->IsConnectable() || ( item->Type() == SCH_LINE_T ) ) if( !item || !item->IsConnectable() || ( item->Type() == SCH_LINE_T ) )
continue; continue;
std::vector<VECTOR2I> pts = item->GetConnectionPoints();
/// If the line intersects with an item in the selection at only two points, /// If the line intersects with an item in the selection at only two points,
/// then we can remove the line between the two points. /// then we can remove the line between the two points.
for( SCH_LINE* line : lines ) for( SCH_LINE* line : lines )

1
libs/kimath/src/md5_hash.cpp

@ -214,6 +214,7 @@ void MD5_HASH::md5_transform( MD5_CTX* ctx, uint8_t data[] )
void MD5_HASH::md5_init( MD5_CTX* ctx ) void MD5_HASH::md5_init( MD5_CTX* ctx )
{ {
memset( ctx->data, 64, 0 );
ctx->datalen = 0; ctx->datalen = 0;
ctx->bitlen[0] = 0; ctx->bitlen[0] = 0;
ctx->bitlen[1] = 0; ctx->bitlen[1] = 0;

5
pcbnew/footprint_libraries_utils.cpp

@ -911,10 +911,9 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
return false; return false;
} }
TOOL_MANAGER* pcb_ToolManager = pcbframe ? pcbframe->GetToolManager() : nullptr;
TOOL_MANAGER* pcb_ToolManager = pcbframe->GetToolManager();
if( aAddNew && pcb_ToolManager
&& pcb_ToolManager->GetTool<BOARD_EDITOR_CONTROL>()->PlacingFootprint() )
if( aAddNew && pcb_ToolManager->GetTool<BOARD_EDITOR_CONTROL>()->PlacingFootprint() )
{ {
DisplayError( this, _( "Previous footprint placement still in progress." ) ); DisplayError( this, _( "Previous footprint placement still in progress." ) );
return false; return false;

1
pcbnew/graphics_cleaner.cpp

@ -39,6 +39,7 @@ GRAPHICS_CLEANER::GRAPHICS_CLEANER( DRAWINGS& aDrawings, FOOTPRINT* aParentFootp
m_parentFootprint( aParentFootprint ), m_parentFootprint( aParentFootprint ),
m_commit( aCommit ), m_commit( aCommit ),
m_dryRun( true ), m_dryRun( true ),
m_epsilon( 0 ),
m_itemsList( nullptr ) m_itemsList( nullptr )
{ {
} }

2
pcbnew/import_gfx/graphics_importer_buffer.cpp

@ -207,7 +207,7 @@ void GRAPHICS_IMPORTER_BUFFER::PostprocessNestedPolygons()
} }
} }
POLY_FILL_RULE last_rule = curShapeIdx>= 0 && m_shapeFillRules.size()
POLY_FILL_RULE last_rule = ( m_shapeFillRules.size() && curShapeIdx >= 0 )
? m_shapeFillRules[curShapeIdx] ? m_shapeFillRules[curShapeIdx]
: POLY_FILL_RULE::PF_EVEN_ODD; : POLY_FILL_RULE::PF_EVEN_ODD;

2
pcbnew/zone_settings.cpp

@ -86,6 +86,8 @@ ZONE_SETTINGS::ZONE_SETTINGS()
SetDoNotAllowTracks( true ); SetDoNotAllowTracks( true );
SetDoNotAllowPads( true ); SetDoNotAllowPads( true );
SetDoNotAllowFootprints( false ); SetDoNotAllowFootprints( false );
m_TeardropType = TEARDROP_TYPE::TD_NONE;
} }

Loading…
Cancel
Save