Fix Coverity warnings.

This commit is contained in:
jean-pierre charras 2023-03-08 11:37:56 +01:00
parent eb4bf23ba1
commit 6343147bb3
3 changed files with 3 additions and 3 deletions

View File

@ -856,7 +856,7 @@ void SIM_MODEL::SetParamValue( int aParamIndex, const std::string& aValue,
{
std::string value = aValue;
if( aNotation != SIM_VALUE::NOTATION::SI || aValue.find( ',' ) >= 0 )
if( aNotation != SIM_VALUE::NOTATION::SI || aValue.find( ',' ) != std::string::npos )
value = SIM_VALUE::ConvertNotation( value, aNotation, SIM_VALUE::NOTATION::SI );
doSetParamValue( aParamIndex, value );

View File

@ -250,6 +250,7 @@ void SPECCTRA_DB::readTIME( time_t* time_stamp )
Expecting( time_toks );
mytime.tm_year = atoi( CurText() ) - 1900;
mytime.tm_isdst = 0; // useless param here.
*time_stamp = mktime( &mytime );
}

View File

@ -1229,7 +1229,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
if( ! zone->IsOnCopperLayer() )
continue;
// Now, build zone polygon on each copper layer where the zone
// is living (zones can live on many copper layers)
const int copperCount = aBoard->GetCopperLayerCount();
@ -1313,7 +1312,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
cutout = new PATH( window, T_polygon );
window->SetShape( cutout );
cutout->layer_id = m_layerIds[ m_kicadLayer2pcb[ zone->GetLayer() ] ];
cutout->layer_id = m_layerIds[ m_kicadLayer2pcb[ layer ] ];
}
// If the point in this iteration is the last of the contour, the next iteration