Skip to content

Commit

Permalink
chore: run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Oct 5, 2023
1 parent b2ac6bc commit 9a7472d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
6 changes: 3 additions & 3 deletions include/zenoh-pico/api/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -1142,9 +1142,9 @@ z_queryable_options_t z_queryable_options_default(void);
* Parameters:
* zs: A loaned instance of the the :c:type:`z_session_t` where to declare the subscriber.
* keyexpr: A loaned instance of :c:type:`z_keyexpr_t` to associate with the subscriber.
* callback: A moved instance of :c:type:`z_owned_closure_query_t` containing the callbacks to be called and the context
* to pass to them. options: The options to apply to the queryable. If ``NULL`` is passed, the default options will be
* applied.
* callback: A moved instance of :c:type:`z_owned_closure_query_t` containing the callbacks to be called and the
* context to pass to them. options: The options to apply to the queryable. If ``NULL`` is passed, the default options
* will be applied.
*
* Returns:
* A :c:type:`z_owned_queryable_t` with either a valid queryable or a failing queryable.
Expand Down
6 changes: 3 additions & 3 deletions include/zenoh-pico/link/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
* Z_LINK_CAPABILITY_MULTICAST: Bitmask to define and check if link is multicast.
*/
typedef enum {
Z_LINK_CAPABILITY_NONE = 0x00, // 0
Z_LINK_CAPABILITY_NONE = 0x00, // 0
Z_LINK_CAPABILITY_RELIABLE = 0x01, // 1 << 0
Z_LINK_CAPABILITY_STREAMED = 0x02, // 1 << 1
Z_LINK_CAPABILITY_MULTICAST = 0x04 // 1 << 2
Z_LINK_CAPABILITY_STREAMED = 0x02, // 1 << 1
Z_LINK_CAPABILITY_MULTICAST = 0x04 // 1 << 2
} _z_link_capabilities_t;

#define _Z_LINK_IS_RELIABLE(X) ((X & Z_LINK_CAPABILITY_RELIABLE) == Z_LINK_CAPABILITY_RELIABLE)
Expand Down
15 changes: 5 additions & 10 deletions tests/z_keyexpr_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#undef NDEBUG
#include <assert.h>

int main(void)
{
int main(void) {
assert(_z_keyexpr_intersects("a", strlen("a"), "a", strlen("a")));
assert(_z_keyexpr_intersects("a/b", strlen("a/b"), "a/b", strlen("a/b")));
assert(_z_keyexpr_intersects("*", strlen("*"), "abc", strlen("abc")));
Expand Down Expand Up @@ -339,8 +338,7 @@ int main(void)

// clang-format on

for (int i = 0; i < N; i++)
{
for (int i = 0; i < N; i++) {
const char *ke = input[i];
char *canon = (char *)malloc(128);
memset(canon, 0, 128);
Expand All @@ -350,15 +348,13 @@ int main(void)
printf("%s ", ke);
printf(" Status: %d : %d\n", status, expected[i]);
assert(status == expected[i]);
if (status == Z_KEYEXPR_CANON_SUCCESS)
{
if (status == Z_KEYEXPR_CANON_SUCCESS) {
printf(" Match: %.*s : %s\n", (int)canon_len, canon, canonized[i]);
assert(strncmp(canonized[i], canon, canon_len) == 0);
}
}

for (int i = 0; i < N; i++)
{
for (int i = 0; i < N; i++) {
const char *ke = input[i];
char *canon = (char *)malloc(128);
memset(canon, 0, 128);
Expand All @@ -368,8 +364,7 @@ int main(void)
printf("%s ", ke);
printf(" Status: %d : %d", status, expected[i]);
assert(status == expected[i]);
if (status == Z_KEYEXPR_CANON_SUCCESS)
{
if (status == Z_KEYEXPR_CANON_SUCCESS) {
printf(" Match: %.*s : %s", (int)canon_len, canon, canonized[i]);
assert(strcmp(canonized[i], canon) == 0);
}
Expand Down

0 comments on commit 9a7472d

Please sign in to comment.