Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unused variable warning #379

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_final(_z_session_t *zn, _z_n_msg_response_final_t *final) {
int8_t ret = _Z_RES_OK;

#if Z_FEATURE_QUERY == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
// 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
Loading