Skip to content

Commit

Permalink
fix: remove missed dedicated initializers (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland authored Dec 5, 2024
1 parent 11548a1 commit 88fbc3a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/zenoh-pico/protocol/definitions/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ static inline _z_qos_t _z_n_qos_create(bool express, z_congestion_control_t cong
return ret;
}
static inline z_priority_t _z_n_qos_get_priority(_z_n_qos_t n_qos) {
return (z_priority_t)(n_qos._val & 0x07 /* 0b111 */);
z_priority_t ret = n_qos._val & 0x07; // 0b0111
return ret;
}
static inline z_congestion_control_t _z_n_qos_get_congestion_control(_z_n_qos_t n_qos) {
return (n_qos._val & 0x08 /* 0b1000 */) ? Z_CONGESTION_CONTROL_BLOCK : Z_CONGESTION_CONTROL_DROP;
z_congestion_control_t ret =
(n_qos._val & 0x08) ? Z_CONGESTION_CONTROL_BLOCK : Z_CONGESTION_CONTROL_DROP; // 0b1000
return ret;
}
static inline bool _z_n_qos_get_express(_z_n_qos_t n_qos) { return (bool)(n_qos._val & 0x10 /* 0b10000 */); }
#define _z_n_qos_make(express, nodrop, priority) \
Expand Down

0 comments on commit 88fbc3a

Please sign in to comment.