diff --git a/libuavcan/include/uavcan/internal/marshalling/float_spec.hpp b/libuavcan/include/uavcan/internal/marshalling/float_spec.hpp index aa7e29240e..cdbc151897 100644 --- a/libuavcan/include/uavcan/internal/marshalling/float_spec.hpp +++ b/libuavcan/include/uavcan/internal/marshalling/float_spec.hpp @@ -31,7 +31,7 @@ class IEEE754Converter static uint16_t nativeNonIeeeToHalf(float value); static float halfToNativeNonIeee(uint16_t value); - IEEE754Converter() { } + IEEE754Converter(); public: /// UAVCAN requires rounding to nearest for all float conversions @@ -62,19 +62,18 @@ public: } }; template <> -typename IntegerSpec<16, SignednessUnsigned, CastModeTruncate>::StorageType +inline typename IntegerSpec<16, SignednessUnsigned, CastModeTruncate>::StorageType IEEE754Converter::toIeee<16>(typename NativeFloatSelector<16>::Type value) { return nativeNonIeeeToHalf(value); } template <> -typename NativeFloatSelector<16>::Type +inline typename NativeFloatSelector<16>::Type IEEE754Converter::toNative<16>(typename IntegerSpec<16, SignednessUnsigned, CastModeTruncate>::StorageType value) { return halfToNativeNonIeee(value); } - template struct IEEE754Limits; template <> struct IEEE754Limits<16> { @@ -96,7 +95,7 @@ template <> struct IEEE754Limits<64> template class FloatSpec : public IEEE754Limits { - FloatSpec() { } + FloatSpec(); public: enum { BitLen = BitLen_ }; diff --git a/libuavcan/include/uavcan/internal/marshalling/integer_spec.hpp b/libuavcan/include/uavcan/internal/marshalling/integer_spec.hpp index 0559adf8d6..e8eef7be6c 100644 --- a/libuavcan/include/uavcan/internal/marshalling/integer_spec.hpp +++ b/libuavcan/include/uavcan/internal/marshalling/integer_spec.hpp @@ -34,7 +34,7 @@ public: private: typedef typename IntegerSpec::StorageType UnsignedStorageType; - IntegerSpec() { } + IntegerSpec(); struct ExactSizeLimits { diff --git a/libuavcan/include/uavcan/internal/marshalling/types.hpp b/libuavcan/include/uavcan/internal/marshalling/types.hpp index cb9e42dc31..5f2f280811 100644 --- a/libuavcan/include/uavcan/internal/marshalling/types.hpp +++ b/libuavcan/include/uavcan/internal/marshalling/types.hpp @@ -6,12 +6,13 @@ #include #include +#include namespace uavcan { template -struct StorageTypeImpl { typedef T StorageType; }; +struct StorageTypeImpl { typedef T Type; }; template struct StorageTypeImpl::Type> @@ -20,8 +21,10 @@ struct StorageTypeImpl::Type> }; template -struct StorageType : public T +class StorageType : public T { + StorageType(); +public: typedef typename StorageTypeImpl::Type Type; };