diff --git a/libuavcan/include/uavcan/marshal/float_spec.hpp b/libuavcan/include/uavcan/marshal/float_spec.hpp index 81ea17d509..b96485168b 100644 --- a/libuavcan/include/uavcan/marshal/float_spec.hpp +++ b/libuavcan/include/uavcan/marshal/float_spec.hpp @@ -50,10 +50,12 @@ public: static typename IntegerSpec::StorageType toIeee(typename NativeFloatSelector::Type value) { - typedef typename IntegerSpec::StorageType IntType; - typedef typename NativeFloatSelector::Type FloatType; - StaticAssert::check(); - union { IntType i; FloatType f; } u; + union + { + typename IntegerSpec::StorageType i; + typename NativeFloatSelector::Type f; + } u; + StaticAssert::check(); u.f = value; return u.i; } @@ -62,10 +64,12 @@ public: static typename NativeFloatSelector::Type toNative(typename IntegerSpec::StorageType value) { - typedef typename IntegerSpec::StorageType IntType; - typedef typename NativeFloatSelector::Type FloatType; - StaticAssert::check(); - union { IntType i; FloatType f; } u; + union + { + typename IntegerSpec::StorageType i; + typename NativeFloatSelector::Type f; + } u; + StaticAssert::check(); u.i = value; return u.f; } diff --git a/libuavcan/include/uavcan/node/global_data_type_registry.hpp b/libuavcan/include/uavcan/node/global_data_type_registry.hpp index fb4fde6599..56498092bc 100644 --- a/libuavcan/include/uavcan/node/global_data_type_registry.hpp +++ b/libuavcan/include/uavcan/node/global_data_type_registry.hpp @@ -142,7 +142,7 @@ GlobalDataTypeRegistry::RegistResult GlobalDataTypeRegistry::regist(DataTypeID i return RegistResultFrozen; } - static union EntryUnion + static union { uint8_t buffer[sizeof(Entry)]; long long _aligner_1; diff --git a/libuavcan_drivers/linux/include/uavcan_linux/clock.hpp b/libuavcan_drivers/linux/include/uavcan_linux/clock.hpp index 4fd2e5196d..29fb75fe46 100644 --- a/libuavcan_drivers/linux/include/uavcan_linux/clock.hpp +++ b/libuavcan_drivers/linux/include/uavcan_linux/clock.hpp @@ -70,7 +70,7 @@ public: virtual uavcan::MonotonicTime getMonotonic() const { - struct timespec ts; + timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) { throw Exception("Failed to get monotonic time");