From a9ed8c0a8ff54b1b6127b1a23abcb05f430e8567 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 14 Feb 2019 17:13:56 +0000 Subject: [PATCH] Bugfix: additionaArgs is no longer a reference --- .../utilities/mesh/conversion/star4ToFoam/star4ToFoam.C | 3 +-- .../utilities/surface/surfaceConvert/surfaceConvert.C | 2 +- .../surface/surfaceMeshConvert/surfaceMeshConvert.C | 5 ++--- .../surfaceMeshConvertTesting/surfaceMeshConvertTesting.C | 5 ++--- .../utilities/surface/surfaceMeshExport/surfaceMeshExport.C | 3 +-- .../utilities/surface/surfaceMeshImport/surfaceMeshImport.C | 4 +--- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C index 8bc1ff5ff..28ff125b4 100644 --- a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C +++ b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C @@ -68,7 +68,6 @@ int main(int argc, char *argv[]) argList args(argc, argv); Time runTime(args.rootPath(), args.caseName()); - stringList const& params = args.additionalArgs(); // default rescale from [mm] to [m] scalar scaleFactor = 0.001; @@ -97,7 +96,7 @@ int main(int argc, char *argv[]) IOstream::defaultPrecision(10); // remove extensions and/or trailing '.' - fileName prefix = fileName(params[0]).lessExt(); + fileName prefix = fileName(args.additionalArgs()[0]).lessExt(); meshReaders::STARCD reader(prefix, runTime, scaleFactor); diff --git a/applications/utilities/surface/surfaceConvert/surfaceConvert.C b/applications/utilities/surface/surfaceConvert/surfaceConvert.C index 9a8b18e84..dfbcdef20 100644 --- a/applications/utilities/surface/surfaceConvert/surfaceConvert.C +++ b/applications/utilities/surface/surfaceConvert/surfaceConvert.C @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) argList::validOptions.insert("group", ""); argList args(argc, argv); - const stringList& params = args.additionalArgs(); + const stringList params = args.additionalArgs(); fileName importName(params[0]); fileName exportName(params[1]); diff --git a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C index 1e8937f0c..0ecb29714 100644 --- a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C +++ b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C @@ -81,10 +81,9 @@ int main(int argc, char *argv[]) argList args(argc, argv); Time runTime(args.rootPath(), args.caseName()); - const stringList& params = args.additionalArgs(); - fileName importName(params[0]); - fileName exportName(params[1]); + fileName importName(args.additionalArgs()[0]); + fileName exportName(args.additionalArgs()[1]); // disable inplace editing if (importName == exportName) diff --git a/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C b/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C index 68f729957..34634699b 100644 --- a/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C +++ b/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C @@ -83,13 +83,12 @@ int main(int argc, char *argv[]) argList::validOptions.insert("unsorted", ""); argList::validOptions.insert("triFace", ""); # include "setRootCase.H" - const stringList& params = args.additionalArgs(); scalar scaleFactor = 0; args.optionReadIfPresent("scale", scaleFactor); - fileName importName(params[0]); - fileName exportName(params[1]); + fileName importName(args.additionalArgs()[0]); + fileName exportName(args.additionalArgs()[1]); if (importName == exportName) { diff --git a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C index 3576e5934..075cd9333 100644 --- a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C +++ b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C @@ -85,9 +85,8 @@ int main(int argc, char *argv[]) argList args(argc, argv); Time runTime(args.rootPath(), args.caseName()); - const stringList& params = args.additionalArgs(); - fileName exportName(params[0]); + fileName exportName(args.additionalArgs()[0]); word importName("default"); args.optionReadIfPresent("name", importName); diff --git a/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C b/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C index 2559140c3..3131d79f6 100644 --- a/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C +++ b/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C @@ -86,8 +86,6 @@ int main(int argc, char *argv[]) # include "setRootCase.H" # include "createTime.H" - const stringList& params = args.additionalArgs(); - // try for the latestTime, but create "constant" as needed instantList Times = runTime.times(); if (Times.size()) @@ -101,7 +99,7 @@ int main(int argc, char *argv[]) } - fileName importName(params[0]); + fileName importName(args.additionalArgs()[0]); word exportName("default"); args.optionReadIfPresent("name", exportName);