mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 07:23:34 +08:00
Coverity 1304857 1304856 1304855
This commit is contained in:
@@ -167,7 +167,7 @@ private:
|
||||
|
||||
static const int32_t randomization_range_msec = AppendEntries::Request::DEFAULT_MAX_ELECTION_TIMEOUT_MS -
|
||||
AppendEntries::Request::DEFAULT_MIN_ELECTION_TIMEOUT_MS;
|
||||
|
||||
// coverity[dont_call]
|
||||
const int32_t random_msec = (std::rand() % randomization_range_msec) + 1;
|
||||
|
||||
randomized_activity_timeout_ =
|
||||
|
||||
@@ -438,6 +438,7 @@ static void runMainNode(const uavcan_linux::NodePtr& node)
|
||||
auto timer = node->makeTimer(uavcan::MonotonicDuration::fromMSec(10000), [&node](const uavcan::TimerEvent&)
|
||||
{
|
||||
node->logInfo("timer", "Your time is running out.");
|
||||
// coverity[dont_call]
|
||||
node->setVendorSpecificStatusCode(static_cast<std::uint16_t>(std::rand()));
|
||||
});
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ static void runForever(const uavcan_linux::NodePtr& node)
|
||||
auto do_nothing_once_a_minute = [&node](const uavcan::TimerEvent&)
|
||||
{
|
||||
node->logInfo("timer", "Another minute passed...");
|
||||
// coverity[dont_call]
|
||||
node->setVendorSpecificStatusCode(static_cast<std::uint16_t>(std::rand())); // Setting to an arbitrary value
|
||||
};
|
||||
auto timer = node->makeTimer(uavcan::MonotonicDuration::fromMSec(60000), do_nothing_once_a_minute);
|
||||
|
||||
Reference in New Issue
Block a user