From 4e1bc2d2f1bf6d524328d808798fade7203fbaf9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 14 Feb 2020 11:01:54 +0100 Subject: [PATCH] COMP: incorrect placement of compiler attributes --- applications/test/NamedEnum/Make/files | 3 + applications/test/NamedEnum/Make/options | 2 + applications/test/NamedEnum/Test-NamedEnum.C | 82 +++++++++++++++++++ .../linkTypes/DLListBase/DLListBase.H | 6 +- .../linkTypes/SLListBase/SLListBase.H | 6 +- .../containers/Lists/ListOps/ListOps.H | 5 +- src/OpenFOAM/db/dictionary/dictionary.H | 44 ++++------ .../dimensionedType/dimensionedType.H | 14 ++-- .../GeometricField/GeometricField.H | 5 +- src/OpenFOAM/global/argList/argList.H | 38 ++++----- src/OpenFOAM/include/stdFoam.H | 4 +- src/OpenFOAM/matrices/Matrix/Matrix.H | 24 +++--- .../surface/geometricSurfacePatch.H | 7 +- src/OpenFOAM/meshes/meshShapes/face/face.H | 6 +- .../meshes/meshShapes/triFace/triFace.H | 6 +- .../primitiveShapes/triangle/triangle.H | 6 +- src/OpenFOAM/primitives/enums/Enum.H | 6 +- src/OpenFOAM/primitives/enums/NamedEnum.H | 8 +- .../primitives/strings/lists/hashedWordList.H | 4 +- src/surfMesh/surfZone/surfZone.H | 4 +- .../triSurface/patches/surfacePatch.H | 7 +- 21 files changed, 188 insertions(+), 99 deletions(-) create mode 100644 applications/test/NamedEnum/Make/files create mode 100644 applications/test/NamedEnum/Make/options create mode 100644 applications/test/NamedEnum/Test-NamedEnum.C diff --git a/applications/test/NamedEnum/Make/files b/applications/test/NamedEnum/Make/files new file mode 100644 index 0000000000..a1a7086041 --- /dev/null +++ b/applications/test/NamedEnum/Make/files @@ -0,0 +1,3 @@ +Test-NamedEnum.C + +EXE = $(FOAM_USER_APPBIN)/Test-NamedEnum diff --git a/applications/test/NamedEnum/Make/options b/applications/test/NamedEnum/Make/options new file mode 100644 index 0000000000..18e6fe47af --- /dev/null +++ b/applications/test/NamedEnum/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = */ +/* EXE_LIBS = */ diff --git a/applications/test/NamedEnum/Test-NamedEnum.C b/applications/test/NamedEnum/Test-NamedEnum.C new file mode 100644 index 0000000000..babcb8facb --- /dev/null +++ b/applications/test/NamedEnum/Test-NamedEnum.C @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2020 OpenCFD Ltd. +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Description + Testing of NamedEnum. + The class is deprecated, but we may still need to support it for things + like swak4Foam etc. + +\*---------------------------------------------------------------------------*/ + +#include "NamedEnum.H" +#include "FlatOutput.H" + +// Expect compile-time warnings + +using namespace Foam; + +struct testing +{ + enum class option { A, B, C, D }; + + static const Foam::NamedEnum option1Names; +}; + + +// All names - we have no choice with NamedEnum +template<> +const char* Foam::NamedEnum::names[] = +{ + "a", + "b", + "c", + "d" +}; + + +const Foam::NamedEnum testing::option1Names; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + Info<< "Enum 1" << nl + << " names: " << testing::option1Names << nl + << " values: " << flatOutput(testing::option1Names.values()) + << nl << nl; + + Info<< nl + << int(testing::option1Names["a"]) << nl + << testing::option1Names[testing::option::A] << nl; + + Info<< "\nEnd\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H index 54f6a6276c..fbca1f29a8 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H @@ -243,7 +243,8 @@ public: //- Deprecated(2019-01) Pointing at a valid storage node // \deprecated(2019-01) - use good() method - bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const + FOAM_DEPRECATED_FOR(2019-01, "good() method") + bool found() const { return this->good(); } @@ -296,7 +297,8 @@ public: //- Deprecated(2019-01) Pointing at a valid storage node // \deprecated(2019-01) - use good() method - bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const + FOAM_DEPRECATED_FOR(2019-01, "good() method") + bool found() const { return this->good(); } diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H index 53e2b16da6..85d4c99f02 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H @@ -219,7 +219,8 @@ public: //- Deprecated(2019-01) Pointing at a valid storage node // \deprecated(2019-01) - use good() method - bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const + FOAM_DEPRECATED_FOR(2019-01, "good() method") + bool found() const { return this->good(); } @@ -271,7 +272,8 @@ public: //- Deprecated(2019-01) Pointing at a valid storage node // \deprecated(2019-01) - use good() method - bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const + FOAM_DEPRECATED_FOR(2019-01, "good() method") + bool found() const { return this->good(); } diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H index 4060e090c1..192c5c6213 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -401,7 +401,8 @@ List invertManyToMany // \return The index found or return -1 if not found. // \deprecated(2017-10) - use the UList find/found methods template -label FOAM_DEPRECATED(2017-10) findIndex +FOAM_DEPRECATED_FOR(2017-10, "UList find/found methods") +label findIndex ( const ListType& input, typename ListType::const_reference val, diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 9f201e701f..e102648c89 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -1288,8 +1288,8 @@ public: //- Deprecated(2018-07) find and return an entry data stream // // \deprecated(2018-07) - use lookup() method - ITstream& FOAM_DEPRECATED_FOR(2018-07, "lookup() method") - operator[](const word& keyword) const + FOAM_DEPRECATED_FOR(2018-07, "lookup() method") + ITstream& operator[](const word& keyword) const { return lookup(keyword); } @@ -1297,8 +1297,8 @@ public: //- Deprecated(2018-10) find and return a T. // \deprecated(2018-10) - use get() method template - T FOAM_DEPRECATED_FOR(2018-10, "get() method") - lookupType + FOAM_DEPRECATED_FOR(2018-10, "get() method") + T lookupType ( const word& keyword, bool recursive = false, @@ -1310,8 +1310,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - bool FOAM_DEPRECATED_FOR(2018-10, "found(keyType::option)") - found + FOAM_DEPRECATED_FOR(2018-10, "found(keyType::option)") + bool found ( const word& keyword, bool recursive, @@ -1323,9 +1323,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - entry* FOAM_DEPRECATED_FOR(2018-10, "findEntry(keyType::option)") - lookupEntryPtr + entry* lookupEntryPtr ( const word& keyword, bool recursive, @@ -1337,9 +1336,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - const entry* FOAM_DEPRECATED_FOR(2018-10, "findEntry(keyType::option)") - lookupEntryPtr + const entry* lookupEntryPtr ( const word& keyword, bool recursive, @@ -1351,9 +1349,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - const entry* FOAM_DEPRECATED_FOR(2018-10, "findScoped(keyType::option)") - lookupScopedEntryPtr + const entry* lookupScopedEntryPtr ( const word& keyword, bool recursive, @@ -1369,9 +1366,8 @@ public: // // Search type: non-recursive with patterns. // \deprecated(2018-10) - use findDict() method - const dictionary* FOAM_DEPRECATED_FOR(2018-10, "findDict() method") - subDictPtr(const word& keyword) const + const dictionary* subDictPtr(const word& keyword) const { return findDict(keyword, keyType::REGEX); } @@ -1382,18 +1378,16 @@ public: // // Search type: non-recursive with patterns. // \deprecated(2018-10) - use findDict() method - dictionary* FOAM_DEPRECATED_FOR(2018-10, "findDict() method") - subDictPtr(const word& keyword) + dictionary* subDictPtr(const word& keyword) { return findDict(keyword, keyType::REGEX); } //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - const entry& FOAM_DEPRECATED_FOR(2018-10, "lookupEntry(keyType::option)") - lookupEntry + const entry& lookupEntry ( const word& keyword, bool recursive, @@ -1405,9 +1399,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - ITstream& FOAM_DEPRECATED_FOR(2018-10, "lookup(keyType::option)") - lookup + ITstream& lookup ( const word& keyword, bool recursive, @@ -1420,8 +1413,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version template - T FOAM_DEPRECATED_FOR(2018-10, "lookupOrDefault(keyType::option)") - lookupOrDefault + FOAM_DEPRECATED_FOR(2018-10, "lookupOrDefault(keyType::option)") + T lookupOrDefault ( const word& keyword, const T& deflt, @@ -1437,8 +1430,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version template - T FOAM_DEPRECATED_FOR(2018-10, "lookupOrAddDefault(keyType::option)") - lookupOrAddDefault + FOAM_DEPRECATED_FOR(2018-10, "lookupOrAddDefault(keyType::option)") + T lookupOrAddDefault ( const word& keyword, const T& deflt, @@ -1454,9 +1447,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version template - bool FOAM_DEPRECATED_FOR(2018-10, "readIfPresent(keyType::option)") - readIfPresent + bool readIfPresent ( const word& keyword, T& val, diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H index 823c255723..cfab0f339e 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -371,16 +371,16 @@ public: // \deprecated(2018-11) - should generally use construct from // dictionary or primitiveEntry instead // (additional checks on the input stream). - explicit dimensioned(Istream& is) - FOAM_DEPRECATED(2018-11); + FOAM_DEPRECATED(2018-11) + explicit dimensioned(Istream& is); //- Deprecated(2018-11) Construct from Istream with given name //- (expects dimensions, value) // \deprecated(2018-11) - should generally use construct from // dictionary or primitiveEntry instead // (additional checks on the input stream). - dimensioned(const word& name, Istream& is) - FOAM_DEPRECATED(2018-11); + FOAM_DEPRECATED(2018-11) + dimensioned(const word& name, Istream& is); //- Deprecated(2018-11) Construct from Istream with given name //- and expected dimensions. @@ -390,8 +390,8 @@ public: // \deprecated(2018-11) - should generally use construct from // dictionary or primitiveEntry instead // (additional checks on the input stream). - dimensioned(const word& name, const dimensionSet& dims, Istream& is) - FOAM_DEPRECATED(2018-11); + FOAM_DEPRECATED(2018-11) + dimensioned(const word& name, const dimensionSet& dims, Istream& is); //- Construct dimensioned from dictionary, with default value. diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index 21891cbc3d..bcba5d4a25 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -698,11 +698,12 @@ public: //- Deprecated(2019-01) identical to clip() // \deprecated(2019-01) identical to clip() + FOAM_DEPRECATED_FOR(2019-01, "clip() method") void maxMin ( const dimensioned& minVal, const dimensioned& maxVal - ) FOAM_DEPRECATED_FOR(2019-01, "clip() method"); + ); // Member Operators diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index 407315f093..4c8ff575bc 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -628,8 +628,8 @@ public: // Index 1 is the first (non-option) argument. // \deprecated(2018-08) - use get() method template - T FOAM_DEPRECATED_FOR(2018-08, "get() method") - read(const label index) const + FOAM_DEPRECATED_FOR(2018-08, "get() method") + T read(const label index) const { return this->get(index); } @@ -638,24 +638,24 @@ public: // Index 1 is the first (non-option) argument. // \deprecated(2018-01) - use get() method template - T FOAM_DEPRECATED_FOR(2018-01, "get() method") - argRead(const label index) const + FOAM_DEPRECATED_FOR(2018-01, "get() method") + T argRead(const label index) const { return this->get(index); } //- Deprecated(2018-01) return true if the named option is found // \deprecated(2018-01) - use found() method - bool FOAM_DEPRECATED_FOR(2018-01, "found() method") - optionFound(const word& optName) const + FOAM_DEPRECATED_FOR(2018-01, "found() method") + bool optionFound(const word& optName) const { return found(optName); } //- Deprecated(2018-01) return an input stream from the named option // \deprecated(2018-01) - use lookup() method - ITstream FOAM_DEPRECATED_FOR(2018-01, "lookup() method") - optionLookup(const word& optName) const + FOAM_DEPRECATED_FOR(2018-01, "lookup() method") + ITstream optionLookup(const word& optName) const { return lookup(optName); } @@ -663,8 +663,8 @@ public: //- Deprecated(2018-01) read a value from the named option // \deprecated(2018-01) - use get() method template - T FOAM_DEPRECATED_FOR(2018-01, "get() method") - optionRead(const word& optName) const + FOAM_DEPRECATED_FOR(2018-01, "get() method") + T optionRead(const word& optName) const { return get(optName); } @@ -673,8 +673,8 @@ public: // Return true if the named option was found. // \deprecated(2018-01) - use readIfPresent() method template - bool FOAM_DEPRECATED_FOR(2018-01, "readIfPresent() method") - optionReadIfPresent + FOAM_DEPRECATED_FOR(2018-01, "readIfPresent() method") + bool optionReadIfPresent ( const word& optName, T& val @@ -688,8 +688,8 @@ public: // use the supplied default and return false. // \deprecated(2018-01) - use readIfPresent() method template - bool FOAM_DEPRECATED_FOR(2018-01, "readIfPresent() method") - optionReadIfPresent + FOAM_DEPRECATED_FOR(2018-01, "readIfPresent() method") + bool optionReadIfPresent ( const word& optName, T& val, @@ -703,8 +703,8 @@ public: // Return supplied default otherwise. // \deprecated(2018-01) - use getOrDefault() method template - T FOAM_DEPRECATED_FOR(2018-01, "getOrDefault() method") - optionLookupOrDefault + FOAM_DEPRECATED_FOR(2018-01, "getOrDefault() method") + T optionLookupOrDefault ( const word& optName, const T& deflt @@ -716,8 +716,8 @@ public: //- Deprecated(2018-01) read a List of values from the named option // \deprecated(2018-01) - use getList() method template - List FOAM_DEPRECATED_FOR(2018-01, "getList() method") - optionReadList(const word& optName) const + FOAM_DEPRECATED_FOR(2018-01, "getList() method") + List optionReadList(const word& optName) const { return this->getList(optName); } diff --git a/src/OpenFOAM/include/stdFoam.H b/src/OpenFOAM/include/stdFoam.H index 956168b612..ec542a419a 100644 --- a/src/OpenFOAM/include/stdFoam.H +++ b/src/OpenFOAM/include/stdFoam.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,7 +54,7 @@ SeeAlso // Compile-time warning for use of deprecated methods (compiler-dependent). // Use within the class declaration. -#if defined(__cplusplus) && (__cplusplus >= 201402L) +#if (__cplusplus >= 201402L) # define FOAM_DEPRECATED(since) [[deprecated("Since " #since)]] # define FOAM_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] #elif defined(__GNUC__) diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.H b/src/OpenFOAM/matrices/Matrix/Matrix.H index 461a1a991b..bb66c5e5b7 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.H +++ b/src/OpenFOAM/matrices/Matrix/Matrix.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -505,22 +505,24 @@ public: //- Deprecated(2019-04) raw data pointer, const access // \deprecated(2019-04) - use cdata() method - const Type* FOAM_DEPRECATED_FOR(2019-04, "cdata() method") v() const + FOAM_DEPRECATED_FOR(2019-04, "cdata() method") + const Type* v() const { return v_; } //- Deprecated(2019-04) raw data pointer, non-const access // \deprecated(2019-04) - use data() method - Type* FOAM_DEPRECATED_FOR(2019-04, "data() method") v() + FOAM_DEPRECATED_FOR(2019-04, "data() method") + Type* v() { return v_; } //- Deprecated(2019-04) - use subMatrix() // \deprecated(2019-04) - use subMatrix() - ConstMatrixBlock - FOAM_DEPRECATED_FOR(2019-04, "subMatrix() method") block + FOAM_DEPRECATED_FOR(2019-04, "subMatrix() method") + ConstMatrixBlock block ( const label m, const label n, @@ -533,8 +535,8 @@ public: //- Deprecated(2019-04) - use subMatrix() // \deprecated(2019-04) - use subMatrix() - MatrixBlock - FOAM_DEPRECATED_FOR(2019-04, "subMatrix() method") block + FOAM_DEPRECATED_FOR(2019-04, "subMatrix() method") + MatrixBlock block ( const label m, const label n, @@ -548,8 +550,8 @@ public: //- Deprecated(2019-04) - use subColumn() // \deprecated(2019-04) - use subColumn() - ConstMatrixBlock - FOAM_DEPRECATED_FOR(2019-04, "subColumn() method") col + FOAM_DEPRECATED_FOR(2019-04, "subColumn() method") + ConstMatrixBlock col ( const label m, const label mStart, @@ -561,8 +563,8 @@ public: //- Deprecated(2019-04) - use subColumn() // \deprecated(2019-04) - use subColumn() - MatrixBlock - FOAM_DEPRECATED_FOR(2019-04, "subColumn() method") col + FOAM_DEPRECATED_FOR(2019-04, "subColumn() method") + MatrixBlock col ( const label m, const label mStart, diff --git a/src/OpenFOAM/meshes/Identifiers/surface/geometricSurfacePatch.H b/src/OpenFOAM/meshes/Identifiers/surface/geometricSurfacePatch.H index 773807b468..1b82302fe3 100644 --- a/src/OpenFOAM/meshes/Identifiers/surface/geometricSurfacePatch.H +++ b/src/OpenFOAM/meshes/Identifiers/surface/geometricSurfacePatch.H @@ -191,17 +191,18 @@ public: //- Deprecated(2020-01) Construct from components // \deprecated(2020-01) - order inconsistent with other identifiers + FOAM_DEPRECATED(2020-01) geometricSurfacePatch ( const word& geometricType, const word& name, const label index - ) FOAM_DEPRECATED(2020-01); + ); //- Deprecated(2020-01) Write dictionary // \deprecated(2020-01) - Write dictionary - void FOAM_DEPRECATED_FOR(2020-01, "write() or operator<<") - writeDict(Ostream& os) const + FOAM_DEPRECATED_FOR(2020-01, "write() or operator<<") + void writeDict(Ostream& os) const { write(os); } diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H index d6612f4dd4..0bc412fc6e 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.H +++ b/src/OpenFOAM/meshes/meshShapes/face/face.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -203,8 +203,8 @@ public: //- Legacy name for areaNormal() // \deprecated(2018-06) Deprecated for new use - vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") - normal(const UList& p) const + FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + vector normal(const UList& p) const { return areaNormal(p); // Legacy definition } diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H index af17d81f4c..a94d4c3d44 100644 --- a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -134,8 +134,8 @@ public: //- Legacy name for areaNormal() // \deprecated(2018-06) Deprecated for new use - vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") - normal(const UList& points) const + FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + vector normal(const UList& points) const { return areaNormal(points); // Legacy definition } diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H index 8f3a55e0c6..6e4acee382 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -217,8 +217,8 @@ public: //- Legacy name for areaNormal(). // \deprecated(2018-06) Deprecated for new use - vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") - normal() const + FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + vector normal() const { return areaNormal(); } diff --git a/src/OpenFOAM/primitives/enums/Enum.H b/src/OpenFOAM/primitives/enums/Enum.H index 0209099310..a9464b49b1 100644 --- a/src/OpenFOAM/primitives/enums/Enum.H +++ b/src/OpenFOAM/primitives/enums/Enum.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -282,8 +282,8 @@ public: //- Deprecated(2018-10) same as two-parameter get() // \deprecated(2018-10) - use two-parameter get() method - EnumType FOAM_DEPRECATED_FOR(2018-10, "get() method") - lookup(const word& key, const dictionary& dict) const + FOAM_DEPRECATED_FOR(2018-10, "get() method") + EnumType lookup(const word& key, const dictionary& dict) const { return get(key, dict); } diff --git a/src/OpenFOAM/primitives/enums/NamedEnum.H b/src/OpenFOAM/primitives/enums/NamedEnum.H index 0bd0949719..be8b7a8e4d 100644 --- a/src/OpenFOAM/primitives/enums/NamedEnum.H +++ b/src/OpenFOAM/primitives/enums/NamedEnum.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,11 +67,12 @@ Ostream& operator<<(Ostream& os, const NamedEnum& wrapped); \*---------------------------------------------------------------------------*/ template -class NamedEnum +class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum { //- The nEnum must be positive (non-zero) static_assert(nEnum > 0, "nEnum must be positive (non-zero)"); + // Private Member Data //- The values for the enum @@ -102,8 +103,7 @@ public: // Constructors //- Construct from names - NamedEnum() - FOAM_DEPRECATED_FOR(2017-05, "Enum instead of using NamedEnum"); + NamedEnum(); // Member Functions diff --git a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H index 7104aac432..933966c47f 100644 --- a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H +++ b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H @@ -183,8 +183,8 @@ public: //- Deprecated(2019-01) Is the specified name found in the list? // \deprecated(2019-01) - use found() method - bool FOAM_DEPRECATED_FOR(2019-01, "found() method") - contains(const word& name) const + FOAM_DEPRECATED_FOR(2019-01, "found() method") + bool contains(const word& name) const { return this->found(name); } diff --git a/src/surfMesh/surfZone/surfZone.H b/src/surfMesh/surfZone/surfZone.H index 7582556287..967ee53bda 100644 --- a/src/surfMesh/surfZone/surfZone.H +++ b/src/surfMesh/surfZone/surfZone.H @@ -168,8 +168,8 @@ public: //- Deprecated(2020-01) Write dictionary // \deprecated(2020-01) - Write dictionary - void FOAM_DEPRECATED_FOR(2020-01, "write() or operator<<") - writeDict(Ostream& os) const + FOAM_DEPRECATED_FOR(2020-01, "write() or operator<<") + void writeDict(Ostream& os) const { write(os); } diff --git a/src/surfMesh/triSurface/patches/surfacePatch.H b/src/surfMesh/triSurface/patches/surfacePatch.H index b8e4c9832d..5ed5c8b8e2 100644 --- a/src/surfMesh/triSurface/patches/surfacePatch.H +++ b/src/surfMesh/triSurface/patches/surfacePatch.H @@ -148,6 +148,7 @@ public: //- Deprecated(2020-01) Construct from components // \deprecated(2020-01) - order inconsistent with other identifiers + FOAM_DEPRECATED(2020-01) surfacePatch ( const word& geometricType, @@ -155,12 +156,12 @@ public: const label size, const label start, const label index - ) FOAM_DEPRECATED(2020-01); + ); //- Deprecated(2020-01) Ostream output // \deprecated(2020-01) - Ostream output - void FOAM_DEPRECATED_FOR(2020-01, "write() or operator<<") - writeDict(Ostream& os) const + FOAM_DEPRECATED_FOR(2020-01, "write() or operator<<") + void writeDict(Ostream& os) const { write(os); }