mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-12 10:53:35 +08:00
Compilation error fixes, thanks GCC 4.8
This commit is contained in:
@@ -167,7 +167,7 @@ public:
|
||||
return reinterpret_cast<const char*>(data_);
|
||||
}
|
||||
|
||||
ValueType& at(SizeType pos) { return data_[validateRange(pos)]; }
|
||||
ValueType& at(SizeType pos) { return data_[Base::validateRange(pos)]; }
|
||||
const ValueType& at(SizeType pos) const { return data_[Base::validateRange(pos)]; }
|
||||
|
||||
ValueType& operator[](SizeType pos) { return at(pos); }
|
||||
|
||||
@@ -29,12 +29,12 @@ public:
|
||||
|
||||
int broadcast(const DataType& message)
|
||||
{
|
||||
return publish(message, TransferTypeMessageBroadcast, NodeID::Broadcast);
|
||||
return BaseType::publish(message, TransferTypeMessageBroadcast, NodeID::Broadcast);
|
||||
}
|
||||
|
||||
int broadcast(const DataType& message, TransferID tid)
|
||||
{
|
||||
return publish(message, TransferTypeMessageBroadcast, NodeID::Broadcast, tid);
|
||||
return BaseType::publish(message, TransferTypeMessageBroadcast, NodeID::Broadcast, tid);
|
||||
}
|
||||
|
||||
int unicast(const DataType& message, NodeID dst_node_id)
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
assert(0);
|
||||
return -ErrInvalidParam;
|
||||
}
|
||||
return publish(message, TransferTypeMessageUnicast, dst_node_id);
|
||||
return BaseType::publish(message, TransferTypeMessageUnicast, dst_node_id);
|
||||
}
|
||||
|
||||
static MonotonicDuration getDefaultTxTimeout() { return MonotonicDuration::fromMSec(5); } // 5 ms --> 200 Hz max
|
||||
|
||||
@@ -175,7 +175,7 @@ bool Frame::isValid() const
|
||||
(src_node_id_ == dst_node_id_) ||
|
||||
((transfer_type_ == TransferTypeMessageBroadcast) != dst_node_id_.isBroadcast()) ||
|
||||
(transfer_type_ >= NumTransferTypes) ||
|
||||
(payload_len_ > getMaxPayloadLen()) ||
|
||||
(static_cast<int>(payload_len_) > getMaxPayloadLen()) ||
|
||||
(!data_type_id_.isValid());
|
||||
|
||||
return !invalid;
|
||||
@@ -213,7 +213,7 @@ std::string Frame::toString() const
|
||||
int(data_type_id_.get()), int(transfer_type_), int(src_node_id_.get()),
|
||||
int(dst_node_id_.get()), int(frame_index_), int(last_frame_), int(transfer_id_.get()));
|
||||
|
||||
for (int i = 0; i < payload_len_; i++)
|
||||
for (unsigned i = 0; i < payload_len_; i++)
|
||||
{
|
||||
ofs += snprintf(buf + ofs, BUFLEN - ofs, "%02x", payload_[i]);
|
||||
if ((i + 1) < payload_len_)
|
||||
|
||||
@@ -187,12 +187,12 @@ TransferReceiver::ResultCode TransferReceiver::receive(const RxFrame& frame, Tra
|
||||
|
||||
bool TransferReceiver::isTimedOut(MonotonicTime current_ts) const
|
||||
{
|
||||
static const uint64_t INTERVAL_MULT = (1 << TransferID::BitLen) / 2 + 1;
|
||||
static const int64_t INTERVAL_MULT = (1 << TransferID::BitLen) / 2 + 1;
|
||||
if (current_ts <= this_transfer_ts_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return (current_ts - this_transfer_ts_).toUSec() > (uint64_t(transfer_interval_usec_) * INTERVAL_MULT);
|
||||
return (current_ts - this_transfer_ts_).toUSec() > (int64_t(transfer_interval_usec_) * INTERVAL_MULT);
|
||||
}
|
||||
|
||||
TransferReceiver::ResultCode TransferReceiver::addFrame(const RxFrame& frame, TransferBufferAccessor& tba)
|
||||
@@ -210,7 +210,7 @@ TransferReceiver::ResultCode TransferReceiver::addFrame(const RxFrame& frame, Tr
|
||||
const bool first_fame = frame.isFirst();
|
||||
const TidRelation tid_rel = getTidRelation(frame);
|
||||
const bool iface_timed_out =
|
||||
(frame.getMonotonicTimestamp() - this_transfer_ts_).toUSec() > (uint64_t(transfer_interval_usec_) * 2);
|
||||
(frame.getMonotonicTimestamp() - this_transfer_ts_).toUSec() > (int64_t(transfer_interval_usec_) * 2);
|
||||
|
||||
// FSM, the hard way
|
||||
const bool need_restart =
|
||||
|
||||
Reference in New Issue
Block a user