From e623e6a865d55e0dc481bc07bff81321cf162b1c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 22 Feb 2023 18:25:33 +0100 Subject: [PATCH] STYLE: favour include word.H instead of string.H - in many places the string.H include is redundant anyhow. May wish to change to foamString.H (or equiv) in the future --- applications/test/cplusplus1/Test-cpluplus1.C | 1 - applications/test/delete/Test-delete.C | 2 +- applications/test/limits/Test-limits.C | 2 +- applications/test/sizeof/Test-sizeof.C | 1 - applications/test/string/Test-string.C | 11 ++--- applications/test/string2/Test-string2.C | 12 ++--- .../preProcessing/PDR/pdrFields/PDRpatchDef.H | 2 +- .../foamUpgradeCyclics/foamUpgradeCyclics.C | 1 - src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H | 2 +- .../expressions/exprString/exprString.H | 2 +- .../global/profiling/profilingInformation.H | 46 +++++-------------- .../global/profiling/profilingTrigger.H | 2 +- .../ranges/scalarRange/scalarRange.C | 2 +- .../primitives/strings/lists/stringList.H | 6 +-- .../primitives/strings/lists/wordList.H | 4 +- .../strings/parsing/genericRagelLemonDriver.C | 2 +- .../primitives/strings/stringOps/stringOps.H | 3 +- .../strings/stringOps/stringOpsEvaluate.H | 4 +- src/fileFormats/gltf/foamGltfAccessor.H | 2 +- .../vtk/output/foamVtkOutputOptions.H | 2 +- src/meshTools/graph/curve.H | 5 +- src/meshTools/graph/graph.H | 2 - 22 files changed, 42 insertions(+), 74 deletions(-) diff --git a/applications/test/cplusplus1/Test-cpluplus1.C b/applications/test/cplusplus1/Test-cpluplus1.C index 8b86ee33c8..a56c88a4ec 100644 --- a/applications/test/cplusplus1/Test-cpluplus1.C +++ b/applications/test/cplusplus1/Test-cpluplus1.C @@ -28,7 +28,6 @@ Description \*---------------------------------------------------------------------------*/ -#include "string.H" #include "macros.H" #include "IOstreams.H" #include "List.H" diff --git a/applications/test/delete/Test-delete.C b/applications/test/delete/Test-delete.C index 617a007b3f..8c50662407 100644 --- a/applications/test/delete/Test-delete.C +++ b/applications/test/delete/Test-delete.C @@ -29,7 +29,7 @@ Description \*---------------------------------------------------------------------------*/ -#include "string.H" +#include "word.H" #include "IOstreams.H" using namespace Foam; diff --git a/applications/test/limits/Test-limits.C b/applications/test/limits/Test-limits.C index 8e902b1bfc..5d0b64ece4 100644 --- a/applications/test/limits/Test-limits.C +++ b/applications/test/limits/Test-limits.C @@ -32,8 +32,8 @@ Description #include #include "int.H" #include "uint.H" -#include "string.H" #include "scalar.H" +#include "word.H" #include "IOstreams.H" using namespace Foam; diff --git a/applications/test/sizeof/Test-sizeof.C b/applications/test/sizeof/Test-sizeof.C index 13f0aac07a..b6235e2213 100644 --- a/applications/test/sizeof/Test-sizeof.C +++ b/applications/test/sizeof/Test-sizeof.C @@ -31,7 +31,6 @@ Description #include "bool.H" #include "Switch.H" -#include "string.H" #include "dictionary.H" #include "zero.H" #include "IOstreams.H" diff --git a/applications/test/string/Test-string.C b/applications/test/string/Test-string.C index 11648ba523..587eb2e314 100644 --- a/applications/test/string/Test-string.C +++ b/applications/test/string/Test-string.C @@ -29,12 +29,7 @@ Description \*---------------------------------------------------------------------------*/ -#include "string.H" -#include "stringOps.H" -#include "dictionary.H" -#include "IOstreams.H" -#include "OSspecific.H" - +#include "fieldExprFwd.H" #include "int.H" #include "uint.H" #include "scalar.H" @@ -42,6 +37,10 @@ Description #include "fileName.H" #include "stringList.H" #include "stringOps.H" +#include "dictionary.H" +#include "IOstreams.H" +#include "OSspecific.H" + using namespace Foam; diff --git a/applications/test/string2/Test-string2.C b/applications/test/string2/Test-string2.C index 9186bda26f..210b0ce5d4 100644 --- a/applications/test/string2/Test-string2.C +++ b/applications/test/string2/Test-string2.C @@ -28,12 +28,7 @@ Description \*---------------------------------------------------------------------------*/ -#include "string.H" -#include "stringOps.H" -#include "dictionary.H" -#include "IOstreams.H" -#include "OSspecific.H" - +#include "fieldExprFwd.H" #include "int.H" #include "uint.H" #include "scalar.H" @@ -41,7 +36,10 @@ Description #include "fileName.H" #include "stringList.H" #include "stringOps.H" -#include "fieldExprFwd.H" +#include "dictionary.H" +#include "IOstreams.H" +#include "OSspecific.H" + using namespace Foam; diff --git a/applications/utilities/preProcessing/PDR/pdrFields/PDRpatchDef.H b/applications/utilities/preProcessing/PDR/pdrFields/PDRpatchDef.H index 076786cd18..2a18487b03 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/PDRpatchDef.H +++ b/applications/utilities/preProcessing/PDR/pdrFields/PDRpatchDef.H @@ -38,7 +38,7 @@ SourceFiles #ifndef PDRpatchDef_H #define PDRpatchDef_H -#include "string.H" +#include "word.H" #include "scalar.H" #include "Enum.H" diff --git a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C index 329bc82de4..f4fd3589a3 100644 --- a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C +++ b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C @@ -58,7 +58,6 @@ Usage #include "volFields.H" #include "pointFields.H" #include "surfaceFields.H" -#include "string.H" using namespace Foam; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H index a51d68d33d..14ec039aa1 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H @@ -40,10 +40,10 @@ SourceFiles #ifndef Foam_UPstream_H #define Foam_UPstream_H +#include "wordList.H" #include "labelList.H" #include "DynamicList.H" #include "HashTable.H" -#include "string.H" #include "Enum.H" #include "ListOps.H" diff --git a/src/OpenFOAM/expressions/exprString/exprString.H b/src/OpenFOAM/expressions/exprString/exprString.H index 49957be0e2..34e114dbb2 100644 --- a/src/OpenFOAM/expressions/exprString/exprString.H +++ b/src/OpenFOAM/expressions/exprString/exprString.H @@ -43,7 +43,7 @@ SeeAlso #ifndef Foam_expressions_exprString_H #define Foam_expressions_exprString_H -#include "string.H" +#include "word.H" #include "dictionary.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/profiling/profilingInformation.H b/src/OpenFOAM/global/profiling/profilingInformation.H index 578e5fb1d0..deab20270d 100644 --- a/src/OpenFOAM/global/profiling/profilingInformation.H +++ b/src/OpenFOAM/global/profiling/profilingInformation.H @@ -38,9 +38,9 @@ SourceFiles #ifndef Foam_profilingInformation_H #define Foam_profilingInformation_H -#include "label.H" -#include "scalar.H" -#include "string.H" +#include "labelFwd.H" +#include "scalarFwd.H" +#include "word.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -130,45 +130,21 @@ public: // Access - label id() const - { - return id_; - } + label id() const noexcept { return id_; } - const string& description() const - { - return description_; - } + const string& description() const noexcept { return description_; } - profilingInformation& parent() const - { - return *parent_; - } + profilingInformation& parent() const noexcept { return *parent_; } - label calls() const - { - return calls_; - } + label calls() const noexcept { return calls_; } - scalar totalTime() const - { - return totalTime_; - } + scalar totalTime() const noexcept { return totalTime_; } - scalar childTime() const - { - return childTime_; - } + scalar childTime() const noexcept { return childTime_; } - int maxMem() const - { - return maxMem_; - } + int maxMem() const noexcept { return maxMem_; } - bool active() const - { - return active_; - } + bool active() const noexcept { return active_; } // Edit diff --git a/src/OpenFOAM/global/profiling/profilingTrigger.H b/src/OpenFOAM/global/profiling/profilingTrigger.H index 236122d29b..639c6eac70 100644 --- a/src/OpenFOAM/global/profiling/profilingTrigger.H +++ b/src/OpenFOAM/global/profiling/profilingTrigger.H @@ -38,7 +38,7 @@ SourceFiles #ifndef Foam_profilingTrigger_H #define Foam_profilingTrigger_H -#include "string.H" +#include "word.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.C b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.C index 07cd44a800..4ae5af193a 100644 --- a/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.C +++ b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.C @@ -26,10 +26,10 @@ License \*---------------------------------------------------------------------------*/ #include "scalarRange.H" -#include "string.H" #include "Switch.H" #include "MinMax.H" #include "error.H" +#include "word.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/strings/lists/stringList.H b/src/OpenFOAM/primitives/strings/lists/stringList.H index c434f97bbf..0e7f3615c2 100644 --- a/src/OpenFOAM/primitives/strings/lists/stringList.H +++ b/src/OpenFOAM/primitives/strings/lists/stringList.H @@ -43,10 +43,10 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef stringList_H -#define stringList_H +#ifndef Foam_stringList_H +#define Foam_stringList_H -#include "string.H" +#include "word.H" #include "List.H" #include "SubList.H" diff --git a/src/OpenFOAM/primitives/strings/lists/wordList.H b/src/OpenFOAM/primitives/strings/lists/wordList.H index 739ea57578..747260e55a 100644 --- a/src/OpenFOAM/primitives/strings/lists/wordList.H +++ b/src/OpenFOAM/primitives/strings/lists/wordList.H @@ -43,8 +43,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef wordList_H -#define wordList_H +#ifndef Foam_wordList_H +#define Foam_wordList_H #include "word.H" #include "List.H" diff --git a/src/OpenFOAM/primitives/strings/parsing/genericRagelLemonDriver.C b/src/OpenFOAM/primitives/strings/parsing/genericRagelLemonDriver.C index fb858e0bc5..bf085bb8b8 100644 --- a/src/OpenFOAM/primitives/strings/parsing/genericRagelLemonDriver.C +++ b/src/OpenFOAM/primitives/strings/parsing/genericRagelLemonDriver.C @@ -26,8 +26,8 @@ License \*---------------------------------------------------------------------------*/ #include "genericRagelLemonDriver.H" -#include "string.H" #include "error.H" +#include "word.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H index 14f9c743ce..28fb6fb4d2 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H @@ -40,13 +40,12 @@ SourceFiles #define Foam_stringOps_H #include "scalar.H" -#include "string.H" #include "SubStrings.H" -#include "word.H" #include "dictionary.H" #include "HashTable.H" #include "stringOpsSort.H" #include "stringOpsEvaluate.H" +#include "word.H" #include "wordRes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOpsEvaluate.H b/src/OpenFOAM/primitives/strings/stringOps/stringOpsEvaluate.H index 2f87bae83a..b167767af6 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOpsEvaluate.H +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOpsEvaluate.H @@ -31,8 +31,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef stringOpsEvaluate_H -#define stringOpsEvaluate_H +#ifndef Foam_stringOpsEvaluate_H +#define Foam_stringOpsEvaluate_H #include "labelFwd.H" #include "string.H" diff --git a/src/fileFormats/gltf/foamGltfAccessor.H b/src/fileFormats/gltf/foamGltfAccessor.H index 76244c4586..66dbcf309c 100644 --- a/src/fileFormats/gltf/foamGltfAccessor.H +++ b/src/fileFormats/gltf/foamGltfAccessor.H @@ -44,7 +44,7 @@ SourceFiles #include "foamGltfBase.H" #include "Field.H" #include "label.H" -#include "string.H" +#include "word.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/fileFormats/vtk/output/foamVtkOutputOptions.H b/src/fileFormats/vtk/output/foamVtkOutputOptions.H index 3fcc23d6eb..e9943c389a 100644 --- a/src/fileFormats/vtk/output/foamVtkOutputOptions.H +++ b/src/fileFormats/vtk/output/foamVtkOutputOptions.H @@ -44,7 +44,7 @@ SourceFiles #define Foam_vtk_outputOptions_H #include "foamVtkOutput.H" -#include "string.H" +#include "word.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/graph/curve.H b/src/meshTools/graph/curve.H index 6d8940a24b..d50f01a42f 100644 --- a/src/meshTools/graph/curve.H +++ b/src/meshTools/graph/curve.H @@ -37,9 +37,10 @@ SourceFiles #ifndef Foam_curve_H #define Foam_curve_H -#include "string.H" -#include "primitiveFields.H" #include "autoPtr.H" +#include "point.H" +#include "primitiveFields.H" +#include "word.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/graph/graph.H b/src/meshTools/graph/graph.H index 839fbe1923..95f1e9addb 100644 --- a/src/meshTools/graph/graph.H +++ b/src/meshTools/graph/graph.H @@ -38,8 +38,6 @@ SourceFiles #ifndef Foam_graph_H #define Foam_graph_H -#include "string.H" -#include "point.H" #include "curve.H" #include "HashPtrTable.H"