Automated style fixes in order to bring the code a little bit closer to compliance with MISRA C++ rules. No changes in logic.

This commit is contained in:
Pavel Kirienko
2014-03-25 03:04:36 +04:00
parent cce657e1fe
commit 0cc627016a
64 changed files with 777 additions and 283 deletions
@@ -124,9 +124,13 @@ public:
{
// cppcheck-suppress duplicateExpression
if (CastMode == CastModeSaturate)
{
saturate(value);
}
else
{
truncate(value);
}
return codec.encode<BitLen>(IEEE754Converter::toIeee<BitLen>(value));
}
@@ -135,7 +139,9 @@ public:
typename IntegerSpec<BitLen, SignednessUnsigned, CastModeTruncate>::StorageType ieee = 0;
const int res = codec.decode<BitLen>(ieee);
if (res <= 0)
{
return res;
}
out_value = IEEE754Converter::toNative<BitLen>(ieee);
return res;
}
@@ -149,9 +155,13 @@ private:
if (!IsExactRepresentation && isfinite(value))
{
if (value > max())
{
value = max();
}
else if (value < -max())
{
value = -max();
}
}
}
@@ -161,9 +171,13 @@ private:
if (!IsExactRepresentation && isfinite(value))
{
if (value > max())
{
value = std::numeric_limits<StorageType>::infinity();
}
else if (value < -max())
{
value = -std::numeric_limits<StorageType>::infinity();
}
}
}
};