Skip to content

Commit

Permalink
const char* and nullptr for C++ FV solver
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jun 2, 2024
1 parent 3c1431c commit 0dbfb49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions VCell/include/VCELL/FVSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Membrane;

class FVSolver {
public:
FVSolver(istream& fvinput, int taskID=-1, char* outdir=0, bool bSimZip=true);
FVSolver(istream& fvinput, int taskID=-1, const char* outdir=0, bool bSimZip=true);
virtual ~FVSolver();

void createSimTool(istream& ifsInput, int taskID);
Expand Down Expand Up @@ -64,7 +64,7 @@ class FVSolver {
void loadSerialScanParameters(istream& ifsInput, int numSerialScanParameters);
void loadSerialScanParameterValues(istream& ifsInput, int numSerialScanParamValues);

char* outputPath;
const char* outputPath;
SimTool* simTool;
SimulationExpression *simulation;
VCellModel *model;
Expand Down
2 changes: 1 addition & 1 deletion VCell/src/FVSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ void FVSolver::loadSmoldyn(istream& ifsInput) {
}
}

FVSolver::FVSolver(istream& fvinput, int taskID, char* outdir, bool bSimZip) {
FVSolver::FVSolver(istream& fvinput, int taskID, const char* outdir, bool bSimZip) {
simTool = 0;
simulation = 0;
model = 0;
Expand Down
8 changes: 4 additions & 4 deletions VCellMessaging/src/SimulationMessaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static const double WORKEREVENT_MESSAGE_MIN_TIME_SECONDS = 15.0;

#endif

SimulationMessaging *SimulationMessaging::m_inst = NULL;
SimulationMessaging *SimulationMessaging::m_inst = nullptr;

SimulationMessaging::SimulationMessaging(){
this->bStopRequested = false;
Expand Down Expand Up @@ -142,7 +142,7 @@ SimulationMessaging* SimulationMessaging::getInstVar() {

SimulationMessaging* SimulationMessaging::create()
{
if (m_inst == 0){
if (m_inst == nullptr){
m_inst = new SimulationMessaging();
}
return(m_inst);
Expand Down Expand Up @@ -333,7 +333,7 @@ void SimulationMessaging::sendStatus() {
}

void SimulationMessaging::setWorkerEvent(WorkerEvent* arg_workerEvent) {
if (m_inst == 0) {
if (m_inst == nullptr) {
throw "SimulationMessaging is not initialized";
}
if (workerEventOutputMode == WORKEREVENT_OUTPUT_MODE_STDOUT) {
Expand Down Expand Up @@ -449,7 +449,7 @@ bool SimulationMessaging::lockWorkerEvent(bool bTry)
return true;
#else // UNIX
if (bTry) {
return (pthread_mutex_trylock(&mutex_workerEvent) == 0);
return (pthread_mutex_trylock(&mutex_workerEvent) == nullptr);
}
if (pthread_mutex_lock(&mutex_workerEvent) != 0) {
return false;
Expand Down

0 comments on commit 0dbfb49

Please sign in to comment.