diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H index 916bae2278706c16b128c258c721aa6c8e1e45be..c8eb66976f3c5024c64b62e4c21e0e586b1035df 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H @@ -329,8 +329,8 @@ inline Ostream& endEntry(Ostream& os) // Useful aliases for tab and newline characters -static const char tab = '\t'; -static const char nl = '\n'; +constexpr char tab = '\t'; +constexpr char nl = '\n'; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H b/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H index c7faae1bd273a4ab30a5703f0c17699e646e7611..a71217514791c512f83b185b6a06c6dbed914f88 100644 --- a/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H +++ b/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H @@ -45,7 +45,7 @@ namespace mathematical // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - static const char* const group = "mathematical"; + constexpr const char* const group = "mathematical"; constexpr scalar e(M_E); constexpr scalar pi(M_PI); diff --git a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H index b7a0b8fd562ea94a08add0af9add7dc4b5ba8255..143245890e4cbff4c1150716066af72151dca10e 100644 --- a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H +++ b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H @@ -51,13 +51,13 @@ typedef double doubleScalar; // Largest and smallest scalar values allowed in certain parts of the code. // (15 is the number of significant figures in an // IEEE double precision number. See limits.h or float.h) -static const doubleScalar doubleScalarGREAT = 1.0e+15; -static const doubleScalar doubleScalarVGREAT = 1.0e+300; -static const doubleScalar doubleScalarROOTVGREAT = 1.0e+150; -static const doubleScalar doubleScalarSMALL = 1.0e-15; -static const doubleScalar doubleScalarROOTSMALL = 3.0e-8; -static const doubleScalar doubleScalarVSMALL = 1.0e-300; -static const doubleScalar doubleScalarROOTVSMALL = 1.0e-150; +constexpr doubleScalar doubleScalarGREAT = 1.0e+15; +constexpr doubleScalar doubleScalarVGREAT = 1.0e+300; +constexpr doubleScalar doubleScalarROOTVGREAT = 1.0e+150; +constexpr doubleScalar doubleScalarSMALL = 1.0e-15; +constexpr doubleScalar doubleScalarROOTSMALL = 3.0e-8; +constexpr doubleScalar doubleScalarVSMALL = 1.0e-300; +constexpr doubleScalar doubleScalarROOTVSMALL = 1.0e-150; #define Scalar doubleScalar diff --git a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H index 07c8a4aa66052323750a685ec29e68210b7c899e..951de0f84fb6859a3d7e4bef7abba17a19f7626c 100644 --- a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H +++ b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H @@ -51,13 +51,13 @@ typedef float floatScalar; // Largest and smallest scalar values allowed in certain parts of the code. // (6 is the number of significant figures in an // IEEE single precision number. See limits.h or float.h) -static const floatScalar floatScalarGREAT = 1.0e+6; -static const floatScalar floatScalarVGREAT = 1.0e+37; -static const floatScalar floatScalarROOTVGREAT = 1.0e+18; -static const floatScalar floatScalarSMALL = 1.0e-6; -static const floatScalar floatScalarROOTSMALL = 1.0e-3; -static const floatScalar floatScalarVSMALL = 1.0e-37; -static const floatScalar floatScalarROOTVSMALL = 1.0e-18; +constexpr floatScalar floatScalarGREAT = 1.0e+6; +constexpr floatScalar floatScalarVGREAT = 1.0e+37; +constexpr floatScalar floatScalarROOTVGREAT = 1.0e+18; +constexpr floatScalar floatScalarSMALL = 1.0e-6; +constexpr floatScalar floatScalarROOTSMALL = 1.0e-3; +constexpr floatScalar floatScalarVSMALL = 1.0e-37; +constexpr floatScalar floatScalarROOTVSMALL = 1.0e-18; #define Scalar floatScalar diff --git a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H index e705dc8550a53094a2645acc79e2321bbf972520..33b7a61c18b1c07fb1ee8731294e4726dbb99e4b 100644 --- a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H +++ b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H @@ -49,13 +49,13 @@ namespace Foam { typedef floatScalar scalar; - static const scalar GREAT = floatScalarGREAT; - static const scalar VGREAT = floatScalarVGREAT; - static const scalar ROOTVGREAT = floatScalarROOTVGREAT; - static const scalar SMALL = floatScalarSMALL; - static const scalar ROOTSMALL = floatScalarROOTSMALL; - static const scalar VSMALL = floatScalarVSMALL; - static const scalar ROOTVSMALL = floatScalarROOTVSMALL; + constexpr scalar GREAT = floatScalarGREAT; + constexpr scalar VGREAT = floatScalarVGREAT; + constexpr scalar ROOTVGREAT = floatScalarROOTVGREAT; + constexpr scalar SMALL = floatScalarSMALL; + constexpr scalar ROOTSMALL = floatScalarROOTSMALL; + constexpr scalar VSMALL = floatScalarVSMALL; + constexpr scalar ROOTVSMALL = floatScalarROOTVSMALL; scalar readScalar(Istream& is); @@ -73,13 +73,13 @@ namespace Foam { typedef doubleScalar scalar; - static const scalar GREAT = doubleScalarGREAT; - static const scalar VGREAT = doubleScalarVGREAT; - static const scalar ROOTVGREAT = doubleScalarROOTVGREAT; - static const scalar SMALL = doubleScalarSMALL; - static const scalar ROOTSMALL = doubleScalarROOTSMALL; - static const scalar VSMALL = doubleScalarVSMALL; - static const scalar ROOTVSMALL = doubleScalarROOTVSMALL; + constexpr scalar GREAT = doubleScalarGREAT; + constexpr scalar VGREAT = doubleScalarVGREAT; + constexpr scalar ROOTVGREAT = doubleScalarROOTVGREAT; + constexpr scalar SMALL = doubleScalarSMALL; + constexpr scalar ROOTSMALL = doubleScalarROOTSMALL; + constexpr scalar VSMALL = doubleScalarVSMALL; + constexpr scalar ROOTVSMALL = doubleScalarROOTVSMALL; scalar readScalar(Istream& is); diff --git a/src/OpenFOAM/primitives/ints/label/label.H b/src/OpenFOAM/primitives/ints/label/label.H index 08b4d1ff39cfbb1e47b29f4b2c31cd603957e41c..11a862fd7cb4aa3f03569417f085b0c18f7199d1 100644 --- a/src/OpenFOAM/primitives/ints/label/label.H +++ b/src/OpenFOAM/primitives/ints/label/label.H @@ -58,8 +58,8 @@ namespace Foam typedef INT_SIZE(int, _t) label; -static const label labelMin = INT_SIZE(INT, _MIN); -static const label labelMax = INT_SIZE(INT, _MAX); +constexpr label labelMin = INT_SIZE(INT, _MIN); +constexpr label labelMax = INT_SIZE(INT, _MAX); //- Read label from stream. // Uses readInt32 or readInt64 according to WM_LABEL_SIZE diff --git a/src/OpenFOAM/primitives/ints/uLabel/uLabel.H b/src/OpenFOAM/primitives/ints/uLabel/uLabel.H index 9a8713f7338f338337b63b11a3964872f791442f..afdf9f39e6cb2d27dacda0116009a8353732cd71 100644 --- a/src/OpenFOAM/primitives/ints/uLabel/uLabel.H +++ b/src/OpenFOAM/primitives/ints/uLabel/uLabel.H @@ -58,7 +58,7 @@ namespace Foam typedef UINT_SIZE(uint, _t) uLabel; -static const uLabel uLabelMax = UINT_SIZE(UINT, _MAX); +constexpr uLabel uLabelMax = UINT_SIZE(UINT, _MAX); //- Read uLabel from stream. // Uses readUint32 or readUint64 according to WM_LABEL_SIZE