Skip to content

Commit 2476c7f

Browse files
committed
Compilation fix
1 parent e310fa4 commit 2476c7f

File tree

6 files changed

+33
-29
lines changed

6 files changed

+33
-29
lines changed

examples/arduino/z_scout.ino

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,27 @@ void fprintwhatami(unsigned int whatami) {
5656

5757
void fprintlocators(const z_str_array_t *locs) {
5858
Serial.print("[");
59-
size_t len = z_str_array_len(locs);
60-
for (unsigned int i = 0; i < len; i++) {
61-
Serial.print("'");
62-
Serial.print(*z_str_array_get(locs, i));
63-
Serial.print("'");
64-
if (i < len - 1) {
65-
Serial.print(", ");
66-
}
67-
}
59+
(void)locs;
60+
// TODO(sashacmc): z_str_array_t
61+
// size_t len = z_str_array_len(locs);
62+
// for (unsigned int i = 0; i < len; i++) {
63+
// Serial.print("'");
64+
// Serial.print(*z_str_array_get(locs, i));
65+
// Serial.print("'");
66+
// if (i < len - 1) {
67+
// Serial.print(", ");
68+
// }
69+
//}
6870
Serial.print("]");
6971
}
7072

71-
void fprinthello(const z_hello_t hello) {
73+
void fprinthello(FILE *stream, const z_loaned_hello_t *hello) {
7274
Serial.print(" >> Hello { zid: ");
73-
fprintzid(hello.zid);
75+
fprintzid(hello->zid);
7476
Serial.print(", whatami: ");
75-
fprintwhatami(hello.whatami);
77+
fprintwhatami(hello->whatami);
7678
Serial.print(", locators: ");
77-
fprintlocators(&hello.locators);
79+
fprintlocators(&hello->locators);
7880
Serial.println(" }");
7981
}
8082

examples/espidf/z_sub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void wifi_init_sta(void) {
103103
void data_handler(const z_loaned_sample_t* sample, void* arg) {
104104
z_owned_str_t keystr;
105105
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
106-
const z_loaned_payload_t* payload = z_sample_payload(sample);
106+
const z_loaned_bytes_t* payload = z_sample_payload(sample);
107107
printf(" >> [Subscriber handler] Received ('%s': '%.*s')\n", z_str_data(z_str_loan(&keystr)), (int)payload->len,
108108
payload->start);
109109
z_str_drop(z_str_move(&keystr));

examples/freertos_plus_tcp/z_queryable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void app_main(void) {
7171

7272
z_view_keyexpr_t ke;
7373
if (z_view_keyexpr_from_string(&ke, KEYEXPR) < 0) {
74-
printf("%s is not a valid key expression", keyexpr);
74+
printf("%s is not a valid key expression", KEYEXPR);
7575
return -1;
7676
}
7777

examples/mbed/z_scout.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,26 @@ void fprintwhatami(FILE *stream, unsigned int whatami) {
5353

5454
void fprintlocators(FILE *stream, const z_str_array_t *locs) {
5555
fprintf(stream, "[");
56-
for (unsigned int i = 0; i < z_str_array_len(locs); i++) {
57-
fprintf(stream, "\"");
58-
fprintf(stream, "%s", *z_str_array_get(locs, i));
59-
fprintf(stream, "\"");
60-
if (i < z_str_array_len(locs) - 1) {
61-
fprintf(stream, ", ");
62-
}
63-
}
56+
(void)locs;
57+
// TODO(sashacmc): z_str_array_t
58+
// for (unsigned int i = 0; i < z_str_array_len(locs); i++) {
59+
// fprintf(stream, "\"");
60+
// fprintf(stream, "%s", *z_str_array_get(locs, i));
61+
// fprintf(stream, "\"");
62+
// if (i < z_str_array_len(locs) - 1) {
63+
// fprintf(stream, ", ");
64+
// }
65+
//}
6466
fprintf(stream, "]");
6567
}
6668

67-
void fprinthello(FILE *stream, const z_hello_t hello) {
69+
void fprinthello(FILE *stream, const z_loaned_hello_t *hello) {
6870
fprintf(stream, "Hello { zid: ");
69-
fprintzid(stream, hello.zid);
71+
fprintzid(stream, hello->zid);
7072
fprintf(stream, ", whatami: ");
71-
fprintwhatami(stream, hello.whatami);
73+
fprintwhatami(stream, hello->whatami);
7274
fprintf(stream, ", locators: ");
73-
fprintlocators(stream, &hello.locators);
75+
fprintlocators(stream, &hello->locators);
7476
fprintf(stream, " }");
7577
}
7678

examples/unix/c99/z_scout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void fprintwhatami(FILE *stream, unsigned int whatami) {
4343
void fprintlocators(FILE *stream, const z_str_array_t *locs) {
4444
fprintf(stream, "[");
4545
(void)locs;
46-
// TODO(sashacmc):
46+
// TODO(sashacmc): z_str_array_t
4747
// for (unsigned int i = 0; i < z_str_array_len(locs); i++) {
4848
// fprintf(stream, "\"");
4949
// fprintf(stream, "%s", *z_str_array_get(locs, i));

tests/z_api_alignment_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int main(int argc, char **argv) {
141141
z_view_keyexpr_from_string(&key_demo_example_a, "demo/example/a");
142142
z_view_keyexpr_from_string(&key_demo_example_starstar, "demo/example/**");
143143

144-
_ret_bool = z_keyexpr_includes(z_loan(key_demo_example_starstar), z_loan(key_demo_example_a));
144+
_Bool _ret_bool = z_keyexpr_includes(z_loan(key_demo_example_starstar), z_loan(key_demo_example_a));
145145
assert(_ret_bool);
146146
#ifdef ZENOH_PICO
147147
_ret_bool = zp_keyexpr_includes_null_terminated("demo/example/**", "demo/example/a");

0 commit comments

Comments
 (0)