From 798b006192e69062a9c215ef4fe52622daa55aac Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Fri, 6 Sep 2024 00:25:14 +0800 Subject: [PATCH] chore: make iron ament_uncrustify happy --- .github/workflows/style.yaml | 2 -- rmw_zenoh_cpp/src/detail/attachment_helpers.cpp | 6 +++--- rmw_zenoh_cpp/src/detail/attachment_helpers.hpp | 6 +++--- rmw_zenoh_cpp/src/detail/graph_cache.cpp | 4 ++-- rmw_zenoh_cpp/src/detail/logging_macros.hpp | 10 +++++----- rmw_zenoh_cpp/src/detail/qos.hpp | 2 +- rmw_zenoh_cpp/src/detail/zenoh_router_check.cpp | 8 ++++---- rmw_zenoh_cpp/src/rmw_zenoh.cpp | 8 ++++---- 8 files changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index 05f50511..1581e8c7 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -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 diff --git a/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp b/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp index 8ce5348b..fe100f21 100644 --- a/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp +++ b/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp @@ -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)) { @@ -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)) { @@ -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 diff --git a/rmw_zenoh_cpp/src/detail/attachment_helpers.hpp b/rmw_zenoh_cpp/src/detail/attachment_helpers.hpp index 2d663706..d01d3e8f 100644 --- a/rmw_zenoh_cpp/src/detail/attachment_helpers.hpp +++ b/rmw_zenoh_cpp/src/detail/attachment_helpers.hpp @@ -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 diff --git a/rmw_zenoh_cpp/src/detail/graph_cache.cpp b/rmw_zenoh_cpp/src/detail/graph_cache.cpp index e5928237..ceccbe82 100644 --- a/rmw_zenoh_cpp/src/detail/graph_cache.cpp +++ b/rmw_zenoh_cpp/src/detail/graph_cache.cpp @@ -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); } }; diff --git a/rmw_zenoh_cpp/src/detail/logging_macros.hpp b/rmw_zenoh_cpp/src/detail/logging_macros.hpp index 44a4bc34..81201856 100644 --- a/rmw_zenoh_cpp/src/detail/logging_macros.hpp +++ b/rmw_zenoh_cpp/src/detail/logging_macros.hpp @@ -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_ diff --git a/rmw_zenoh_cpp/src/detail/qos.hpp b/rmw_zenoh_cpp/src/detail/qos.hpp index 6b8e9230..eee74c05 100644 --- a/rmw_zenoh_cpp/src/detail/qos.hpp +++ b/rmw_zenoh_cpp/src/detail/qos.hpp @@ -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(ctx)))++; }; diff --git a/rmw_zenoh_cpp/src/rmw_zenoh.cpp b/rmw_zenoh_cpp/src/rmw_zenoh.cpp index a5aff757..96741c62 100644 --- a/rmw_zenoh_cpp/src/rmw_zenoh.cpp +++ b/rmw_zenoh_cpp/src/rmw_zenoh.cpp @@ -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) {