Skip to content

Commit

Permalink
Fixed windows warning (#500)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
Signed-off-by: Yadunund <[email protected]>
Co-authored-by: Yadunund <[email protected]>
  • Loading branch information
ahcorde and Yadunund authored Mar 7, 2025
1 parent bab4c93 commit ce92cb2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <fastcdr/FastBuffer.h>

#include <algorithm>
#include <cinttypes>
#include <limits>
#include <memory>
Expand Down Expand Up @@ -518,10 +519,14 @@ void SubscriptionData::add_new_message(
msg->attachment.sequence_number() -
last_known_pub_it->second);
if (seq_increment > 1) {
const size_t num_msg_lost = seq_increment - 1;
int32_t num_msg_lost =
static_cast<int32_t>(std::clamp(
seq_increment - 1,
static_cast<int64_t>(std::numeric_limits<int32_t>::min()),
static_cast<int64_t>(std::numeric_limits<int32_t>::max())));
events_mgr_->update_event_status(
ZENOH_EVENT_MESSAGE_LOST,
num_msg_lost);
std::move(num_msg_lost));
}
}
// Always update the last known sequence number for the publisher.
Expand Down

0 comments on commit ce92cb2

Please sign in to comment.