mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 07:23:33 +08:00
SciTools Understand warning fixes
This commit is contained in:
@@ -303,8 +303,9 @@ namespace uavcan
|
|||||||
|
|
||||||
<%def name="define_yaml_streamer(type_name, fields)">
|
<%def name="define_yaml_streamer(type_name, fields)">
|
||||||
template <>
|
template <>
|
||||||
struct UAVCAN_EXPORT YamlStreamer< ${type_name} >
|
class UAVCAN_EXPORT YamlStreamer< ${type_name} >
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
template <typename Stream>
|
template <typename Stream>
|
||||||
static void stream(Stream& s, ${type_name}::ParameterType obj, const int level);
|
static void stream(Stream& s, ${type_name}::ParameterType obj, const int level);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
|
|||||||
if (on_diagonal)
|
if (on_diagonal)
|
||||||
{
|
{
|
||||||
const SizeType source_index = (this->size() == 1) ? 0 : (index / Width);
|
const SizeType source_index = (this->size() == 1) ? 0 : (index / Width);
|
||||||
*it++ = at(source_index);
|
*it++ = this->at(source_index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -184,10 +184,11 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
template <unsigned BitLen, CastMode CastMode>
|
template <unsigned BitLen, CastMode CastMode>
|
||||||
struct UAVCAN_EXPORT YamlStreamer<FloatSpec<BitLen, CastMode> >
|
class UAVCAN_EXPORT YamlStreamer<FloatSpec<BitLen, CastMode> >
|
||||||
{
|
{
|
||||||
typedef typename FloatSpec<BitLen, CastMode>::StorageType StorageType;
|
typedef typename FloatSpec<BitLen, CastMode>::StorageType StorageType;
|
||||||
|
|
||||||
|
public:
|
||||||
template <typename Stream>
|
template <typename Stream>
|
||||||
static void stream(Stream& s, const StorageType value, int)
|
static void stream(Stream& s, const StorageType value, int)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -134,11 +134,12 @@ struct IsIntegerSpec<IntegerSpec<BitLen, Signedness, CastMode> >
|
|||||||
|
|
||||||
|
|
||||||
template <unsigned BitLen, Signedness Signedness, CastMode CastMode>
|
template <unsigned BitLen, Signedness Signedness, CastMode CastMode>
|
||||||
struct UAVCAN_EXPORT YamlStreamer<IntegerSpec<BitLen, Signedness, CastMode> >
|
class UAVCAN_EXPORT YamlStreamer<IntegerSpec<BitLen, Signedness, CastMode> >
|
||||||
{
|
{
|
||||||
typedef IntegerSpec<BitLen, Signedness, CastMode> RawType;
|
typedef IntegerSpec<BitLen, Signedness, CastMode> RawType;
|
||||||
typedef typename RawType::StorageType StorageType;
|
typedef typename RawType::StorageType StorageType;
|
||||||
|
|
||||||
|
public:
|
||||||
template <typename Stream>
|
template <typename Stream>
|
||||||
static void stream(Stream& s, const StorageType value, int)
|
static void stream(Stream& s, const StorageType value, int)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,6 +65,6 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UAVCAN_EXPORT YamlStreamer;
|
class UAVCAN_EXPORT YamlStreamer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ std::vector<uavcan::RxFrame> serializeTransfer(const Transfer& transfer)
|
|||||||
return output;
|
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));
|
const uavcan::DataTypeSignature signature((uint64_t(kind) << 16) | (id << 8) | (id & 0xFF));
|
||||||
return uavcan::DataTypeDescriptor(kind, id, signature, name);
|
return uavcan::DataTypeDescriptor(kind, id, signature, name);
|
||||||
|
|||||||
Reference in New Issue
Block a user