From 9a04bc6dbc962438f3fbb68fa84f23482de197f1 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Fri, 18 Apr 2014 16:32:20 +0400 Subject: [PATCH] SciTools Understand warning fixes --- .../libuavcan_dsdl_compiler/data_type_template.tmpl | 3 ++- libuavcan/include/uavcan/marshal/array.hpp | 2 +- libuavcan/include/uavcan/marshal/float_spec.hpp | 3 ++- libuavcan/include/uavcan/marshal/integer_spec.hpp | 3 ++- libuavcan/include/uavcan/marshal/type_util.hpp | 2 +- libuavcan/test/transport/transfer_test_helpers.hpp | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl index 2879d70062..0f7b3613da 100644 --- a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl +++ b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl @@ -303,8 +303,9 @@ namespace uavcan <%def name="define_yaml_streamer(type_name, fields)"> template <> -struct UAVCAN_EXPORT YamlStreamer< ${type_name} > +class UAVCAN_EXPORT YamlStreamer< ${type_name} > { +public: template static void stream(Stream& s, ${type_name}::ParameterType obj, const int level); }; diff --git a/libuavcan/include/uavcan/marshal/array.hpp b/libuavcan/include/uavcan/marshal/array.hpp index dd6a2c3942..fb4acfcac1 100644 --- a/libuavcan/include/uavcan/marshal/array.hpp +++ b/libuavcan/include/uavcan/marshal/array.hpp @@ -422,7 +422,7 @@ class UAVCAN_EXPORT Array : public ArrayImpl if (on_diagonal) { const SizeType source_index = (this->size() == 1) ? 0 : (index / Width); - *it++ = at(source_index); + *it++ = this->at(source_index); } else { diff --git a/libuavcan/include/uavcan/marshal/float_spec.hpp b/libuavcan/include/uavcan/marshal/float_spec.hpp index 5121b6d297..8e88d0abe9 100644 --- a/libuavcan/include/uavcan/marshal/float_spec.hpp +++ b/libuavcan/include/uavcan/marshal/float_spec.hpp @@ -184,10 +184,11 @@ private: template -struct UAVCAN_EXPORT YamlStreamer > +class UAVCAN_EXPORT YamlStreamer > { typedef typename FloatSpec::StorageType StorageType; +public: template static void stream(Stream& s, const StorageType value, int) { diff --git a/libuavcan/include/uavcan/marshal/integer_spec.hpp b/libuavcan/include/uavcan/marshal/integer_spec.hpp index dea500a3e5..487709883a 100644 --- a/libuavcan/include/uavcan/marshal/integer_spec.hpp +++ b/libuavcan/include/uavcan/marshal/integer_spec.hpp @@ -134,11 +134,12 @@ struct IsIntegerSpec > template -struct UAVCAN_EXPORT YamlStreamer > +class UAVCAN_EXPORT YamlStreamer > { typedef IntegerSpec RawType; typedef typename RawType::StorageType StorageType; +public: template static void stream(Stream& s, const StorageType value, int) { diff --git a/libuavcan/include/uavcan/marshal/type_util.hpp b/libuavcan/include/uavcan/marshal/type_util.hpp index 7b2e8bafec..edb248eef9 100644 --- a/libuavcan/include/uavcan/marshal/type_util.hpp +++ b/libuavcan/include/uavcan/marshal/type_util.hpp @@ -65,6 +65,6 @@ public: template -struct UAVCAN_EXPORT YamlStreamer; +class UAVCAN_EXPORT YamlStreamer; } diff --git a/libuavcan/test/transport/transfer_test_helpers.hpp b/libuavcan/test/transport/transfer_test_helpers.hpp index 261fa1f3b8..0f17ebcbd8 100644 --- a/libuavcan/test/transport/transfer_test_helpers.hpp +++ b/libuavcan/test/transport/transfer_test_helpers.hpp @@ -234,7 +234,7 @@ std::vector serializeTransfer(const Transfer& transfer) return output; } -uavcan::DataTypeDescriptor makeDataType(uavcan::DataTypeKind kind, uint16_t id, const char* name = "") +inline uavcan::DataTypeDescriptor makeDataType(uavcan::DataTypeKind kind, uint16_t id, const char* name = "") { const uavcan::DataTypeSignature signature((uint64_t(kind) << 16) | (id << 8) | (id & 0xFF)); return uavcan::DataTypeDescriptor(kind, id, signature, name);