From 61289ab39a382785ad2ad943559013cc0603cd68 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 5 May 2021 10:49:40 -0700 Subject: [PATCH] Cleanup ngspice calling signatures --- eeschema/sim/ngspice.cpp | 25 ++++++++++++------------- eeschema/sim/ngspice.h | 10 +++++----- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/eeschema/sim/ngspice.cpp b/eeschema/sim/ngspice.cpp index f1e255687f..31e83fa4b3 100644 --- a/eeschema/sim/ngspice.cpp +++ b/eeschema/sim/ngspice.cpp @@ -608,46 +608,45 @@ bool NGSPICE::loadCodemodels( const string& aPath ) } -int NGSPICE::cbSendChar( char* what, int id, void* user ) +int NGSPICE::cbSendChar( char* aWhat, int aId, void* aUser ) { - NGSPICE* sim = reinterpret_cast( user ); + NGSPICE* sim = reinterpret_cast( aUser ); if( sim->m_reporter ) { // strip stdout/stderr from the line - if( ( strncasecmp( what, "stdout ", 7 ) == 0 ) - || ( strncasecmp( what, "stderr ", 7 ) == 0 ) ) - what += 7; + if( ( strncasecmp( aWhat, "stdout ", 7 ) == 0 ) + || ( strncasecmp( aWhat, "stderr ", 7 ) == 0 ) ) + aWhat += 7; - sim->m_reporter->Report( what ); + sim->m_reporter->Report( aWhat ); } return 0; } -int NGSPICE::cbSendStat( char* what, int id, void* user ) +int NGSPICE::cbSendStat( char *aWhat, int aId, void* aUser ) { return 0; } -int NGSPICE::cbBGThreadRunning( NG_BOOL is_running, int id, void* user ) +int NGSPICE::cbBGThreadRunning( NG_BOOL aFinished, int aId, void* aUser ) { - NGSPICE* sim = reinterpret_cast( user ); + NGSPICE* sim = reinterpret_cast( aUser ); if( sim->m_reporter ) - // I know the test below seems like an error, but well, it works somehow.. - sim->m_reporter->OnSimStateChange( sim, is_running ? SIM_IDLE : SIM_RUNNING ); + sim->m_reporter->OnSimStateChange( sim, aFinished ? SIM_IDLE : SIM_RUNNING ); return 0; } -int NGSPICE::cbControlledExit( int status, NG_BOOL immediate, NG_BOOL exit_upon_quit, int id, void* user ) +int NGSPICE::cbControlledExit( int aStatus, NG_BOOL aImmediate, NG_BOOL aExitOnQuit, int aId, void* aUser ) { // Something went wrong, reload the dll - NGSPICE* sim = reinterpret_cast( user ); + NGSPICE* sim = reinterpret_cast( aUser ); sim->m_error = true; return 0; diff --git a/eeschema/sim/ngspice.h b/eeschema/sim/ngspice.h index 9b081d7ea7..947e5ef32e 100644 --- a/eeschema/sim/ngspice.h +++ b/eeschema/sim/ngspice.h @@ -133,11 +133,11 @@ private: bool loadCodemodels( const std::string& aPath ); // Callback functions - static int cbSendChar( char* what, int id, void* user ); - static int cbSendStat( char* what, int id, void* user ); - static int cbBGThreadRunning( NG_BOOL is_running, int id, void* user ); - static int cbControlledExit( int status, NG_BOOL immediate, NG_BOOL exit_upon_quit, int id, - void* user ); + static int cbSendChar( char* what, int aId, void* aUser ); + static int cbSendStat( char* what, int aId, void* aUser ); + static int cbBGThreadRunning( NG_BOOL aFinished, int aId, void* aUser ); + static int cbControlledExit( int aStatus, NG_BOOL aImmediate, NG_BOOL aExitOnQuit, int aId, + void* aUser ); // Assure ngspice is in a valid state and reinitializes it if need be void validate();