Formatting.

This commit is contained in:
Jeff Young 2022-12-05 19:59:10 +00:00
parent e861606871
commit 7e1fecaf2e
2 changed files with 9 additions and 11 deletions

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2016-2018 CERN * Copyright (C) 2016-2022 CERN
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
* *
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch> * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
@ -277,9 +277,9 @@ bool NGSPICE::Attach( const std::shared_ptr<SIMULATION_MODEL>& aModel, REPORTER&
bool NGSPICE::LoadNetlist( const string& aNetlist ) bool NGSPICE::LoadNetlist( const string& aNetlist )
{ {
LOCALE_IO c_locale; // ngspice works correctly only with C locale LOCALE_IO c_locale; // ngspice works correctly only with C locale
vector<char*> lines; vector<char*> lines;
stringstream ss( aNetlist ); stringstream ss( aNetlist );
m_netlist = ""; m_netlist = "";
@ -296,7 +296,7 @@ bool NGSPICE::LoadNetlist( const string& aNetlist )
Command( "remcirc" ); Command( "remcirc" );
bool success = !m_ngSpice_Circ( lines.data() ); bool success = !m_ngSpice_Circ( lines.data() );
for( auto line : lines ) for( char* line : lines )
free( line ); free( line );
return success; return success;

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2016 CERN * Copyright (C) 2016-2022 CERN
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
* *
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch> * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
@ -155,14 +155,12 @@ private:
// Assure ngspice is in a valid state and reinitializes it if need be. // Assure ngspice is in a valid state and reinitializes it if need be.
void validate(); void validate();
///< Error flag indicating that ngspice needs to be reloaded. private:
bool m_error; bool m_error; ///< Error flag indicating that ngspice needs to be reloaded.
///< Ngspice should be initialized only once. static bool m_initialized; ///< Ngspice should be initialized only once.
static bool m_initialized;
///< Current netlist std::string m_netlist; ///< Current netlist
std::string m_netlist;
}; };
#endif /* NGSPICE_H */ #endif /* NGSPICE_H */