BUG: byteSize: return streamsize instead of label
This commit is contained in:
@ -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-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -276,7 +276,7 @@ public:
|
||||
|
||||
//- Return the binary size in number of characters
|
||||
// used in the underlying storage
|
||||
inline label byteSize() const;
|
||||
inline std::streamsize byteSize() const;
|
||||
|
||||
//- Count number of bits set, O(log(n))
|
||||
// Uses the Hamming weight (population count) method
|
||||
|
||||
@ -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-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -945,7 +945,7 @@ inline Foam::label Foam::PackedList<nBits>::packedLength() const
|
||||
|
||||
|
||||
template<unsigned nBits>
|
||||
inline Foam::label Foam::PackedList<nBits>::byteSize() const
|
||||
inline std::streamsize Foam::PackedList<nBits>::byteSize() const
|
||||
{
|
||||
return packedLength() * sizeof(StorageType);
|
||||
}
|
||||
|
||||
@ -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-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -103,7 +103,7 @@ void Foam::UList<T>::swap(UList<T>& a)
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class T>
|
||||
Foam::label Foam::UList<T>::byteSize() const
|
||||
std::streamsize Foam::UList<T>::byteSize() const
|
||||
{
|
||||
if (!contiguous<T>())
|
||||
{
|
||||
@ -113,7 +113,7 @@ Foam::label Foam::UList<T>::byteSize() const
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return this->size_*label(sizeof(T));
|
||||
return this->size_*sizeof(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-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -137,8 +137,9 @@ public:
|
||||
|
||||
//- Return the binary size in number of characters of the UList
|
||||
// if the element is a primitive type
|
||||
// i.e. contiguous<T>() == true
|
||||
label byteSize() const;
|
||||
// i.e. contiguous<T>() == true.
|
||||
// Note that is of type streamsize since used in stream ops
|
||||
std::streamsize byteSize() const;
|
||||
|
||||
|
||||
//- Return a const pointer to the first data element,
|
||||
|
||||
Reference in New Issue
Block a user