More compliance fixes

This commit is contained in:
Pavel Kirienko
2014-04-17 12:23:31 +04:00
parent cff3a24883
commit 03ff492bc4
4 changed files with 6 additions and 6 deletions
@@ -52,7 +52,7 @@ public:
{
typedef typename IntegerSpec<BitLen, SignednessUnsigned, CastModeTruncate>::StorageType IntType;
typedef typename NativeFloatSelector<BitLen>::Type FloatType;
StaticAssert<sizeof(FloatType) * 8 == BitLen && std::numeric_limits<FloatType>::is_iec559>::check();
StaticAssert<sizeof(FloatType) * 8 == BitLen>::check();
union { IntType i; FloatType f; } u;
u.f = value;
return u.i;
@@ -64,7 +64,7 @@ public:
{
typedef typename IntegerSpec<BitLen, SignednessUnsigned, CastModeTruncate>::StorageType IntType;
typedef typename NativeFloatSelector<BitLen>::Type FloatType;
StaticAssert<sizeof(FloatType) * 8 == BitLen && std::numeric_limits<FloatType>::is_iec559>::check();
StaticAssert<sizeof(FloatType) * 8 == BitLen>::check();
union { IntType i; FloatType f; } u;
u.i = value;
return u.f;
@@ -126,7 +126,7 @@ int ScalarCodec::decode(T& value)
if (read_res > 0)
{
convertByteOrder<BitLen>(byte_union.bytes);
fixTwosComplement<BitLen>(byte_union.value);
fixTwosComplement<BitLen, T>(byte_union.value);
value = byte_union.value;
}
return read_res;