Change all bare isnan calls into std::isnan

This commit is contained in:
Sergio Costas 2023-07-13 12:55:58 +00:00 committed by Ian McInerney
parent ae60b57c3d
commit 181ae7f450
4 changed files with 29 additions and 29 deletions

View File

@ -76,7 +76,7 @@ bool IBIS_MATRIX_BANDED::Check()
for( int i = 0; i < m_bandwidth * m_dim; i++ ) for( int i = 0; i < m_bandwidth * m_dim; i++ )
{ {
if( isnan( m_data[i] ) ) if( std::isnan( m_data[i] ) )
{ {
Report( _( "There are NaN elements in a matrix." ), RPT_SEVERITY_ERROR ); Report( _( "There are NaN elements in a matrix." ), RPT_SEVERITY_ERROR );
status = false; status = false;
@ -99,7 +99,7 @@ bool IBIS_MATRIX_FULL::Check()
for( int i = 0; i < m_dim * m_dim; i++ ) for( int i = 0; i < m_dim * m_dim; i++ )
{ {
if( isnan( m_data[i] ) ) if( std::isnan( m_data[i] ) )
{ {
Report( _( "There are NaN elements in a matrix." ), RPT_SEVERITY_ERROR ); Report( _( "There are NaN elements in a matrix." ), RPT_SEVERITY_ERROR );
status = false; status = false;
@ -122,7 +122,7 @@ bool IBIS_MATRIX_SPARSE::Check()
for( int i = 0; i < m_dim * m_dim; i++ ) for( int i = 0; i < m_dim * m_dim; i++ )
{ {
if( isnan( m_data[i] ) ) if( std::isnan( m_data[i] ) )
{ {
Report( _( "There are NaN elements in a matrix." ), RPT_SEVERITY_ERROR ); Report( _( "There are NaN elements in a matrix." ), RPT_SEVERITY_ERROR );
status = false; status = false;
@ -143,11 +143,11 @@ bool TypMinMaxValue::Check()
{ {
bool status = true; bool status = true;
if( isnan( value[IBIS_CORNER::TYP] ) ) if( std::isnan( value[IBIS_CORNER::TYP] ) )
status = false; status = false;
if( isnan( value[IBIS_CORNER::MIN] ) && !isNumberNA( value[IBIS_CORNER::MIN] ) ) if( std::isnan( value[IBIS_CORNER::MIN] ) && !isNumberNA( value[IBIS_CORNER::MIN] ) )
status = false; status = false;
if( isnan( value[IBIS_CORNER::MAX] ) && !isNumberNA( value[IBIS_CORNER::MAX] ) ) if( std::isnan( value[IBIS_CORNER::MAX] ) && !isNumberNA( value[IBIS_CORNER::MAX] ) )
status = false; status = false;
return status; return status;
@ -209,7 +209,7 @@ bool IbisComponentPin::Check()
Report( _( "Model name cannot be empty." ), RPT_SEVERITY_ERROR ); Report( _( "Model name cannot be empty." ), RPT_SEVERITY_ERROR );
status = false; status = false;
} }
if( isnan( m_Rpin ) && !isNumberNA( m_Rpin ) ) if( std::isnan( m_Rpin ) && !isNumberNA( m_Rpin ) )
{ {
if(status ) if(status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );
@ -217,7 +217,7 @@ bool IbisComponentPin::Check()
Report( _( "Rpin is not valid." ), RPT_SEVERITY_ERROR ); Report( _( "Rpin is not valid." ), RPT_SEVERITY_ERROR );
status = false; status = false;
} }
if( isnan( m_Lpin )&& !isNumberNA( m_Lpin ) ) if( std::isnan( m_Lpin )&& !isNumberNA( m_Lpin ) )
{ {
if(status ) if(status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );
@ -225,7 +225,7 @@ bool IbisComponentPin::Check()
Report( _( "Lpin is not valid." ), RPT_SEVERITY_ERROR ); Report( _( "Lpin is not valid." ), RPT_SEVERITY_ERROR );
status = false; status = false;
} }
if( isnan( m_Cpin )&& !isNumberNA( m_Cpin ) ) if( std::isnan( m_Cpin )&& !isNumberNA( m_Cpin ) )
{ {
if(status ) if(status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );
@ -391,7 +391,7 @@ bool IVtable::Check()
bool status = true; bool status = true;
for( IVtableEntry& entry : m_entries ) for( IVtableEntry& entry : m_entries )
{ {
if( isnan( entry.V ) ) if( std::isnan( entry.V ) )
{ {
Report( _( "There is an invalid voltage in an IV table" ), RPT_SEVERITY_ERROR ); Report( _( "There is an invalid voltage in an IV table" ), RPT_SEVERITY_ERROR );
status = false; status = false;
@ -417,20 +417,20 @@ bool dvdtTypMinMax::Check()
{ {
bool status = true; bool status = true;
if( isnan( value[IBIS_CORNER::TYP].m_dv ) ) if( std::isnan( value[IBIS_CORNER::TYP].m_dv ) )
status = false; status = false;
if( isnan( value[IBIS_CORNER::TYP].m_dt ) ) if( std::isnan( value[IBIS_CORNER::TYP].m_dt ) )
status = false; status = false;
if( isnan( value[IBIS_CORNER::MIN].m_dv ) && !isNumberNA( value[IBIS_CORNER::MIN].m_dv ) ) if( std::isnan( value[IBIS_CORNER::MIN].m_dv ) && !isNumberNA( value[IBIS_CORNER::MIN].m_dv ) )
status = false; status = false;
if( isnan( value[IBIS_CORNER::MIN].m_dt ) && !isNumberNA( value[IBIS_CORNER::MIN].m_dt ) ) if( std::isnan( value[IBIS_CORNER::MIN].m_dt ) && !isNumberNA( value[IBIS_CORNER::MIN].m_dt ) )
status = false; status = false;
if( isnan( value[IBIS_CORNER::MIN].m_dv ) && !isNumberNA( value[IBIS_CORNER::MIN].m_dv ) ) if( std::isnan( value[IBIS_CORNER::MIN].m_dv ) && !isNumberNA( value[IBIS_CORNER::MIN].m_dv ) )
status = false; status = false;
if( isnan( value[IBIS_CORNER::MIN].m_dt ) && !isNumberNA( value[IBIS_CORNER::MIN].m_dt ) ) if( std::isnan( value[IBIS_CORNER::MIN].m_dt ) && !isNumberNA( value[IBIS_CORNER::MIN].m_dt ) )
status = false; status = false;
return status; return status;
@ -440,7 +440,7 @@ bool IbisRamp::Check()
{ {
bool status = true; bool status = true;
if( isnan( m_Rload ) ) if( std::isnan( m_Rload ) )
{ {
status = false; status = false;
Report( _( "Invalid R_load." ), RPT_SEVERITY_ERROR ); Report( _( "Invalid R_load." ), RPT_SEVERITY_ERROR );
@ -483,7 +483,7 @@ bool IbisModel::Check()
status = false; status = false;
} }
if( isnan( m_vinh ) && !isNumberNA( m_vinh ) ) if( std::isnan( m_vinh ) && !isNumberNA( m_vinh ) )
{ {
if( status ) if( status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );
@ -491,7 +491,7 @@ bool IbisModel::Check()
Report( _( "Invalid Vinh value." ), RPT_SEVERITY_ERROR ); Report( _( "Invalid Vinh value." ), RPT_SEVERITY_ERROR );
status = false; status = false;
} }
if( isnan( m_vinl ) && !isNumberNA( m_vinl ) ) if( std::isnan( m_vinl ) && !isNumberNA( m_vinl ) )
{ {
if( status ) if( status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );
@ -499,7 +499,7 @@ bool IbisModel::Check()
Report( _( "Invalid Vinl value." ), RPT_SEVERITY_ERROR ); Report( _( "Invalid Vinl value." ), RPT_SEVERITY_ERROR );
status = false; status = false;
} }
if( isnan( m_rref ) && !isNumberNA( m_rref ) ) if( std::isnan( m_rref ) && !isNumberNA( m_rref ) )
{ {
if( status ) if( status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );
@ -507,7 +507,7 @@ bool IbisModel::Check()
Report( _( "Invalid R_ref value." ), RPT_SEVERITY_ERROR ); Report( _( "Invalid R_ref value." ), RPT_SEVERITY_ERROR );
status = false; status = false;
} }
if( isnan( m_cref ) && !isNumberNA( m_cref ) ) if( std::isnan( m_cref ) && !isNumberNA( m_cref ) )
{ {
if( status ) if( status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );
@ -515,7 +515,7 @@ bool IbisModel::Check()
Report( _( "Invalid C_ref value." ), RPT_SEVERITY_ERROR ); Report( _( "Invalid C_ref value." ), RPT_SEVERITY_ERROR );
status = false; status = false;
} }
if( isnan( m_vref ) && !isNumberNA( m_vref ) ) if( std::isnan( m_vref ) && !isNumberNA( m_vref ) )
{ {
if( status ) if( status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );
@ -523,7 +523,7 @@ bool IbisModel::Check()
Report( _( "Invalid V_ref value." ), RPT_SEVERITY_ERROR ); Report( _( "Invalid V_ref value." ), RPT_SEVERITY_ERROR );
status = false; status = false;
} }
if( isnan( m_vmeas ) && !isNumberNA( m_vmeas ) ) if( std::isnan( m_vmeas ) && !isNumberNA( m_vmeas ) )
{ {
if( status ) if( status )
Report( message.str(), RPT_SEVERITY_ACTION ); Report( message.str(), RPT_SEVERITY_ACTION );

View File

@ -180,21 +180,21 @@ KIBIS_PIN::KIBIS_PIN( KIBIS* aTopLevel, IbisComponentPin& aPin, IbisComponentPac
// @TODO : Reading the IBIS standard, I can't figure out if we are supposed // @TODO : Reading the IBIS standard, I can't figure out if we are supposed
// to replace typ, min, and max, or just the typ ? // to replace typ, min, and max, or just the typ ?
if( !isnan( aPin.m_Rpin ) ) if( !std::isnan( aPin.m_Rpin ) )
{ {
m_Rpin.value[IBIS_CORNER::TYP] = aPin.m_Rpin; m_Rpin.value[IBIS_CORNER::TYP] = aPin.m_Rpin;
m_Rpin.value[IBIS_CORNER::MIN] = aPin.m_Rpin; m_Rpin.value[IBIS_CORNER::MIN] = aPin.m_Rpin;
m_Rpin.value[IBIS_CORNER::MAX] = aPin.m_Rpin; m_Rpin.value[IBIS_CORNER::MAX] = aPin.m_Rpin;
} }
if( !isnan( aPin.m_Lpin ) ) if( !std::isnan( aPin.m_Lpin ) )
{ {
m_Lpin.value[IBIS_CORNER::TYP] = aPin.m_Lpin; m_Lpin.value[IBIS_CORNER::TYP] = aPin.m_Lpin;
m_Lpin.value[IBIS_CORNER::MIN] = aPin.m_Lpin; m_Lpin.value[IBIS_CORNER::MIN] = aPin.m_Lpin;
m_Lpin.value[IBIS_CORNER::MAX] = aPin.m_Lpin; m_Lpin.value[IBIS_CORNER::MAX] = aPin.m_Lpin;
} }
if( !isnan( aPin.m_Cpin ) ) if( !std::isnan( aPin.m_Cpin ) )
{ {
m_Cpin.value[IBIS_CORNER::TYP] = aPin.m_Cpin; m_Cpin.value[IBIS_CORNER::TYP] = aPin.m_Cpin;
m_Cpin.value[IBIS_CORNER::MIN] = aPin.m_Cpin; m_Cpin.value[IBIS_CORNER::MIN] = aPin.m_Cpin;

View File

@ -40,7 +40,7 @@ std::string SPICE_GENERATOR_TLINE::ModelLine( const SPICE_ITEM& aItem ) const
double z0 = SIM_VALUE::ToDouble( m_model.FindParam( "z0" )->value ); double z0 = SIM_VALUE::ToDouble( m_model.FindParam( "z0" )->value );
double td = SIM_VALUE::ToDouble( m_model.FindParam( "td" )->value ); double td = SIM_VALUE::ToDouble( m_model.FindParam( "td" )->value );
if( isnan( z0 ) || isnan( td ) ) if( std::isnan( z0 ) || std::isnan( td ) )
return fmt::format( ".model {} LTRA()\n", aItem.modelName ); return fmt::format( ".model {} LTRA()\n", aItem.modelName );
l = fmt::format( "{:g}", td * z0 ); l = fmt::format( "{:g}", td * z0 );

View File

@ -121,7 +121,7 @@ bool SIM_STRING_PROPERTY::OnEvent( wxPropertyGrid* propgrid, wxWindow* wnd_prima
{ {
double value = SIM_VALUE::ToDouble( m_eval.Result().ToStdString() ); double value = SIM_VALUE::ToDouble( m_eval.Result().ToStdString() );
if( isnan( value ) || SIM_VALUE::Equal( value, textEntry->GetValue().ToStdString() ) ) if( std::isnan( value ) || SIM_VALUE::Equal( value, textEntry->GetValue().ToStdString() ) )
{ {
// Don't mess up user formatting if eval'ing didn't actually change the value. // Don't mess up user formatting if eval'ing didn't actually change the value.
} }
@ -195,7 +195,7 @@ bool SIM_STRING_PROPERTY::StringToValue( wxVariant& aVariant, const wxString& aT
{ {
double value = SIM_VALUE::ToDouble( m_eval.Result().ToStdString() ); double value = SIM_VALUE::ToDouble( m_eval.Result().ToStdString() );
if( isnan( value ) || SIM_VALUE::Equal( value, aText.ToStdString() ) ) if( std::isnan( value ) || SIM_VALUE::Equal( value, aText.ToStdString() ) )
{ {
// Don't mess up user formatting if eval'ing didn't actually change the value. // Don't mess up user formatting if eval'ing didn't actually change the value.
} }