From af8b5050c7eeb101c246ecd53ab1b25f2a86b752 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Thu, 16 May 2024 09:36:11 +0200 Subject: [PATCH] Fix formatting --- examples/arduino/z_get.ino | 2 +- examples/arduino/z_sub.ino | 6 +++--- examples/mbed/z_pull.cpp | 3 ++- examples/unix/c99/z_sub.c | 3 ++- examples/unix/c99/z_sub_st.c | 3 ++- src/api/handlers.c | 1 + src/net/reply.c | 1 + src/session/query.c | 3 ++- src/session/subscription.c | 3 ++- 9 files changed, 16 insertions(+), 9 deletions(-) diff --git a/examples/arduino/z_get.ino b/examples/arduino/z_get.ino index e11afb9fb..b0e78e654 100644 --- a/examples/arduino/z_get.ino +++ b/examples/arduino/z_get.ino @@ -45,7 +45,7 @@ void reply_dropper(void *ctx) { void reply_handler(z_owned_reply_t *oreply, void *ctx) { (void)(ctx); if (z_reply_is_ok(oreply)) { - const z_loaned_sample_t* sample = z_reply_ok(oreply); + const z_loaned_sample_t *sample = z_reply_ok(oreply); z_owned_str_t keystr; z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr); std::string val((const char *)z_sample_payload(sample)->start, z_sample_payload(sample)->len); diff --git a/examples/arduino/z_sub.ino b/examples/arduino/z_sub.ino index 252a6dec5..c5a79299e 100644 --- a/examples/arduino/z_sub.ino +++ b/examples/arduino/z_sub.ino @@ -35,9 +35,9 @@ #define KEYEXPR "demo/example/**" void data_handler(const z_loaned_sample_t *sample, void *arg) { - z_owned_str_t keystr; - z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr); - std::string val((const char *)z_sample_payload(sample)->start, z_sample_payload(sample)->len); + z_owned_str_t keystr; + z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr); + std::string val((const char *)z_sample_payload(sample)->start, z_sample_payload(sample)->len); Serial.print(" >> [Subscription listener] Received ("); Serial.print(z_str_loan(&keystr)); diff --git a/examples/mbed/z_pull.cpp b/examples/mbed/z_pull.cpp index 3cbd258ab..8beda1521 100644 --- a/examples/mbed/z_pull.cpp +++ b/examples/mbed/z_pull.cpp @@ -34,7 +34,8 @@ // void data_handler(const z_loaned_sample_t *sample, void *arg) { // z_owned_str_t keystr; // z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr); -// printf(" >> [Subscriber handler] Received ('%s': '%.*s')\n", z_str_data(z_str_loan(&keystr)), (int)sample->payload.len, +// printf(" >> [Subscriber handler] Received ('%s': '%.*s')\n", z_str_data(z_str_loan(&keystr)), +// (int)sample->payload.len, // sample->payload.start); // z_str_drop(z_str_move(&keystr)); // } diff --git a/examples/unix/c99/z_sub.c b/examples/unix/c99/z_sub.c index 6dde2a9c0..37b0699e0 100644 --- a/examples/unix/c99/z_sub.c +++ b/examples/unix/c99/z_sub.c @@ -25,7 +25,8 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { z_owned_str_t keystr; z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr); const z_loaned_bytes_t *payload = z_sample_payload(sample); - printf(">> [Subscriber] Received ('%s': '%.*s')\n", z_str_data(z_str_loan(&keystr)), (int)payload->len, payload->start); + printf(">> [Subscriber] Received ('%s': '%.*s')\n", z_str_data(z_str_loan(&keystr)), (int)payload->len, + payload->start); z_str_drop(z_str_move(&keystr)); } diff --git a/examples/unix/c99/z_sub_st.c b/examples/unix/c99/z_sub_st.c index d4ff76019..03f1cbf35 100644 --- a/examples/unix/c99/z_sub_st.c +++ b/examples/unix/c99/z_sub_st.c @@ -28,7 +28,8 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { z_owned_str_t keystr; z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr); const z_loaned_bytes_t *payload = z_sample_payload(sample); - printf(">> [Subscriber] Received ('%s': '%.*s')\n", z_str_data(z_str_loan(&keystr)), (int)payload->len, payload->start); + printf(">> [Subscriber] Received ('%s': '%.*s')\n", z_str_data(z_str_loan(&keystr)), (int)payload->len, + payload->start); z_str_drop(z_str_move(&keystr)); msg_nb++; } diff --git a/src/api/handlers.c b/src/api/handlers.c index 2e7c036e5..e133a5835 100644 --- a/src/api/handlers.c +++ b/src/api/handlers.c @@ -13,6 +13,7 @@ // #include "zenoh-pico/api/handlers.h" + #include "zenoh-pico/net/sample.h" #include "zenoh-pico/system/platform.h" diff --git a/src/net/reply.c b/src/net/reply.c index 70801f78f..f9ece5032 100644 --- a/src/net/reply.c +++ b/src/net/reply.c @@ -12,6 +12,7 @@ // ZettaScale Zenoh Team, #include "zenoh-pico/net/reply.h" + #include "zenoh-pico/session/utils.h" #include "zenoh-pico/utils/logging.h" diff --git a/src/session/query.c b/src/session/query.c index 806625b74..27dbceabf 100644 --- a/src/session/query.c +++ b/src/session/query.c @@ -12,13 +12,14 @@ // ZettaScale Zenoh Team, // +#include "zenoh-pico/session/query.h" + #include #include "zenoh-pico/config.h" #include "zenoh-pico/net/reply.h" #include "zenoh-pico/net/sample.h" #include "zenoh-pico/protocol/keyexpr.h" -#include "zenoh-pico/session/query.h" #include "zenoh-pico/session/resource.h" #include "zenoh-pico/session/utils.h" #include "zenoh-pico/utils/logging.h" diff --git a/src/session/subscription.c b/src/session/subscription.c index 13465f915..48397577e 100644 --- a/src/session/subscription.c +++ b/src/session/subscription.c @@ -12,6 +12,8 @@ // ZettaScale Zenoh Team, // +#include "zenoh-pico/session/subscription.h" + #include #include @@ -23,7 +25,6 @@ #include "zenoh-pico/protocol/keyexpr.h" #include "zenoh-pico/session/resource.h" #include "zenoh-pico/session/session.h" -#include "zenoh-pico/session/subscription.h" #include "zenoh-pico/session/utils.h" #include "zenoh-pico/utils/logging.h"