Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed May 16, 2024
1 parent 5569bf8 commit af8b505
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/arduino/z_get.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions examples/arduino/z_sub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion examples/mbed/z_pull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
// }
Expand Down
3 changes: 2 additions & 1 deletion examples/unix/c99/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
3 changes: 2 additions & 1 deletion examples/unix/c99/z_sub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down
1 change: 1 addition & 0 deletions src/api/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//

#include "zenoh-pico/api/handlers.h"

#include "zenoh-pico/net/sample.h"
#include "zenoh-pico/system/platform.h"

Expand Down
1 change: 1 addition & 0 deletions src/net/reply.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>

#include "zenoh-pico/net/reply.h"

#include "zenoh-pico/session/utils.h"
#include "zenoh-pico/utils/logging.h"

Expand Down
3 changes: 2 additions & 1 deletion src/session/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#include "zenoh-pico/session/query.h"

#include <stddef.h>

#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"
Expand Down
3 changes: 2 additions & 1 deletion src/session/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#include "zenoh-pico/session/subscription.h"

#include <stddef.h>
#include <stdint.h>

Expand All @@ -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"

Expand Down

0 comments on commit af8b505

Please sign in to comment.