Fix a few coverity warnings.

This commit is contained in:
jean-pierre charras 2015-06-15 16:01:43 +02:00
parent 6d07e9a754
commit 49fac351ab
5 changed files with 20 additions and 9 deletions

View File

@ -515,11 +515,12 @@ bool SHAPE_POLY_SET::Parse( std::stringstream& aStream )
aStream >> tmp;
unsigned int n_polys = atoi( tmp.c_str() );
if(n_polys < 0)
int n_polys = atoi( tmp.c_str() );
if( n_polys < 0 )
return false;
for( unsigned i = 0; i < n_polys; i++ )
for( int i = 0; i < n_polys; i++ )
{
ClipperLib::Paths paths;
@ -528,17 +529,18 @@ bool SHAPE_POLY_SET::Parse( std::stringstream& aStream )
return false;
aStream >> tmp;
unsigned int n_outlines = atoi( tmp.c_str() );
if(n_outlines < 0)
int n_outlines = atoi( tmp.c_str() );
if( n_outlines < 0 )
return false;
for( unsigned j = 0; j < n_outlines; j++)
for( int j = 0; j < n_outlines; j++ )
{
ClipperLib::Path outline;
aStream >> tmp;
unsigned int n_vertices = atoi( tmp.c_str() );
for( unsigned v = 0; v < n_vertices; v++)
int n_vertices = atoi( tmp.c_str() );
for( int v = 0; v < n_vertices; v++ )
{
ClipperLib::IntPoint p;

View File

@ -526,6 +526,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Group::Add( Pin* aPin )
case 1:
m_Members.front()->SetGroup( this );
break;
default:
aPin->SetGroup( this );

View File

@ -51,6 +51,8 @@ SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos, char
if( shape == '/' )
m_size.y = -100;
m_isDanglingStart = m_isDanglingEnd = true;
}
SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY( const wxPoint& pos, char shape ) :

View File

@ -66,8 +66,11 @@ PNS_DP_PRIMITIVE_PAIR::PNS_DP_PRIMITIVE_PAIR( const VECTOR2I& aAnchorP, const VE
PNS_DP_PRIMITIVE_PAIR::PNS_DP_PRIMITIVE_PAIR( const PNS_DP_PRIMITIVE_PAIR& aOther )
{
m_primP = m_primN = NULL;
if( aOther.m_primP )
m_primP = aOther.m_primP->Clone();
if( aOther.m_primN )
m_primN = aOther.m_primN->Clone();

View File

@ -94,7 +94,10 @@ PNS_PCBNEW_CLEARANCE_FUNC::PNS_PCBNEW_CLEARANCE_FUNC( PNS_ROUTER *aRouter ) :
}
m_overrideEnabled = false;
m_defaultClearance = 254000; // aBoard->m_NetClasses.Find ("Default clearance")->GetClearance();
m_defaultClearance = Millimeter2iu( 0.254 ); // aBoard->m_NetClasses.Find ("Default clearance")->GetClearance();
m_overrideNetA = 0;
m_overrideNetB = 0;
m_overrideClearance = 0;
}