STYLE: use initializer_list syntax when building system command

This commit is contained in:
Mark Olesen
2017-03-10 10:34:37 +01:00
parent 383fdb04ae
commit 49d0b7552e
3 changed files with 5 additions and 15 deletions

View File

@ -193,12 +193,9 @@ void writeRays
} }
str.flush(); str.flush();
DynamicList<string> cmd(3);
cmd.append("objToVTK");
cmd.append(fName);
cmd.append(fName.lessExt() + ".vtk");
Pout<< "cmd: objToVTK " << fName.c_str() << endl; Pout<< "cmd: objToVTK " << fName.c_str() << endl;
stringList cmd{"objToVTK", fName, fName.lessExt().ext("vtk")};
Foam::system(cmd); Foam::system(cmd);
} }

View File

@ -494,11 +494,7 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const
bool Foam::dynamicCode::wmakeLibso() const bool Foam::dynamicCode::wmakeLibso() const
{ {
DynamicList<string> cmd(4); stringList cmd{"wmake", "-s", "libso", this->codePath()};
cmd.append("wmake");
cmd.append("-s");
cmd.append("libso");
cmd.append(this->codePath());
// NOTE: could also resolve wmake command explicitly // NOTE: could also resolve wmake command explicitly
// cmd[0] = stringOps::expand("$WM_PROJECT_DIR/wmake/wmake"); // cmd[0] = stringOps::expand("$WM_PROJECT_DIR/wmake/wmake");

View File

@ -64,12 +64,9 @@ void Foam::faceShading::writeRays
} }
str.flush(); str.flush();
DynamicList<string> cmd(3);
cmd.append("objToVTK");
cmd.append(fName);
cmd.append(fName.lessExt() + ".vtk");
Pout<< "cmd: objToVTK " << fName.c_str() << endl; Pout<< "cmd: objToVTK " << fName.c_str() << endl;
stringList cmd{"objToVTK", fName, fName.lessExt().ext("vtk")};
Foam::system(cmd); Foam::system(cmd);
} }