ints: Add support for mag(int32_t) and mag(int64_t)

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1817
This commit is contained in:
Henry Weller
2015-08-07 15:52:22 +01:00
parent 913103ec0a
commit adcfe64b7c
3 changed files with 12 additions and 9 deletions

View File

@ -136,6 +136,12 @@ public:
};
inline int32_t mag(const int32_t l)
{
return ::abs(l);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -127,6 +127,12 @@ public:
};
inline int64_t mag(const int64_t l)
{
return ::labs(l);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -36,15 +36,6 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline label mag(const label l)
{
#if WM_LABEL_SIZE == 32
return ::abs(l);
#elif WM_LABEL_SIZE == 64
return ::labs(l);
#endif
}
inline label sign(const label s)
{
return (s >= 0)? 1: -1;