diff --git a/libuavcan/include/uavcan/internal/marshalling/cast_mode.hpp b/libuavcan/include/uavcan/internal/marshalling/cast_mode.hpp deleted file mode 100644 index dc70a31249..0000000000 --- a/libuavcan/include/uavcan/internal/marshalling/cast_mode.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (C) 2014 Pavel Kirienko - */ - -#pragma once - -namespace uavcan -{ - -enum CastMode { CastModeSaturate, CastModeTruncate }; - -} diff --git a/libuavcan/include/uavcan/internal/marshalling/float_spec.hpp b/libuavcan/include/uavcan/internal/marshalling/float_spec.hpp index cdbc151897..9d7f4f13b3 100644 --- a/libuavcan/include/uavcan/internal/marshalling/float_spec.hpp +++ b/libuavcan/include/uavcan/internal/marshalling/float_spec.hpp @@ -8,7 +8,7 @@ #include #include // Needed for isfinite #include -#include +#include #include namespace uavcan diff --git a/libuavcan/include/uavcan/internal/marshalling/integer_spec.hpp b/libuavcan/include/uavcan/internal/marshalling/integer_spec.hpp index e8eef7be6c..3aecd0edf1 100644 --- a/libuavcan/include/uavcan/internal/marshalling/integer_spec.hpp +++ b/libuavcan/include/uavcan/internal/marshalling/integer_spec.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include namespace uavcan { diff --git a/libuavcan/include/uavcan/internal/marshalling/static_array.hpp b/libuavcan/include/uavcan/internal/marshalling/static_array.hpp index ba5e5b31cf..a1043b8e9a 100644 --- a/libuavcan/include/uavcan/internal/marshalling/static_array.hpp +++ b/libuavcan/include/uavcan/internal/marshalling/static_array.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include namespace uavcan { diff --git a/libuavcan/include/uavcan/internal/marshalling/type_util.hpp b/libuavcan/include/uavcan/internal/marshalling/type_util.hpp new file mode 100644 index 0000000000..5d6d2d2a12 --- /dev/null +++ b/libuavcan/include/uavcan/internal/marshalling/type_util.hpp @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2014 Pavel Kirienko + */ + +#pragma once + +#include + +namespace uavcan +{ + +enum CastMode { CastModeSaturate, CastModeTruncate }; + + +template +struct StorageTypeImpl { typedef T Type; }; + +template +struct StorageTypeImpl::Type> +{ + typedef typename T::StorageType Type; +}; + +template +class StorageType : public T +{ + StorageType(); +public: + typedef typename StorageTypeImpl::Type Type; +}; + +} diff --git a/libuavcan/include/uavcan/internal/marshalling/types.hpp b/libuavcan/include/uavcan/internal/marshalling/types.hpp index 5f2f280811..207323ab8a 100644 --- a/libuavcan/include/uavcan/internal/marshalling/types.hpp +++ b/libuavcan/include/uavcan/internal/marshalling/types.hpp @@ -4,28 +4,7 @@ #pragma once -#include #include #include - -namespace uavcan -{ - -template -struct StorageTypeImpl { typedef T Type; }; - -template -struct StorageTypeImpl::Type> -{ - typedef typename T::StorageType Type; -}; - -template -class StorageType : public T -{ - StorageType(); -public: - typedef typename StorageTypeImpl::Type Type; -}; - -} +#include +#include diff --git a/libuavcan/test/marshalling/float_spec.cpp b/libuavcan/test/marshalling/float_spec.cpp index 1cd1eba23c..48d4c8d3d3 100644 --- a/libuavcan/test/marshalling/float_spec.cpp +++ b/libuavcan/test/marshalling/float_spec.cpp @@ -3,7 +3,6 @@ */ #include -#include #include diff --git a/libuavcan/test/marshalling/integer_spec.cpp b/libuavcan/test/marshalling/integer_spec.cpp index cd63e2ffc9..732d7dfee1 100644 --- a/libuavcan/test/marshalling/integer_spec.cpp +++ b/libuavcan/test/marshalling/integer_spec.cpp @@ -3,7 +3,6 @@ */ #include -#include #include diff --git a/libuavcan/test/marshalling/static_array.cpp b/libuavcan/test/marshalling/static_array.cpp index 4c5dad3d57..7cf6beb06a 100644 --- a/libuavcan/test/marshalling/static_array.cpp +++ b/libuavcan/test/marshalling/static_array.cpp @@ -3,9 +3,6 @@ */ #include -#include -#include -#include #include