mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 02:41:35 +08:00
cppcheck warning suppressions
This commit is contained in:
@@ -168,7 +168,7 @@ struct UAVCAN_EXPORT IsDynamicallyAllocatable
|
|||||||
{
|
{
|
||||||
static void check()
|
static void check()
|
||||||
{
|
{
|
||||||
char dummy[(sizeof(T) <= MemPoolBlockSize) ? 1 : -1];
|
char dummy[(sizeof(T) <= MemPoolBlockSize) ? 1 : -1] = { '0' };
|
||||||
(void)dummy;
|
(void)dummy;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ class UAVCAN_EXPORT YamlStreamer<FloatSpec<BitLen, CastMode> >
|
|||||||
typedef typename FloatSpec<BitLen, CastMode>::StorageType StorageType;
|
typedef typename FloatSpec<BitLen, CastMode>::StorageType StorageType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename Stream>
|
template <typename Stream> // cppcheck-suppress passedByValue
|
||||||
static void stream(Stream& s, const StorageType value, int)
|
static void stream(Stream& s, const StorageType value, int)
|
||||||
{
|
{
|
||||||
s << value;
|
s << value;
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ class UAVCAN_EXPORT YamlStreamer<IntegerSpec<BitLen, Signedness, CastMode> >
|
|||||||
typedef typename RawType::StorageType StorageType;
|
typedef typename RawType::StorageType StorageType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename Stream>
|
template <typename Stream> // cppcheck-suppress passedByValue
|
||||||
static void stream(Stream& s, const StorageType value, int)
|
static void stream(Stream& s, const StorageType value, int)
|
||||||
{
|
{
|
||||||
// Get rid of character types - we want its integer representation, not ASCII code
|
// Get rid of character types - we want its integer representation, not ASCII code
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ private:
|
|||||||
uint32_t response_failure_count_;
|
uint32_t response_failure_count_;
|
||||||
ResponseType response_;
|
ResponseType response_;
|
||||||
|
|
||||||
void handleReceivedDataStruct(ReceivedDataStructure<RequestType>& request)
|
virtual void handleReceivedDataStruct(ReceivedDataStructure<RequestType>& request)
|
||||||
{
|
{
|
||||||
UAVCAN_ASSERT(request.getTransferType() == TransferTypeServiceRequest);
|
UAVCAN_ASSERT(request.getTransferType() == TransferTypeServiceRequest);
|
||||||
if (try_implicit_cast<bool>(callback_, true))
|
if (try_implicit_cast<bool>(callback_, true))
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ private:
|
|||||||
|
|
||||||
Callback callback_;
|
Callback callback_;
|
||||||
|
|
||||||
void handleReceivedDataStruct(ReceivedDataStructure<DataType_>& msg)
|
virtual void handleReceivedDataStruct(ReceivedDataStructure<DataType_>& msg)
|
||||||
{
|
{
|
||||||
if (try_implicit_cast<bool>(callback_, true))
|
if (try_implicit_cast<bool>(callback_, true))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ static inline bool isnan(T arg)
|
|||||||
#if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
|
#if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
|
||||||
return std::isnan(arg);
|
return std::isnan(arg);
|
||||||
#else
|
#else
|
||||||
|
// cppcheck-suppress duplicateExpression
|
||||||
return arg != arg;
|
return arg != arg;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ struct PairableCanDriver : public uavcan::ICanDriver, public uavcan::ICanIface
|
|||||||
assert(other);
|
assert(other);
|
||||||
if (inout_masks.read == 1)
|
if (inout_masks.read == 1)
|
||||||
{
|
{
|
||||||
inout_masks.read = (read_queue.size() || loopback_queue.size()) ? 1 : 0;
|
inout_masks.read = (!read_queue.empty() || !loopback_queue.empty()) ? 1 : 0;
|
||||||
}
|
}
|
||||||
if (inout_masks.read || inout_masks.write)
|
if (inout_masks.read || inout_masks.write)
|
||||||
{
|
{
|
||||||
@@ -160,8 +160,7 @@ struct InterlinkedTestNodes
|
|||||||
nspins2 = nspins2 ? nspins2 : 1;
|
nspins2 = nspins2 ? nspins2 : 1;
|
||||||
while (nspins2 --> 0)
|
while (nspins2 --> 0)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = a.spin(uavcan::MonotonicDuration::fromMSec(1));
|
||||||
ret = a.spin(uavcan::MonotonicDuration::fromMSec(1));
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user