Commit f4596ad2 authored by Henry's avatar Henry
Browse files

Resolve issues relating to compilation with clang-3.5.0

parent 41368add
......@@ -2,7 +2,7 @@
#
#+TITLE: OpenFOAM README for version dev
#+AUTHOR: The OpenFOAM Foundation
#+DATE: 14th December 2014
#+DATE: 16th December 2014
#+LINK: http://www.openfoam.org
#+OPTIONS: author:nil ^:{}
# Copyright (c) 2014 OpenFOAM Foundation.
......
Test-nullObject.C
EXE = $(FOAM_USER_APPBIN)/nullObject
#include "nullObject.H"
#include "IOstreams.H"
using namespace Foam;
class SimpleClass
{
public:
//- Null constructor
SimpleClass()
{}
};
int main()
{
// Test pointer and reference to a class
SimpleClass* ptrToClass = new SimpleClass;
SimpleClass& refToClass(*ptrToClass);
if (notNull(ptrToClass))
{
Info<< "Pass: ptrToClass is not null" << endl;
}
else
{
Info<< "FAIL: refToClass is null" << endl;
}
if (notNull(refToClass))
{
Info<< "Pass: refToClass is not null" << endl;
}
else
{
Info<< "FAIL: refToClass is null" << endl;
}
// Test pointer and reference to the nullObject
const SimpleClass* ptrToNull(NullObjectPtr<SimpleClass>());
const SimpleClass& refToNull(*ptrToNull);
if (isNull(ptrToNull))
{
Info<< "Pass: ptrToNull is null" << endl;
}
else
{
Info<< "FAIL: ptrToNull is not null" << endl;
}
if (isNull(refToNull))
{
Info<< "Pass: refToNull is null" << endl;
}
else
{
Info<< "FAIL: refToNull is not null" << endl;
}
// Clean-up
delete ptrToClass;
return 0;
}
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -360,7 +360,6 @@ void calcFeaturePoints(const pointField& points, const edgeList& edges)
const labelListList& pointEdges = eMesh.pointEdges();
// Get total number of feature points
label nFeaturePoints = 0;
forAll(pointEdges, pI)
......@@ -390,19 +389,6 @@ void calcFeaturePoints(const pointField& points, const edgeList& edges)
nFeatPts++;
}
}
label concaveStart = 0;
label mixedStart = 0;
label nonFeatureStart = nFeaturePoints;
labelListList featurePointNormals(nFeaturePoints);
labelListList featurePointEdges(nFeaturePoints);
labelList regionEdges;
}
......
......@@ -235,7 +235,7 @@ case ThirdParty:
# using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
set clang_version=llvm-3.4.2
set clang_version=llvm-3.5.0
breaksw
default:
echo
......
......@@ -256,7 +256,7 @@ OpenFOAM | ThirdParty)
# using clang - not gcc
export WM_CC='clang'
export WM_CXX='clang++'
clang_version=llvm-3.4.2
clang_version=llvm-3.5.0
;;
*)
echo 1>&2
......
......@@ -104,7 +104,6 @@ $(ranges)/labelRange/labelRanges.C
$(ranges)/scalarRange/scalarRange.C
$(ranges)/scalarRange/scalarRanges.C
containers/HashTables/HashTable/HashTableCore.C
containers/HashTables/StaticHashTable/StaticHashTableCore.C
containers/Lists/SortableList/ParSortableListName.C
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -79,7 +79,7 @@ template<class T, class Container>
inline const Foam::CompactListList<T, Container>&
Foam::CompactListList<T, Container>::null()
{
return *reinterpret_cast< CompactListList<T, Container>* >(0);
return NullObjectRef<CompactListList<T, Container> >();
}
......
......@@ -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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -107,7 +107,7 @@ Foam::FixedList<T, Size>::clone() const
template<class T, unsigned Size>
inline const Foam::FixedList<T, Size>& Foam::FixedList<T, Size>::null()
{
return *reinterpret_cast< FixedList<T, Size>* >(0);
return NullObjectRef<FixedList<T, Size> >();
}
......
......@@ -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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -42,7 +42,7 @@ inline Foam::autoPtr<Foam::List<T> > Foam::List<T>::clone() const
template<class T>
inline const Foam::List<T>& Foam::List<T>::null()
{
return *reinterpret_cast< List<T>* >(0);
return NullObjectRef<List<T> >();
}
......
......@@ -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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -74,7 +74,7 @@ inline Foam::SubList<T>::SubList
template<class T>
inline const Foam::SubList<T>& Foam::SubList<T>::null()
{
return *reinterpret_cast< SubList<T>* >(0);
return NullObjectRef<SubList<T> >();
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -45,6 +45,7 @@ SourceFiles
#include "bool.H"
#include "label.H"
#include "uLabel.H"
#include "nullObject.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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -50,7 +50,7 @@ inline Foam::UList<T>::UList(T* __restrict__ v, label size)
template<class T>
inline const Foam::UList<T>& Foam::UList<T>::null()
{
return *reinterpret_cast< UList<T>* >(0);
return NullObjectRef<UList<T> >();
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -204,7 +204,7 @@ const Type& Foam::objectRegistry::lookupObject(const word& name) const
<< abort(FatalError);
}
return *reinterpret_cast< const Type* >(0);
return NullObjectRef<Type>();
}
......
......@@ -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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -23,57 +23,52 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type, class GeoMesh>
inline const DimensionedField<Type, GeoMesh>&
DimensionedField<Type, GeoMesh>::null()
inline const Foam::DimensionedField<Type, GeoMesh>&
Foam::DimensionedField<Type, GeoMesh>::null()
{
return *reinterpret_cast< DimensionedField<Type, GeoMesh>* >(0);
return NullObjectRef<DimensionedField<Type, GeoMesh> >();
}
template<class Type, class GeoMesh>
inline const typename GeoMesh::Mesh&
DimensionedField<Type, GeoMesh>::mesh() const
Foam::DimensionedField<Type, GeoMesh>::mesh() const
{
return mesh_;
}
template<class Type, class GeoMesh>
inline const dimensionSet& DimensionedField<Type, GeoMesh>::dimensions() const
inline const Foam::dimensionSet&
Foam::DimensionedField<Type, GeoMesh>::dimensions() const
{
return dimensions_;
}
template<class Type, class GeoMesh>
inline dimensionSet& DimensionedField<Type, GeoMesh>::dimensions()
inline Foam::dimensionSet&
Foam::DimensionedField<Type, GeoMesh>::dimensions()
{
return dimensions_;
}
template<class Type, class GeoMesh>
inline const Field<Type>& DimensionedField<Type, GeoMesh>::field() const
inline const Foam::Field<Type>&
Foam::DimensionedField<Type, GeoMesh>::field() const
{
return *this;
}
template<class Type, class GeoMesh>
inline Field<Type>& DimensionedField<Type, GeoMesh>::field()
inline Foam::Field<Type>&
Foam::DimensionedField<Type, GeoMesh>::field()
{
return *this;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
......@@ -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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -23,15 +23,10 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type, class GeoMesh>
inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
inline Foam::SubDimensionedField<Type, GeoMesh>::SubDimensionedField
(
const SubField<Type>& slist
)
......@@ -40,7 +35,7 @@ inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
{}
template<class Type, class GeoMesh>
inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
inline Foam::SubDimensionedField<Type, GeoMesh>::SubDimensionedField
(
const UList<Type>& list,
const label subSize
......@@ -51,7 +46,7 @@ inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
template<class Type, class GeoMesh>
inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
inline Foam::SubDimensionedField<Type, GeoMesh>::SubDimensionedField
(
const UList<Type>& list,
const label subSize,
......@@ -63,7 +58,7 @@ inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
template<class Type, class GeoMesh>
inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
inline Foam::SubDimensionedField<Type, GeoMesh>::SubDimensionedField
(
const SubDimensionedField<Type, GeoMesh>& sfield
)
......@@ -75,18 +70,21 @@ inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Return a null Field
template<class Type, class GeoMesh>
inline const SubDimensionedField<Type, GeoMesh>&
SubDimensionedField<Type, GeoMesh>::null()
inline const Foam::SubDimensionedField<Type, GeoMesh>&
Foam::SubDimensionedField<Type, GeoMesh>::null()
{
return *reinterpret_cast< SubDimensionedField<Type, GeoMesh>* >(0);
return NullObjectRef<SubDimensionedField<Type, GeoMesh> >();
}
template<class Type, class GeoMesh>
inline tmp<Field<typename SubDimensionedField<Type, GeoMesh>::cmptType> >
SubDimensionedField<Type, GeoMesh>::component
inline
Foam::tmp
<
Foam::Field<typename Foam::SubDimensionedField<Type, GeoMesh>::cmptType>
>
Foam::SubDimensionedField<Type, GeoMesh>::component
(
const direction d
) const
......@@ -99,8 +97,8 @@ SubDimensionedField<Type, GeoMesh>::component
template<class Type, class GeoMesh>
inline tmp<DimensionedField<Type, GeoMesh> >
SubDimensionedField<Type, GeoMesh>::T() const
inline Foam::tmp<Foam::DimensionedField<Type, GeoMesh> >
Foam::SubDimensionedField<Type, GeoMesh>::T() const
{
return
(
......@@ -112,7 +110,7 @@ SubDimensionedField<Type, GeoMesh>::T() const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Type, class GeoMesh>
inline void SubDimensionedField<Type, GeoMesh>::operator=
inline void Foam::SubDimensionedField<Type, GeoMesh>::operator=
(
const SubDimensionedField<Type, GeoMesh>& rhs
)
......@@ -122,17 +120,12 @@ inline void SubDimensionedField<Type, GeoMesh>::operator=
}
// Allow cast to a const DimensionedField<Type, GeoMesh>&
template<class Type, class GeoMesh>
inline SubDimensionedField<Type, GeoMesh>::operator
const DimensionedField<Type, GeoMesh>&() const
inline Foam::SubDimensionedField<Type, GeoMesh>::operator
const Foam::DimensionedField<Type, GeoMesh>&() const
{
return *(reinterpret_cast<const DimensionedField<Type, GeoMesh>*>(this));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -458,7 +458,7 @@ void Foam::Field<Type>::map
if
(
mapper.direct()
&& &mapper.directAddressing()
&& notNull(mapper.directAddressing())
&& mapper.directAddressing().size()
)
{
......@@ -493,7 +493,7 @@ void Foam::Field<Type>::autoMap
(
(
mapper.direct()
&& &mapper.directAddressing()
&& notNull(mapper.directAddressing())
&& mapper.directAddressing().size()
)
|| (!mapper.direct() && mapper.addressing().size())
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -100,7 +100,7 @@ public:
//- Return a null field
inline static const Field<Type>& null()
{
return *reinterpret_cast< Field<Type>* >(0);
return NullObjectRef<Field<Type> >();
}
......
......@@ -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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -84,7 +84,7 @@ inline Foam::SubField<Type>::SubField
template<class Type>
inline const Foam::SubField<Type>& Foam::SubField<Type>::null()
{
return *reinterpret_cast< SubField<Type>* >(0);
return NullObjectRef<SubField<Type> >();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment