-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #440 from ZettaScaleLabs/enforce_clang_format
Enforce clang formatting
- Loading branch information
Showing
29 changed files
with
889 additions
and
1,047 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include "zenoh.h" | ||
|
||
int main(int argc, char **argv) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
#include <stdio.h> | ||
|
||
#include "zenoh.h" | ||
|
||
const char *kind_to_str(z_sample_kind_t kind) { | ||
|
@@ -30,11 +31,9 @@ void handle_sample(const z_loaned_sample_t *sample) { | |
z_keyexpr_as_view_string(z_sample_keyexpr(sample), &keystr); | ||
z_owned_string_t payload_value; | ||
z_bytes_decode_into_string(z_sample_payload(sample), &payload_value); | ||
printf(">> [Subscriber] Received %s ('%.*s': '%.*s')\n", | ||
kind_to_str(z_sample_kind(sample)), | ||
(int)z_string_len(z_loan(keystr)), z_string_data(z_loan(keystr)), | ||
(int)z_string_len(z_loan(payload_value)), z_string_data(z_loan(payload_value)) | ||
); | ||
printf(">> [Subscriber] Received %s ('%.*s': '%.*s')\n", kind_to_str(z_sample_kind(sample)), | ||
(int)z_string_len(z_loan(keystr)), z_string_data(z_loan(keystr)), (int)z_string_len(z_loan(payload_value)), | ||
z_string_data(z_loan(payload_value))); | ||
z_drop(z_move(payload_value)); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
#include <stdio.h> | ||
|
||
#include "zenoh.h" | ||
|
||
const char *kind_to_str(z_sample_kind_t kind); | ||
|
@@ -23,10 +24,9 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { | |
z_owned_string_t payload_string; | ||
z_bytes_decode_into_string(z_sample_payload(sample), &payload_string); | ||
|
||
printf(">> [Subscriber] Received %s ('%.*s': '%.*s')\n", kind_to_str(z_sample_kind(sample)), | ||
(int)z_string_len(z_loan(key_string)), z_string_data(z_loan(key_string)), | ||
(int)z_string_len(z_loan(payload_string)), z_string_data(z_loan(payload_string)) | ||
); | ||
printf(">> [Subscriber] Received %s ('%.*s': '%.*s')\n", kind_to_str(z_sample_kind(sample)), | ||
(int)z_string_len(z_loan(key_string)), z_string_data(z_loan(key_string)), | ||
(int)z_string_len(z_loan(payload_string)), z_string_data(z_loan(payload_string))); | ||
z_drop(z_move(payload_string)); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
|
||
#include <stdio.h> | ||
|
||
#include "zenoh.h" | ||
|
||
void fprintpid(FILE *stream, z_id_t pid) { | ||
|
@@ -52,7 +53,7 @@ void fprintlocators(FILE *stream, const z_loaned_string_array_t *locs) { | |
fprintf(stream, "]"); | ||
} | ||
|
||
void fprinthello(FILE *stream, const z_loaned_hello_t* hello) { | ||
void fprinthello(FILE *stream, const z_loaned_hello_t *hello) { | ||
fprintf(stream, "Hello { pid: "); | ||
fprintpid(stream, z_hello_zid(hello)); | ||
fprintf(stream, ", whatami: "); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
#include <stdio.h> | ||
|
||
#include "zenoh.h" | ||
|
||
const char *kind_to_str(z_sample_kind_t kind); | ||
|
@@ -24,9 +25,8 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { | |
z_bytes_decode_into_string(z_sample_payload(sample), &payload_string); | ||
|
||
printf(">> [Subscriber] Received %s ('%.*s': '%.*s')\n", kind_to_str(z_sample_kind(sample)), | ||
(int)z_string_len(z_loan(key_string)), z_string_data(z_loan(key_string)), | ||
(int)z_string_len(z_loan(payload_string)), z_string_data(z_loan(payload_string)) | ||
); | ||
(int)z_string_len(z_loan(key_string)), z_string_data(z_loan(key_string)), | ||
(int)z_string_len(z_loan(payload_string)), z_string_data(z_loan(payload_string))); | ||
z_drop(z_move(payload_string)); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,21 +12,20 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
#include <stdio.h> | ||
|
||
#include "zenoh.h" | ||
|
||
void data_handler(const z_loaned_sample_t *sample, void *arg) { | ||
z_view_string_t key_string; | ||
z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_string); | ||
switch (z_sample_kind(sample)) { | ||
case Z_SAMPLE_KIND_PUT: | ||
printf(">> [LivelinessSubscriber] New alive token ('%.*s')\n", | ||
(int)z_string_len(z_loan(key_string)), z_string_data(z_loan(key_string)) | ||
); | ||
printf(">> [LivelinessSubscriber] New alive token ('%.*s')\n", (int)z_string_len(z_loan(key_string)), | ||
z_string_data(z_loan(key_string))); | ||
break; | ||
case Z_SAMPLE_KIND_DELETE: | ||
printf(">> [LivelinessSubscriber] Dropped token ('%.*s')\n", | ||
(int)z_string_len(z_loan(key_string)), z_string_data(z_loan(key_string)) | ||
); | ||
printf(">> [LivelinessSubscriber] Dropped token ('%.*s')\n", (int)z_string_len(z_loan(key_string)), | ||
z_string_data(z_loan(key_string))); | ||
break; | ||
} | ||
} | ||
|
Oops, something went wrong.