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