diff --git a/libuavcan/include/uavcan/marshal/array.hpp b/libuavcan/include/uavcan/marshal/array.hpp index fb4acfcac1..f0dd196605 100644 --- a/libuavcan/include/uavcan/marshal/array.hpp +++ b/libuavcan/include/uavcan/marshal/array.hpp @@ -495,6 +495,10 @@ public: pop_back(); } } + else + { + ; // Exact size + } } void resize(SizeType new_size) diff --git a/libuavcan/include/uavcan/marshal/float_spec.hpp b/libuavcan/include/uavcan/marshal/float_spec.hpp index 8e88d0abe9..1836ea4702 100644 --- a/libuavcan/include/uavcan/marshal/float_spec.hpp +++ b/libuavcan/include/uavcan/marshal/float_spec.hpp @@ -162,6 +162,10 @@ private: { value = -max(); } + else + { + ; // Valid range + } } } @@ -178,6 +182,10 @@ private: { value = -std::numeric_limits::infinity(); } + else + { + ; // Valid range + } } } }; diff --git a/libuavcan/include/uavcan/marshal/integer_spec.hpp b/libuavcan/include/uavcan/marshal/integer_spec.hpp index 487709883a..db4086d2ac 100644 --- a/libuavcan/include/uavcan/marshal/integer_spec.hpp +++ b/libuavcan/include/uavcan/marshal/integer_spec.hpp @@ -71,6 +71,10 @@ private: { value = min(); } + else + { + ; // Valid range + } } static void truncate(StorageType& value) { value &= mask(); } diff --git a/libuavcan/src/transport/uc_can_io.cpp b/libuavcan/src/transport/uc_can_io.cpp index c3d5b42062..a3afe5b92f 100644 --- a/libuavcan/src/transport/uc_can_io.cpp +++ b/libuavcan/src/transport/uc_can_io.cpp @@ -75,8 +75,11 @@ std::string CanTxQueue::Entry::toString() const break; } default: + { assert(0); str_qos = " "; + break; + } } return str_qos + frame.toString(); } diff --git a/libuavcan/src/transport/uc_dispatcher.cpp b/libuavcan/src/transport/uc_dispatcher.cpp index 932bf4446d..22f3e88c09 100644 --- a/libuavcan/src/transport/uc_dispatcher.cpp +++ b/libuavcan/src/transport/uc_dispatcher.cpp @@ -133,6 +133,10 @@ void Dispatcher::ListenerRegistry::handleFrame(const RxFrame& frame) { break; } + else + { + ; // Nothing to do with this one + } p = next; } } @@ -175,7 +179,10 @@ void Dispatcher::handleFrame(const CanRxFrame& can_frame) break; } default: + { assert(0); + break; + } } } diff --git a/libuavcan/src/transport/uc_frame.cpp b/libuavcan/src/transport/uc_frame.cpp index c81d06cc05..b8c800fe69 100644 --- a/libuavcan/src/transport/uc_frame.cpp +++ b/libuavcan/src/transport/uc_frame.cpp @@ -26,9 +26,11 @@ int Frame::getMaxPayloadLen() const return sizeof(payload_) - 1; } default: + { assert(0); return -ErrLogic; } + } } int Frame::setPayload(const uint8_t* data, unsigned len) @@ -86,7 +88,6 @@ bool Frame::parse(const CanFrame& can_frame) std::copy(can_frame.data, can_frame.data + can_frame.dlc, payload_); break; } - case TransferTypeServiceResponse: case TransferTypeServiceRequest: case TransferTypeMessageUnicast: @@ -104,10 +105,11 @@ bool Frame::parse(const CanFrame& can_frame) std::copy(can_frame.data + 1, can_frame.data + can_frame.dlc, payload_); break; } - default: + { return false; } + } return isValid(); } @@ -143,7 +145,6 @@ bool Frame::compile(CanFrame& out_can_frame) const std::copy(payload_, payload_ + payload_len_, out_can_frame.data); break; } - case TransferTypeServiceResponse: case TransferTypeServiceRequest: case TransferTypeMessageUnicast: @@ -154,11 +155,12 @@ bool Frame::compile(CanFrame& out_can_frame) const std::copy(payload_, payload_ + payload_len_, out_can_frame.data + 1); break; } - default: + { assert(0); return false; } + } return true; } diff --git a/libuavcan/src/uc_data_type.cpp b/libuavcan/src/uc_data_type.cpp index 6c71cb9bcf..d308b0c1a3 100644 --- a/libuavcan/src/uc_data_type.cpp +++ b/libuavcan/src/uc_data_type.cpp @@ -98,7 +98,10 @@ std::string DataTypeDescriptor::toString() const break; } default: + { assert(0); + break; + } } using namespace std; // For snprintf()