From 1d8b31d390e1cb418ff25f2086583187c7cfeec0 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 18 Jan 2017 18:12:45 +0000 Subject: [PATCH] Updates for clang++-3.9 --- src/OpenFOAM/fields/Fields/Field/FieldMapper.H | 8 ++++---- src/OpenFOAM/primitives/ranges/labelRange/labelRange.C | 4 ++-- src/OpenFOAM/primitives/ranges/labelRange/labelRange.H | 8 ++++++-- src/OpenFOAM/primitives/ranges/labelRange/labelRangeI.H | 4 ++-- src/OpenFOAM/primitives/ranges/labelRange/labelRanges.C | 3 ++- src/OpenFOAM/primitives/ranges/labelRange/labelRanges.H | 6 ++++-- src/OpenFOAM/primitives/ranges/labelRange/labelRangesI.H | 4 ++-- wmake/rules/linux64Clang/c++ | 2 +- wmake/rules/linuxClang/c++ | 4 ++-- 9 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H index d123472f98..bf7dd92ec8 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H +++ b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,13 +32,13 @@ Description #ifndef FieldMapper_H #define FieldMapper_H +#include "mapDistributeBase.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -class mapDistributeBase; - /*---------------------------------------------------------------------------*\ Class FieldMapper Declaration \*---------------------------------------------------------------------------*/ @@ -76,7 +76,7 @@ public: FatalErrorInFunction << "attempt to access null distributeMap" << abort(FatalError); - return *static_cast(nullptr); + return *(new mapDistributeBase()); } //- Are there unmapped values? I.e. do all size() elements get diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRange.C b/src/OpenFOAM/primitives/ranges/labelRange/labelRange.C index 11aacf25cb..721e523ec4 100644 --- a/src/OpenFOAM/primitives/ranges/labelRange/labelRange.C +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRange.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,8 +29,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +const Foam::labelRange Foam::labelRange::endLabelRange_; const Foam::labelRange::const_iterator Foam::labelRange::endIter_; - int Foam::labelRange::debug(::Foam::debug::debugSwitch("labelRange", 0)); diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRange.H b/src/OpenFOAM/primitives/ranges/labelRange/labelRange.H index 24dd33729c..330ab15cb5 100644 --- a/src/OpenFOAM/primitives/ranges/labelRange/labelRange.H +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRange.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,6 +31,7 @@ SourceFiles labelRange.C \*---------------------------------------------------------------------------*/ + #ifndef labelRange_H #define labelRange_H @@ -79,6 +80,7 @@ public: } }; + // Constructors //- Construct an empty range @@ -196,9 +198,11 @@ public: private: + //- const labelRange held by endIter_ + static const labelRange endLabelRange_; + //- const_iterator returned by end(), cend() static const const_iterator endIter_; - }; diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRangeI.H b/src/OpenFOAM/primitives/ranges/labelRange/labelRangeI.H index 21e839cf3c..3a4268f53a 100644 --- a/src/OpenFOAM/primitives/ranges/labelRange/labelRangeI.H +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRangeI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,7 +50,7 @@ inline Foam::labelRange::labelRange(const label start, const label size) inline Foam::labelRange::const_iterator::const_iterator() : - range_(*reinterpret_cast(0)), + range_(endLabelRange_), index_(-1) {} diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.C b/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.C index 101c2bce98..8626ef33d5 100644 --- a/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.C +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +const Foam::labelRanges Foam::labelRanges::endLabelRanges_; const Foam::labelRanges::const_iterator Foam::labelRanges::endIter_; diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.H b/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.H index 6fa10b0aac..d5c5baa03a 100644 --- a/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.H +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -170,9 +170,11 @@ public: private: + //- const labelRanges held by endIter_ + static const labelRanges endLabelRanges_; + //- const_iterator returned by end(), cend() static const const_iterator endIter_; - }; diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRangesI.H b/src/OpenFOAM/primitives/ranges/labelRange/labelRangesI.H index 739d582e9f..df9623b56a 100644 --- a/src/OpenFOAM/primitives/ranges/labelRange/labelRangesI.H +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRangesI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,7 @@ inline Foam::labelRanges::labelRanges(const label nElem) inline Foam::labelRanges::const_iterator::const_iterator() : - list_(*reinterpret_cast(0)), + list_(endLabelRanges_), index_(-1), subIndex_(-1) {} diff --git a/wmake/rules/linux64Clang/c++ b/wmake/rules/linux64Clang/c++ index 1b51566179..014eff3461 100644 --- a/wmake/rules/linux64Clang/c++ +++ b/wmake/rules/linux64Clang/c++ @@ -1,6 +1,6 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-c++11-extensions +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-undefined-var-template # Suppress some warnings for flex++ and CGAL c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-tautological-undefined-compare -Wno-shift-negative-value diff --git a/wmake/rules/linuxClang/c++ b/wmake/rules/linuxClang/c++ index b2001baf2e..746cdb13bb 100644 --- a/wmake/rules/linuxClang/c++ +++ b/wmake/rules/linuxClang/c++ @@ -1,9 +1,9 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-c++11-extensions +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-undefined-var-template # Suppress some warnings for flex++ and CGAL -c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedef -Wno-tautological-undefined-compare -Wno-shift-negative-value +c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-tautological-undefined-compare -Wno-shift-negative-value CC = clang++ -std=c++11 -m32