Using UAVCAN_PACKED_BEGIN/UAVCAN_PACKED_END macros globally

This commit is contained in:
Pavel Kirienko
2014-03-03 16:34:36 +04:00
parent 89f8925a76
commit f4112068c1
5 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ namespace uavcan
/**
* Raw CAN frame, as passed to/from the CAN driver.
*/
#pragma pack(push, 1)
UAVCAN_PACKED_BEGIN
struct CanFrame
{
static const uint32_t MaskStdID = 0x000007FF;
@@ -65,7 +65,7 @@ struct CanFrame
return (id & CanFrame::MaskExtID) > (rhs.id & CanFrame::MaskExtID);
}
};
#pragma pack(pop)
UAVCAN_PACKED_END
/**
* CAN hardware filter config struct. @ref ICanDriver::filter().
+2 -2
View File
@@ -25,7 +25,7 @@ namespace uavcan
template <typename Key, typename Value, unsigned int NumStaticEntries>
class Map : Noncopyable
{
#pragma pack(push, 1)
UAVCAN_PACKED_BEGIN
struct KVPair
{
Key key;
@@ -72,7 +72,7 @@ class Map : Noncopyable
return NULL;
}
};
#pragma pack(pop)
UAVCAN_PACKED_END
LinkedListRoot<KVGroup> list_;
IAllocator& allocator_;
@@ -13,7 +13,7 @@
namespace uavcan
{
#pragma pack(push, 1)
UAVCAN_PACKED_BEGIN
class OutgoingTransferRegistryKey
{
uint16_t data_type_id_;
@@ -47,7 +47,7 @@ public:
(destination_node_id_ == rhs.destination_node_id_);
}
};
#pragma pack(pop)
UAVCAN_PACKED_END
class IOutgoingTransferRegistry
@@ -62,14 +62,14 @@ public:
template <int NumStaticEntries>
class OutgoingTransferRegistry : public IOutgoingTransferRegistry, Noncopyable
{
#pragma pack(push, 1)
UAVCAN_PACKED_BEGIN
struct Value
{
uint64_t monotonic_deadline;
TransferID tid;
Value() : monotonic_deadline(0) { }
};
#pragma pack(pop)
UAVCAN_PACKED_END
class DeadlineExpiredPredicate
{
@@ -14,7 +14,7 @@
namespace uavcan
{
#pragma pack(push, 1)
UAVCAN_PACKED_BEGIN
/**
* API for transfer buffer users.
*/
@@ -140,7 +140,7 @@ public:
int read(unsigned int offset, uint8_t* data, unsigned int len) const;
int write(unsigned int offset, const uint8_t* data, unsigned int len);
};
#pragma pack(pop)
UAVCAN_PACKED_END
/**
* Standalone static buffer
@@ -11,7 +11,7 @@
namespace uavcan
{
#pragma pack(push, 1)
UAVCAN_PACKED_BEGIN
class TransferReceiver
{
public:
@@ -69,6 +69,6 @@ public:
uint32_t getInterval() const { return transfer_interval_; }
};
#pragma pack(pop)
UAVCAN_PACKED_END
}