Skip to content

Commit

Permalink
chore: make iron ament_uncrustify happy
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan committed Sep 5, 2024
1 parent c0a7533 commit 798b006
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 24 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: check uncrustify version
run: sudo apt update -y && sudo apt install -y ros-iron-ament-uncrustify
- name: uncrustify
run: /ros_entrypoint.sh ament_uncrustify rmw_zenoh_cpp/ --exclude rmw_zenoh_cpp/src/detail/ordered_hash.hpp rmw_zenoh_cpp/src/detail/ordered_map.hpp
- name: cpplint
Expand Down
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/detail/attachment_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ z_result_t attachement_data_t::serialize_to_zbytes(z_owned_bytes_t * attachment)
}

bool get_attachment(
const z_loaned_bytes_t *const attachment,
const z_loaned_bytes_t * const attachment,
const std::string & key, z_owned_bytes_t * val)
{
if (z_bytes_is_empty(attachment)) {
Expand Down Expand Up @@ -104,7 +104,7 @@ bool get_attachment(
}

bool get_gid_from_attachment(
const z_loaned_bytes_t *const attachment,
const z_loaned_bytes_t * const attachment,
uint8_t gid[RMW_GID_STORAGE_SIZE])
{
if (z_bytes_is_empty(attachment)) {
Expand All @@ -131,7 +131,7 @@ bool get_gid_from_attachment(
}

int64_t get_int64_from_attachment(
const z_loaned_bytes_t *const attachment,
const z_loaned_bytes_t * const attachment,
const std::string & name)
{
// A valid request must have had an attachment
Expand Down
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/detail/attachment_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ class attachement_context_t final
};

bool get_attachment(
const z_loaned_bytes_t *const attachment,
const z_loaned_bytes_t * const attachment,
const std::string & key, z_owned_bytes_t * val);

bool get_gid_from_attachment(
const z_loaned_bytes_t *const attachment,
const z_loaned_bytes_t * const attachment,
uint8_t gid[RMW_GID_STORAGE_SIZE]);

int64_t get_int64_from_attachment(
const z_loaned_bytes_t *const attachment,
const z_loaned_bytes_t * const attachment,
const std::string & name);
} // namespace rmw_zenoh_cpp

Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/graph_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,8 @@ rmw_ret_t GraphCache::get_node_names(
rcutils_ret_t ret = rcutils_string_array_fini(enclaves);
if (ret != RCUTILS_RET_OK) {
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"failed to cleanup during error handling: %s", rcutils_get_error_string().str);
"rmw_zenoh_cpp",
"failed to cleanup during error handling: %s", rcutils_get_error_string().str);
}
};

Expand Down
10 changes: 5 additions & 5 deletions rmw_zenoh_cpp/src/detail/logging_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
// invoke GraphCache::parse_put() and GraphCache::parse_del() functions.
// See https://github.com/ros2/rmw_zenoh/issues/182 for more details.
#define RMW_ZENOH_LOG_DEBUG_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_DEBUG, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_DEBUG, __func__, __FILE__, __LINE__, __VA_ARGS__);}
#define RMW_ZENOH_LOG_ERROR_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_ERROR, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_ERROR, __func__, __FILE__, __LINE__, __VA_ARGS__);}
#define RMW_ZENOH_LOG_FATAL_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_FATAL, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_FATAL, __func__, __FILE__, __LINE__, __VA_ARGS__);}
#define RMW_ZENOH_LOG_INFO_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_INFO, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_INFO, __func__, __FILE__, __LINE__, __VA_ARGS__);}
#define RMW_ZENOH_LOG_WARN_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_WARN, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_WARN, __func__, __FILE__, __LINE__, __VA_ARGS__);}

#endif // DETAIL__LOGGING_MACROS_HPP_
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/qos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace rmw_zenoh_cpp
{
//==============================================================================
/// Signature matching rmw_get_publishers_info_by_topic and rmw_get_subscriptions_info_by_topic
using GetEndpointInfoByTopicFunction = std::function<rmw_ret_t (
using GetEndpointInfoByTopicFunction = std::function<rmw_ret_t(
const rmw_node_t *,
rcutils_allocator_t *,
const char *,
Expand Down
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/detail/zenoh_router_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ rmw_ret_t zenoh_router_check(const z_loaned_session_t * session)
auto callback = [](const struct z_id_t * id, void * ctx) {
const std::string id_str = liveliness::zid_to_str(*id);
RMW_ZENOH_LOG_INFO_NAMED(
"rmw_zenoh_cpp",
"Successfully connected to a Zenoh router with id %s.", id_str.c_str());
// Note: Callback is guaranteed to never be called
// concurrently according to z_info_routers_zid docstring
"rmw_zenoh_cpp",
"Successfully connected to a Zenoh router with id %s.", id_str.c_str());
// Note: Callback is guaranteed to never be called
// concurrently according to z_info_routers_zid docstring
(*(static_cast<int *>(ctx)))++;
};

Expand Down
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3392,10 +3392,10 @@ rmw_ret_t rmw_destroy_wait_set(rmw_wait_set_t * wait_set)
namespace
{
bool check_and_attach_condition(
const rmw_subscriptions_t *const subscriptions,
const rmw_guard_conditions_t *const guard_conditions,
const rmw_services_t *const services, const rmw_clients_t *const clients,
const rmw_events_t *const events,
const rmw_subscriptions_t * const subscriptions,
const rmw_guard_conditions_t * const guard_conditions,
const rmw_services_t * const services, const rmw_clients_t * const clients,
const rmw_events_t * const events,
rmw_zenoh_cpp::rmw_wait_set_data_t * wait_set_data)
{
if (guard_conditions) {
Expand Down

0 comments on commit 798b006

Please sign in to comment.