diff --git a/src/protocol/codec/transport.c b/src/protocol/codec/transport.c index 62a15d6f0..0cff46a78 100644 --- a/src/protocol/codec/transport.c +++ b/src/protocol/codec/transport.c @@ -434,7 +434,7 @@ z_result_t _z_fragment_encode(_z_wbuf_t *wbf, uint8_t header, const _z_t_msg_fra z_result_t ret = _Z_RES_OK; _Z_DEBUG("Encoding _Z_TRANSPORT_FRAGMENT"); _Z_RETURN_IF_ERR(_z_zsize_encode(wbf, msg->_sn)) - if (msg->first == true) { + if (msg->first) { if (_Z_HAS_FLAG(header, _Z_FLAG_T_Z) == true) { _Z_RETURN_IF_ERR(_z_uint8_encode(wbf, _Z_MSG_EXT_ID_FRAGMENT_FIRST | _Z_MSG_EXT_MORE(msg->drop))); } else { @@ -442,7 +442,7 @@ z_result_t _z_fragment_encode(_z_wbuf_t *wbf, uint8_t header, const _z_t_msg_fra ret |= _Z_ERR_MESSAGE_SERIALIZATION_FAILED; } } - if (msg->drop == true) { + if (msg->drop) { if (_Z_HAS_FLAG(header, _Z_FLAG_T_Z) == true) { _Z_RETURN_IF_ERR(_z_uint8_encode(wbf, _Z_MSG_EXT_ID_FRAGMENT_DROP)); } else { diff --git a/src/protocol/definitions/transport.c b/src/protocol/definitions/transport.c index 6332cff48..a332626e6 100644 --- a/src/protocol/definitions/transport.c +++ b/src/protocol/definitions/transport.c @@ -292,7 +292,7 @@ _z_transport_message_t _z_t_msg_make_fragment(_z_zint_t sn, _z_slice_t payload, msg._body._fragment._sn = sn; msg._body._fragment._payload = payload; - if (first == true || drop == true) { + if (first || drop) { _Z_SET_FLAG(msg._header, _Z_FLAG_T_Z); } msg._body._fragment.first = first; diff --git a/src/transport/multicast/rx.c b/src/transport/multicast/rx.c index 0e03a1e03..5a099558c 100644 --- a/src/transport/multicast/rx.c +++ b/src/transport/multicast/rx.c @@ -229,13 +229,13 @@ z_result_t _z_multicast_handle_transport_message(_z_transport_multicast_t *ztm, } // Handle fragment markers if (_Z_PATCH_HAS_FRAGMENT_MARKERS(entry->_patch)) { - if (t_msg->_body._fragment.first == true) { + if (t_msg->_body._fragment.first) { _z_wbuf_clear(dbuf); } else if (_z_wbuf_len(dbuf) == 0) { _Z_DEBUG("First fragment received without the first marker"); break; } - if (t_msg->_body._fragment.drop == true) { + if (t_msg->_body._fragment.drop) { _z_wbuf_clear(dbuf); break; } diff --git a/src/transport/unicast/rx.c b/src/transport/unicast/rx.c index ad5b026e0..b737e7fa7 100644 --- a/src/transport/unicast/rx.c +++ b/src/transport/unicast/rx.c @@ -180,13 +180,13 @@ z_result_t _z_unicast_handle_transport_message(_z_transport_unicast_t *ztu, _z_t } // Handle fragment markers if (_Z_PATCH_HAS_FRAGMENT_MARKERS(ztu->_patch)) { - if (t_msg->_body._fragment.first == true) { + if (t_msg->_body._fragment.first) { _z_wbuf_clear(dbuf); } else if (_z_wbuf_len(dbuf) == 0) { _Z_DEBUG("First fragment received without the start marker"); break; } - if (t_msg->_body._fragment.drop == true) { + if (t_msg->_body._fragment.drop) { _z_wbuf_clear(dbuf); break; }