Skip to content

Commit

Permalink
Cast msg fields to float.
Browse files Browse the repository at this point in the history
This is to avoid a warning on Windows.  It is safe to do
since the heartbeat timeout or period aren't expected to
be outside the range a float can represent.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Oct 10, 2023
1 parent 497ac4f commit 8a0b831
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bondcpp/src/bond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ void Bond::publishStatus(bool active)
msg.id = id_;
msg.instance_id = instance_id_;
msg.active = active;
msg.heartbeat_timeout = heartbeat_timeout_.seconds();
msg.heartbeat_period = heartbeat_period_.seconds();
msg.heartbeat_timeout = static_cast<float>(heartbeat_timeout_.seconds());
msg.heartbeat_period = static_cast<float>(heartbeat_period_.seconds());
pub_->publish(msg);
}

Expand Down

0 comments on commit 8a0b831

Please sign in to comment.