Commit 619f0540 authored by mattijs's avatar mattijs
Browse files

BUG: byteSize: return streamsize instead of label

parent f2acb355
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -276,7 +276,7 @@ public: ...@@ -276,7 +276,7 @@ public:
//- Return the binary size in number of characters //- Return the binary size in number of characters
// used in the underlying storage // used in the underlying storage
inline label byteSize() const; inline std::streamsize byteSize() const;
//- Count number of bits set, O(log(n)) //- Count number of bits set, O(log(n))
// Uses the Hamming weight (population count) method // Uses the Hamming weight (population count) method
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -945,7 +945,7 @@ inline Foam::label Foam::PackedList<nBits>::packedLength() const ...@@ -945,7 +945,7 @@ inline Foam::label Foam::PackedList<nBits>::packedLength() const
template<unsigned nBits> template<unsigned nBits>
inline Foam::label Foam::PackedList<nBits>::byteSize() const inline std::streamsize Foam::PackedList<nBits>::byteSize() const
{ {
return packedLength() * sizeof(StorageType); return packedLength() * sizeof(StorageType);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -103,7 +103,7 @@ void Foam::UList<T>::swap(UList<T>& a) ...@@ -103,7 +103,7 @@ void Foam::UList<T>::swap(UList<T>& a)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T> template<class T>
Foam::label Foam::UList<T>::byteSize() const std::streamsize Foam::UList<T>::byteSize() const
{ {
if (!contiguous<T>()) if (!contiguous<T>())
{ {
...@@ -113,7 +113,7 @@ Foam::label Foam::UList<T>::byteSize() const ...@@ -113,7 +113,7 @@ Foam::label Foam::UList<T>::byteSize() const
<< abort(FatalError); << abort(FatalError);
} }
return this->size_*label(sizeof(T)); return this->size_*sizeof(T);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -137,8 +137,9 @@ public: ...@@ -137,8 +137,9 @@ public:
//- Return the binary size in number of characters of the UList //- Return the binary size in number of characters of the UList
// if the element is a primitive type // if the element is a primitive type
// i.e. contiguous<T>() == true // i.e. contiguous<T>() == true.
label byteSize() const; // Note that is of type streamsize since used in stream ops
std::streamsize byteSize() const;
//- Return a const pointer to the first data element, //- Return a const pointer to the first data element,
......
Supports Markdown
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