fix MANDATORY_FIELDS comparisons (need to exclude -1)

This commit is contained in:
Julius Schmidt 2017-11-07 09:18:08 +00:00 committed by Maciej Suminski
parent 8b2b1381c4
commit 375a4e28d6
4 changed files with 4 additions and 4 deletions

View File

@ -1099,7 +1099,7 @@ bool LIB_PART::LoadField( LINE_READER& aLineReader, wxString& aErrorMsg )
return false;
}
if( field->GetId() < MANDATORY_FIELDS )
if( (unsigned) field->GetId() < MANDATORY_FIELDS )
{
LIB_FIELD* fixedField = GetField( field->GetId() );

View File

@ -264,7 +264,7 @@ bool LIB_FIELD::Load( LINE_READER& aLineReader, wxString& errorMsg )
}
// fields in RAM must always have names.
if( m_id < MANDATORY_FIELDS )
if( (unsigned) m_id < MANDATORY_FIELDS )
{
// Fields in RAM must always have names, because we are trying to get
// less dependent on field ids and more dependent on names.

View File

@ -895,7 +895,7 @@ void SCH_COMPONENT::UpdateFields( bool aResetStyle, bool aResetRef )
if( idx == REFERENCE && !aResetRef )
continue;
if( idx < MANDATORY_FIELDS )
if( (unsigned) idx < MANDATORY_FIELDS )
schField = GetField( idx );
else
schField = FindField( field.GetName() );

View File

@ -2747,7 +2747,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr< LIB_PART >& aPart,
}
// Fields in RAM must always have names.
if( id < MANDATORY_FIELDS )
if( (unsigned) id < MANDATORY_FIELDS )
{
// Fields in RAM must always have names, because we are trying to get
// less dependent on field ids and more dependent on names.