Skip to content

Commit

Permalink
Fix uncrustify.
Browse files Browse the repository at this point in the history
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
  • Loading branch information
evshary committed Oct 11, 2024
1 parent a579a49 commit ac48ee9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ rmw_ret_t rmw_context_impl_s::Data::subscribe_to_ros_graph()
z_undeclare_subscriber(z_move(this->graph_subscriber_));
});
if (zc_liveliness_declare_subscriber(
z_loan(session_),
z_loan(session_),
&graph_subscriber_, z_loan(keyexpr),
z_move(callback), &sub_options) != Z_OK)
{
Expand Down Expand Up @@ -333,7 +333,8 @@ rmw_context_impl_s::rmw_context_impl_s(
}

///=============================================================================
rmw_context_impl_s::~rmw_context_impl_s() {
rmw_context_impl_s::~rmw_context_impl_s()
{
// std::lock_guard<std::recursive_mutex> lock(data_->mutex_);
// z_drop(z_move(data_->session_));
}
Expand Down
10 changes: 6 additions & 4 deletions rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,9 @@ rmw_ret_t PublisherData::publish(
z_result_t res = z_publisher_put(z_loan(pub_), z_move(payload), &options);
if (res != Z_OK) {
if (res == Z_ESESSION_CLOSED) {
RMW_ZENOH_LOG_WARN_NAMED("rmw_zenoh_cpp",
"unable to publish message since the zenoh session is closed");
RMW_ZENOH_LOG_WARN_NAMED(
"rmw_zenoh_cpp",
"unable to publish message since the zenoh session is closed");
} else {
RMW_SET_ERROR_MSG("unable to publish message");
return RMW_RET_ERROR;
Expand Down Expand Up @@ -368,8 +369,9 @@ rmw_ret_t PublisherData::publish_serialized_message(
z_result_t res = z_publisher_put(z_loan(pub_), z_move(payload), &options);
if (res != Z_OK) {
if (res == Z_ESESSION_CLOSED) {
RMW_ZENOH_LOG_WARN_NAMED("rmw_zenoh_cpp",
"unable to publish message since the zenoh session is closed");
RMW_ZENOH_LOG_WARN_NAMED(
"rmw_zenoh_cpp",
"unable to publish message since the zenoh session is closed");
} else {
RMW_SET_ERROR_MSG("unable to publish message");
return RMW_RET_ERROR;
Expand Down
7 changes: 4 additions & 3 deletions rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ std::shared_ptr<SubscriptionData> SubscriptionData::make(
// Make the initial query to hit all the PublicationCaches, using a query_selector with
// '*' in place of the queryable_prefix of each PublicationCache
const std::string selector = "*/" +
sub_data->entity_->topic_info()->topic_keyexpr_;
sub_data->entity_->topic_info()->topic_keyexpr_;
z_view_keyexpr_t selector_ke;
z_view_keyexpr_from_str(&selector_ke, selector.c_str());
sub_options.query_selector = z_loan(selector_ke);
Expand Down Expand Up @@ -291,7 +291,7 @@ std::shared_ptr<SubscriptionData> SubscriptionData::make(
auto free_token = rcpputils::make_scope_exit(
[sub_data]() {
if (sub_data != nullptr) {
z_drop(z_move(sub_data->token_ ));
z_drop(z_move(sub_data->token_));
}
});
if (zc_liveliness_declare_token(
Expand Down Expand Up @@ -556,7 +556,8 @@ void SubscriptionData::add_new_message(
const size_t gid_hash = hash_gid(msg->attachment.source_gid);
auto last_known_pub_it = last_known_published_msg_.find(gid_hash);
if (last_known_pub_it != last_known_published_msg_.end()) {
const int64_t seq_increment = std::abs(msg->attachment.sequence_number - last_known_pub_it->second);
const int64_t seq_increment = std::abs(msg->attachment.sequence_number -
last_known_pub_it->second);
if (seq_increment > 1) {
const size_t num_msg_lost = seq_increment - 1;
total_messages_lost_ += num_msg_lost;
Expand Down

0 comments on commit ac48ee9

Please sign in to comment.