mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 03:03:34 +08:00
Dynamic array test
This commit is contained in:
@@ -87,7 +87,7 @@ protected:
|
||||
public:
|
||||
SizeType size() const
|
||||
{
|
||||
assert(size_ <= MaxSize);
|
||||
assert(size_ ? ((size_ - 1u) <= (MaxSize - 1u)) : 1); // -Werror=type-limits
|
||||
return size_;
|
||||
}
|
||||
|
||||
@@ -212,6 +212,7 @@ public:
|
||||
enum { IsDynamic = ArrayMode == ArrayModeDynamic };
|
||||
enum { MaxSize = MaxSize_ };
|
||||
enum { MinBitLen = IsDynamic ? 0 : (RawValueType::MinBitLen * MaxSize) };
|
||||
enum { MaxBitLen = RawValueType::MaxBitLen * MaxSize };
|
||||
|
||||
static int encode(const SelfType& array, ScalarCodec& codec)
|
||||
{
|
||||
|
||||
@@ -100,6 +100,7 @@ class FloatSpec : public IEEE754Limits<BitLen_>
|
||||
public:
|
||||
enum { BitLen = BitLen_ };
|
||||
enum { MinBitLen = BitLen };
|
||||
enum { MaxBitLen = BitLen };
|
||||
|
||||
typedef typename NativeFloatSelector<BitLen>::Type StorageType;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ class IntegerSpec
|
||||
public:
|
||||
enum { BitLen = BitLen_ };
|
||||
enum { MinBitLen = BitLen };
|
||||
enum { MaxBitLen = BitLen };
|
||||
|
||||
typedef typename StaticIf<(BitLen <= 8), typename StaticIf<IsSigned, int8_t, uint8_t>::Result,
|
||||
typename StaticIf<(BitLen <= 16), typename StaticIf<IsSigned, int16_t, uint16_t>::Result,
|
||||
|
||||
@@ -18,6 +18,7 @@ template <>
|
||||
struct IntegerBitLen<0> { enum { Result = 0 }; };
|
||||
|
||||
|
||||
// TODO: fix
|
||||
template <typename T, typename Enable = void>
|
||||
struct StorageTypeImpl { typedef T Type; };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user