Skip to content

Commit ab578c2

Browse files
authored
Merge pull request #251 from eclipse-zenoh/fix_warnings
fix warnings when zenoh-pico included into C++ project
2 parents 8abd39b + e76e367 commit ab578c2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

include/zenoh-pico/protocol/core.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ static inline _Bool _z_keyexpr_is_local(const _z_keyexpr_t *key) {
109109
}
110110
static inline _z_mapping_t _z_keyexpr_mapping(uint16_t id, _Bool owns_suffix) {
111111
assert(id <= _Z_KEYEXPR_MAPPING_UNKNOWN_REMOTE);
112-
return (_z_mapping_t){._val = (uint16_t)((owns_suffix ? 0x8000 : 0) | id)};
112+
_z_mapping_t mapping = {(uint16_t)((owns_suffix ? 0x8000 : 0) | id)};
113+
return mapping;
113114
}
114115
static inline void _z_keyexpr_set_mapping(_z_keyexpr_t *ke, uint16_t id) {
115116
assert(id <= _Z_KEYEXPR_MAPPING_UNKNOWN_REMOTE);

include/zenoh-pico/protocol/keyexpr.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ _z_keyexpr_t _z_keyexpr_duplicate(_z_keyexpr_t src);
3030
_z_keyexpr_t _z_keyexpr_to_owned(_z_keyexpr_t src);
3131
_z_keyexpr_t _z_keyexpr_alias(_z_keyexpr_t src);
3232
_z_keyexpr_t _z_keyexpr_steal(_Z_MOVE(_z_keyexpr_t) src);
33-
static inline _z_keyexpr_t _z_keyexpr_null(void) { return (_z_keyexpr_t){._id = 0, ._mapping = {0}, ._suffix = NULL}; }
33+
static inline _z_keyexpr_t _z_keyexpr_null(void) {
34+
_z_keyexpr_t keyexpr = {0, {0}, NULL};
35+
return keyexpr;
36+
}
3437
_z_timestamp_t _z_timestamp_duplicate(const _z_timestamp_t *tstamp);
3538
void _z_timestamp_clear(_z_timestamp_t *tstamp);
3639
void _z_keyexpr_clear(_z_keyexpr_t *rk);

0 commit comments

Comments
 (0)