mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 04:03:33 +08:00
C++ compliance fixes
This commit is contained in:
@@ -21,9 +21,9 @@ struct UAVCAN_EXPORT CanFrame
|
||||
{
|
||||
static const uint32_t MaskStdID = 0x000007FF;
|
||||
static const uint32_t MaskExtID = 0x1FFFFFFF;
|
||||
static const uint32_t FlagEFF = 1 << 31; ///< Extended frame format
|
||||
static const uint32_t FlagRTR = 1 << 30; ///< Remote transmission request
|
||||
static const uint32_t FlagERR = 1 << 29; ///< Error frame
|
||||
static const uint32_t FlagEFF = 1U << 31; ///< Extended frame format
|
||||
static const uint32_t FlagRTR = 1U << 30; ///< Remote transmission request
|
||||
static const uint32_t FlagERR = 1U << 29; ///< Error frame
|
||||
|
||||
static const uint8_t MaxDataLen = 8;
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ template <std::size_t PoolSize, std::size_t BlockSize>
|
||||
PoolAllocator<PoolSize, BlockSize>::PoolAllocator()
|
||||
: free_list_(reinterpret_cast<Node*>(pool_.bytes))
|
||||
{
|
||||
memset(pool_.bytes, 0, PoolSize);
|
||||
std::memset(pool_.bytes, 0, PoolSize);
|
||||
for (unsigned i = 0; (i + 1) < (NumBlocks - 1 + 1); i++) // -Werror=type-limits
|
||||
{
|
||||
free_list_[i].next = free_list_ + i + 1;
|
||||
|
||||
@@ -107,7 +107,7 @@ int ScalarCodec::encode(const T value)
|
||||
uint8_t bytes[sizeof(T)];
|
||||
} byte_union;
|
||||
byte_union.value = value;
|
||||
clearExtraBits<BitLen>(byte_union.value);
|
||||
clearExtraBits<BitLen, T>(byte_union.value);
|
||||
convertByteOrder<BitLen>(byte_union.bytes);
|
||||
return encodeBytesImpl(byte_union.bytes, BitLen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user