Skip to content

Commit

Permalink
fix: remove unused variable warning (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland authored Mar 21, 2024
1 parent 7c724c3 commit 2f44c57
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/protocol/codec/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ int8_t _z_msg_ext_vec_decode(_z_msg_ext_vec_t *extensions, _z_zbuf_t *zbf) {
}

int8_t _z_msg_ext_unknown_error(_z_msg_ext_t *extension, uint8_t trace_id) {
uint8_t ext_id = _Z_EXT_ID(extension->_header);
#if (ZENOH_DEBUG >= 1)
uint8_t ext_id = _Z_EXT_ID(extension->_header);
switch (_Z_EXT_ENC(extension->_header)) {
case _Z_MSG_EXT_ENC_UNIT: {
_Z_ERROR("Unknown mandatory extension found (extension_id: %02x, trace_id: %02x), UNIT", ext_id, trace_id);
Expand All @@ -195,6 +195,9 @@ int8_t _z_msg_ext_unknown_error(_z_msg_ext_t *extension, uint8_t trace_id) {
trace_id);
}
}
#else
_ZP_UNUSED(extension);
_ZP_UNUSED(trace_id);
#endif
return _Z_ERR_MESSAGE_EXTENSION_MANDATORY_AND_UNKNOWN;
}
Expand Down
5 changes: 3 additions & 2 deletions src/session/reply.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ int8_t _z_trigger_reply_partial(_z_session_t *zn, _z_zint_t id, _z_keyexpr_t key
int8_t _z_trigger_reply_final(_z_session_t *zn, _z_n_msg_response_final_t *final) {
int8_t ret = _Z_RES_OK;

#if Z_FEATURE_QUERY == 1
// TODO check id to know where to dispatch
_z_zint_t id = final->_request_id;

#if Z_FEATURE_QUERY == 1
_z_trigger_query_reply_final(zn, id);
#else
_ZP_UNUSED(final);
#endif
return ret;
}
1 change: 1 addition & 0 deletions src/session/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ int8_t _z_handle_network_message(_z_session_t *zn, _z_zenoh_message_t *msg, uint
// @TODO: expose errors to the user
_z_msg_err_t error = response._body._err;
_z_bytes_t payload = error._ext_value.payload;
_ZP_UNUSED(payload); // Unused when logs are deactivated
_Z_ERROR("Received Err for query %zu: code=%d, message=%.*s", response._request_id, error._code,
(int)payload.len, payload.start);
} break;
Expand Down
5 changes: 4 additions & 1 deletion src/transport/unicast/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ int8_t _z_unicast_transport_create(_z_transport_t *zt, _z_link_t *zl, _z_transpo
_z_wbuf_clear(&zt->_transport._unicast._wbuf);
_z_zbuf_clear(&zt->_transport._unicast._zbuf);
}
#endif
#else
_ZP_UNUSED(dbuf_size);
_ZP_UNUSED(expandable);
#endif // Z_FEATURE_FRAGMENTATION == 1
}

if (ret == _Z_RES_OK) {
Expand Down

0 comments on commit 2f44c57

Please sign in to comment.