Bugfix: 32-bit port
This commit is contained in:
parent
b7cacb6c10
commit
a973bcf237
1 changed files with 25 additions and 25 deletions
|
@ -72,33 +72,9 @@ public:
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Hash specialization for hashing pointer addresses.
|
|
||||||
// Treat a pointer like a intptr_t.
|
|
||||||
// This should work for both 32-bit and 64-bit pointers.
|
|
||||||
template<>
|
|
||||||
class Hash<void*>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Hash()
|
|
||||||
{}
|
|
||||||
|
|
||||||
unsigned operator()(const void* const& p, unsigned seed) const
|
|
||||||
{
|
|
||||||
return Hash<intptr_t>()(intptr_t(p), seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned operator()(const void* const& p) const
|
|
||||||
{
|
|
||||||
return Hash<intptr_t>()(intptr_t(p));
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//- Hash specialization for hashing labels
|
//- Hash specialization for hashing labels
|
||||||
template<>
|
template<>
|
||||||
class Hash<Foam::label>
|
class Hash<label>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -123,6 +99,30 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//- Hash specialization for hashing pointer addresses.
|
||||||
|
// Treat a pointer like a intptr_t.
|
||||||
|
// This should work for both 32-bit and 64-bit pointers.
|
||||||
|
template<>
|
||||||
|
class Hash<void*>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
Hash()
|
||||||
|
{}
|
||||||
|
|
||||||
|
unsigned operator()(const void* const& p, unsigned seed) const
|
||||||
|
{
|
||||||
|
return Hash<intptr_t>()(intptr_t(p), seed);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned operator()(const void* const& p) const
|
||||||
|
{
|
||||||
|
return Hash<intptr_t>()(intptr_t(p));
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
Reference in a new issue