mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 08:03:35 +08:00
Fixed type signedness through the entire codebase; driver interfaces do not use starndard types now
This commit is contained in:
@@ -16,7 +16,7 @@ namespace uavcan
|
||||
|
||||
enum Signedness { SignednessUnsigned, SignednessSigned };
|
||||
|
||||
template <unsigned int BitLen_, Signedness Signedness, CastMode CastMode>
|
||||
template <unsigned BitLen_, Signedness Signedness, CastMode CastMode>
|
||||
class IntegerSpec
|
||||
{
|
||||
struct ErrorNoSuchInteger;
|
||||
@@ -124,14 +124,14 @@ struct IsIntegerSpec
|
||||
enum { Result = 0 };
|
||||
};
|
||||
|
||||
template <unsigned int BitLen, Signedness Signedness, CastMode CastMode>
|
||||
template <unsigned BitLen, Signedness Signedness, CastMode CastMode>
|
||||
struct IsIntegerSpec<IntegerSpec<BitLen, Signedness, CastMode> >
|
||||
{
|
||||
enum { Result = 1 };
|
||||
};
|
||||
|
||||
|
||||
template <unsigned int BitLen, Signedness Signedness, CastMode CastMode>
|
||||
template <unsigned BitLen, Signedness Signedness, CastMode CastMode>
|
||||
struct YamlStreamer<IntegerSpec<BitLen, Signedness, CastMode> >
|
||||
{
|
||||
typedef IntegerSpec<BitLen, Signedness, CastMode> RawType;
|
||||
@@ -142,7 +142,7 @@ struct YamlStreamer<IntegerSpec<BitLen, Signedness, CastMode> >
|
||||
{
|
||||
// Get rid of character types - we want its integer representation, not ASCII code
|
||||
typedef typename Select<(sizeof(StorageType) >= sizeof(int)), StorageType,
|
||||
typename Select<RawType::IsSigned, int, unsigned int>::Result >::Result TempType;
|
||||
typename Select<RawType::IsSigned, int, unsigned>::Result >::Result TempType;
|
||||
s << TempType(value);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user