Dependency on math.h and the last 'using namespace std' were removed

This commit is contained in:
Pavel Kirienko
2015-03-21 14:14:48 +03:00
parent ec9006381b
commit 71d4b02a7f
2 changed files with 17 additions and 7 deletions
@@ -16,9 +16,7 @@
#ifndef UAVCAN_CPP_VERSION
# error UAVCAN_CPP_VERSION
#endif
#if UAVCAN_CPP_VERSION < UAVCAN_CPP11
# include <math.h> // Needed for isfinite()
#else
#if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
# include <limits> // Assuming that in C++11 mode all standard headers are available
#endif
@@ -169,8 +167,7 @@ public:
private:
static inline void saturate(StorageType& value)
{
using namespace std;
if ((IsExactRepresentation == 0) && isfinite(value))
if ((IsExactRepresentation == 0) && isFinite(value))
{
if (value > max())
{
@@ -189,8 +186,7 @@ private:
static inline void truncate(StorageType& value)
{
using namespace std;
if ((IsExactRepresentation == 0) && isfinite(value))
if ((IsExactRepresentation == 0) && isFinite(value))
{
if (value > max())
{