Skip to content

Commit e310fa4

Browse files
committed
Compilation fix
1 parent 592a7e5 commit e310fa4

File tree

16 files changed

+50
-43
lines changed

16 files changed

+50
-43
lines changed

examples/arduino/z_get.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void reply_handler(z_owned_reply_t *oreply, void *ctx) {
5151
std::string val((const char *)z_sample_payload(sample)->start, z_sample_payload(sample)->len);
5252

5353
Serial.print(" >> [Get listener] Received (");
54-
Serial.print(z_str_loan(&keystr));
54+
Serial.print(z_str_data(z_str_loan(&keystr)));
5555
Serial.print(", ");
5656
Serial.print(val.c_str());
5757
Serial.println(")");

examples/arduino/z_pull.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
// std::string val((const char *)sample->payload.start, sample->payload.len);
4545

4646
// Serial.print(" >> [Subscription listener] Received (");
47-
// Serial.print(z_str_loan(&keystr));
47+
// Serial.print(z_str_data(z_str_loan(&keystr)));
4848
// Serial.print(", ");
4949
// Serial.print(val.c_str());
5050
// Serial.println(")");

examples/arduino/z_queryable.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void query_handler(const z_loaned_query_t *query, void *arg) {
4040
z_keyexpr_to_string(z_query_keyexpr(query), &keystr);
4141

4242
Serial.print(" >> [Queryable handler] Replying Data ('");
43-
Serial.print(z_str_loan(&keystr));
43+
Serial.print(z_str_data(z_str_loan(&keystr)));
4444
Serial.print("': '");
4545
Serial.print(VALUE);
4646
Serial.println("')");

examples/arduino/z_sub.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) {
4040
std::string val((const char *)z_sample_payload(sample)->start, z_sample_payload(sample)->len);
4141

4242
Serial.print(" >> [Subscription listener] Received (");
43-
Serial.print(z_str_loan(&keystr));
43+
Serial.print(z_str_data(z_str_loan(&keystr)));
4444
Serial.print(", ");
4545
Serial.print(val.c_str());
4646
Serial.println(")");

examples/espidf/z_queryable.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ void wifi_init_sta(void) {
104104
void query_handler(z_query_t *query, void *ctx) {
105105
(void)(ctx);
106106
z_owned_str_t keystr;
107-
z_keyexpr_to_string(z_query_keyexpr(query), &keystr);
108-
z_bytes_t pred = z_query_parameters(query);
109-
printf(">> [Queryable handler] Received Query '%s%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len, pred.start);
107+
// TODO(sashacmc): z_query_parameters
108+
// z_keyexpr_to_string(z_query_keyexpr(query), &keystr);
109+
// z_bytes_t pred = z_query_parameters(query);
110+
// printf(">> [Queryable handler] Received Query '%s%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len,
111+
// pred.start);
110112
z_view_keyexpr_t ke;
111113
z_view_keyexpr_from_string_unchecked(&ke, KEYEXPR);
112114
z_query_reply(query, z_loan(ke), (const unsigned char *)VALUE, strlen(VALUE), NULL);

examples/espidf/z_scout.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ void fprintlocators(FILE *stream, const z_str_array_t *locs) {
124124
fprintf(stream, "]");
125125
}
126126

127-
void fprinthello(FILE *stream, const z_hello_t hello) {
127+
void fprinthello(FILE *stream, const z_loaned_hello_t *hello) {
128128
fprintf(stream, "Hello { zid: ");
129-
fprintzid(stream, hello.zid);
129+
fprintzid(stream, hello->zid);
130130
fprintf(stream, ", whatami: ");
131-
fprintwhatami(stream, hello.whatami);
131+
fprintwhatami(stream, hello->whatami);
132132
fprintf(stream, ", locators: ");
133-
fprintlocators(stream, &hello.locators);
133+
fprintlocators(stream, &hello->locators);
134134
fprintf(stream, " }");
135135
}
136136

examples/freertos_plus_tcp/z_queryable.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ void query_handler(const z_loaned_query_t *query, void *ctx) {
3333
(void)(ctx);
3434
z_owned_str_t keystr;
3535
z_keyexpr_to_string(z_query_keyexpr(query), &keystr);
36-
z_bytes_t pred = z_query_parameters(query);
37-
z_value_t payload_value = z_query_value(query);
38-
printf(" >> [Queryable handler] Received Query '%s?%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len, pred.start);
39-
if (payload_value.payload.len > 0) {
40-
printf(" with value '%.*s'\n", (int)payload_value.payload.len, payload_value.payload.start);
41-
}
36+
// TODO(sashacmc): z_query_parameters
37+
// z_bytes_t pred = z_query_parameters(query);
38+
// z_value_t payload_value = z_query_value(query);
39+
// printf(" >> [Queryable handler] Received Query '%s?%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len,
40+
// pred.start); if (payload_value.payload.len > 0) {
41+
// printf(" with value '%.*s'\n", (int)payload_value.payload.len, payload_value.payload.start);
42+
// }
4243
z_query_reply_options_t options;
4344
z_query_reply_options_default(&options);
4445
options.encoding = z_encoding(Z_ENCODING_PREFIX_TEXT_PLAIN, NULL);

examples/freertos_plus_tcp/z_scout.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ void fprintlocators(FILE *stream, const z_str_array_t *locs) {
5858
fprintf(stream, "]");
5959
}
6060

61-
void fprinthello(FILE *stream, const z_hello_t hello) {
61+
void fprinthello(FILE *stream, const z_loaned_hello_t *hello) {
6262
fprintf(stream, "Hello { zid: ");
63-
fprintzid(stream, hello.zid);
63+
fprintzid(stream, hello->zid);
6464
fprintf(stream, ", whatami: ");
65-
fprintwhatami(stream, hello.whatami);
65+
fprintwhatami(stream, hello->whatami);
6666
fprintf(stream, ", locators: ");
67-
fprintlocators(stream, &hello.locators);
67+
fprintlocators(stream, &hello->locators);
6868
fprintf(stream, " }");
6969
}
7070

examples/unix/c11/z_queryable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) {
3535
(void)(ctx);
3636
z_owned_str_t keystr;
3737
z_keyexpr_to_string(z_query_keyexpr(query), &keystr);
38-
// TODO(sashacmc):
38+
// TODO(sashacmc): z_query_parameters
3939
// z_bytes_t pred = z_query_parameters(query);
4040
// z_value_t payload_value = z_query_value(query);
4141
// printf(">> [Queryable handler] Received Query '%s?%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len,

examples/windows/z_get.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void reply_handler(z_owned_reply_t *reply, void *ctx) {
3333
if (z_reply_is_ok(reply)) {
3434
const z_loaned_sample_t *sample = z_reply_ok(reply);
3535
z_owned_str_t keystr;
36-
z_keyexpr_to_string(sample.keyexpr, &keystr);
36+
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
3737
const z_loaned_bytes_t *payload = z_sample_payload(sample);
3838
printf(">> Received ('%s': '%.*s')\n", z_str_data(z_loan(keystr)), (int)payload->len, payload->start);
3939
z_drop(z_move(keystr));

examples/windows/z_queryable.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ void query_handler(const z_loaned_query_t *query, void *ctx) {
2525
(void)(ctx);
2626
z_owned_str_t keystr;
2727
z_keyexpr_to_string(z_query_keyexpr(query), &keystr);
28-
z_bytes_t pred = z_query_parameters(query);
29-
z_value_t payload_value = z_query_value(query);
30-
printf(" >> [Queryable handler] Received Query '%s?%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len, pred.start);
31-
if (payload_value.payload.len > 0) {
32-
printf(" with value '%.*s'\n", (int)payload_value.payload.len, payload_value.payload.start);
33-
}
28+
// TODO(sashacmc):
29+
// z_bytes_t pred = z_query_parameters(query);
30+
// z_value_t payload_value = z_query_value(query);
31+
// printf(" >> [Queryable handler] Received Query '%s?%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len,
32+
// pred.start);
33+
// if (payload_value.payload.len > 0) {
34+
// printf(" with value '%.*s'\n", (int)payload_value.payload.len, payload_value.payload.start);
35+
// }
3436
z_query_reply_options_t options;
3537
z_query_reply_options_default(&options);
3638
options.encoding = z_encoding(Z_ENCODING_PREFIX_TEXT_PLAIN, NULL);

examples/windows/z_scout.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ void fprintlocators(FILE *stream, const z_str_array_t *locs) {
5555
fprintf(stream, "]");
5656
}
5757

58-
void fprinthello(FILE *stream, const z_hello_t hello) {
58+
void fprinthello(FILE *stream, const z_loaned_hello_t *hello) {
5959
fprintf(stream, "Hello { zid: ");
60-
fprintzid(stream, hello.zid);
60+
fprintzid(stream, hello->zid);
6161
fprintf(stream, ", whatami: ");
62-
fprintwhatami(stream, hello.whatami);
62+
fprintwhatami(stream, hello->whatami);
6363
fprintf(stream, ", locators: ");
64-
fprintlocators(stream, &hello.locators);
64+
fprintlocators(stream, &hello->locators);
6565
fprintf(stream, " }");
6666
}
6767

examples/zephyr/z_get.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void reply_handler(z_owned_reply_t *oreply, void *ctx) {
3737
if (z_reply_is_ok(oreply)) {
3838
const z_loaned_sample_t *sample = z_reply_ok(oreply);
3939
z_owned_str_t keystr;
40-
z_keyexpr_to_string(sample.keyexpr, &keystr);
40+
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
4141
const z_loaned_bytes_t *payload = z_sample_payload(sample);
4242
printf(" >> Received ('%s': '%.*s')\n", z_str_data(z_loan(keystr)), (int)payload->len, payload->start);
4343
z_drop(z_move(keystr));

examples/zephyr/z_queryable.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ void query_handler(const z_loaned_query_t *query, void *ctx) {
3535
(void)(ctx);
3636
z_owned_str_t keystr;
3737
z_keyexpr_to_string(z_query_keyexpr(query), &keystr);
38-
z_bytes_t pred = z_query_parameters(query);
39-
printf(" >> [Queryable handler] Received Query '%s%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len, pred.start);
38+
// TODO(sashacmc): z_query_parameters
39+
// z_bytes_t pred = z_query_parameters(query);
40+
// printf(" >> [Queryable handler] Received Query '%s%.*s'\n", z_str_data(z_loan(keystr)), (int)pred.len,
41+
// pred.start);
4042
z_query_reply(query, z_query_keyexpr(query), (const unsigned char *)VALUE, strlen(VALUE), NULL);
4143
z_drop(z_move(keystr));
4244
}

examples/zephyr/z_scout.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ void fprintlocators(FILE *stream, const z_str_array_t *locs) {
5252
fprintf(stream, "]");
5353
}
5454

55-
void fprinthello(FILE *stream, const z_hello_t hello) {
55+
void fprinthello(FILE *stream, const z_loaned_hello_t *hello) {
5656
fprintf(stream, "Hello { zid: ");
57-
fprintzid(stream, hello.zid);
57+
fprintzid(stream, hello->zid);
5858
fprintf(stream, ", whatami: ");
59-
fprintwhatami(stream, hello.whatami);
59+
fprintwhatami(stream, hello->whatami);
6060
fprintf(stream, ", locators: ");
61-
fprintlocators(stream, &hello.locators);
61+
fprintlocators(stream, &hello->locators);
6262
fprintf(stream, " }");
6363
}
6464

tests/z_api_alignment_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,19 @@ int main(int argc, char **argv) {
145145
assert(_ret_bool);
146146
#ifdef ZENOH_PICO
147147
_ret_bool = zp_keyexpr_includes_null_terminated("demo/example/**", "demo/example/a");
148-
assert(_ret_int == 0);
148+
assert(_ret_bool);
149149
#endif
150150
_ret_bool = z_keyexpr_intersects(z_loan(key_demo_example_starstar), z_loan(key_demo_example_a));
151151
assert(_ret_bool);
152152
#ifdef ZENOH_PICO
153153
_ret_bool = zp_keyexpr_intersect_null_terminated("demo/example/**", "demo/example/a");
154-
assert(_ret_int == 0);
154+
assert(_ret_bool);
155155
#endif
156156
_ret_bool = z_keyexpr_equals(z_loan(key_demo_example_starstar), z_loan(key_demo_example));
157157
assert(!_ret_bool);
158158
#ifdef ZENOH_PICO
159159
_ret_bool = zp_keyexpr_equals_null_terminated("demo/example/**", "demo/example");
160-
assert(_ret_int == -1);
160+
assert(!_ret_bool);
161161
#endif
162162

163163
sleep(SLEEP);

0 commit comments

Comments
 (0)