Skip to content

Commit

Permalink
refactor: rename ambiguous functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Feb 19, 2024
1 parent ecdd57b commit 18649c3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions include/zenoh-pico/session/interest.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ void _z_unregister_interest(_z_session_t *zn, _z_session_interest_rc_t *intr);
void _z_flush_interest(_z_session_t *zn);
#endif // Z_FEATURE_INTEREST == 1

int8_t _z_interest_process_declare(_z_session_t *zn, const _z_declaration_t *decl);
int8_t _z_interest_process_undeclare(_z_session_t *zn, const _z_declaration_t *decl);
int8_t _z_process_final_interest(_z_session_t *zn, uint32_t id);
int8_t _z_process_undeclare_interest(_z_session_t *zn, uint32_t id);
int8_t _z_process_declare_interest(_z_session_t *zn, _z_keyexpr_t key, uint32_t id, uint8_t flags);
int8_t _z_interest_process_declares(_z_session_t *zn, const _z_declaration_t *decl);
int8_t _z_interest_process_undeclares(_z_session_t *zn, const _z_declaration_t *decl);
int8_t _z_interest_process_final_interest(_z_session_t *zn, uint32_t id);
int8_t _z_interest_process_undeclare_interest(_z_session_t *zn, uint32_t id);
int8_t _z_interest_process_declare_interest(_z_session_t *zn, _z_keyexpr_t key, uint32_t id, uint8_t flags);

#endif /* ZENOH_PICO_SESSION_INTEREST_H */
20 changes: 10 additions & 10 deletions src/session/interest.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ _z_session_interest_rc_t *_z_register_interest(_z_session_t *zn, _z_session_inte
return ret;
}

int8_t _z_interest_process_declare(_z_session_t *zn, const _z_declaration_t *decl) {
int8_t _z_interest_process_declares(_z_session_t *zn, const _z_declaration_t *decl) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
const _z_keyexpr_t *decl_key = NULL;
_z_interest_msg_t msg;
switch (decl->_tag) {
Expand Down Expand Up @@ -154,7 +154,7 @@ int8_t _z_interest_process_declare(_z_session_t *zn, const _z_declaration_t *dec
return _Z_RES_OK;
}

int8_t _z_interest_process_undeclare(_z_session_t *zn, const _z_declaration_t *decl) {
int8_t _z_interest_process_undeclares(_z_session_t *zn, const _z_declaration_t *decl) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
const _z_keyexpr_t *decl_key = NULL;
_z_interest_msg_t msg;
switch (decl->_tag) {
Expand Down Expand Up @@ -208,7 +208,7 @@ void _z_flush_interest(_z_session_t *zn) {
_zp_session_unlock_mutex(zn);
}

int8_t _z_process_final_interest(_z_session_t *zn, uint32_t id) {
int8_t _z_interest_process_final_interest(_z_session_t *zn, uint32_t id) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
_z_interest_msg_t msg = {.type = _Z_INTEREST_MSG_TYPE_FINAL, .id = id};
// Retrieve interest
_zp_session_lock_mutex(zn);
Expand All @@ -221,7 +221,7 @@ int8_t _z_process_final_interest(_z_session_t *zn, uint32_t id) {
return _Z_RES_OK;
}

int8_t _z_process_undeclare_interest(_z_session_t *zn, uint32_t id) {
int8_t _z_interest_process_undeclare_interest(_z_session_t *zn, uint32_t id) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
_ZP_UNUSED(zn);
_ZP_UNUSED(id);
// Update future masks
Expand Down Expand Up @@ -318,7 +318,7 @@ static int8_t _z_interest_send_final_interest(_z_session_t *zn, uint32_t id) {
return _Z_RES_OK;
}

int8_t _z_process_declare_interest(_z_session_t *zn, _z_keyexpr_t key, uint32_t id, uint8_t flags) {
int8_t _z_interest_process_declare_interest(_z_session_t *zn, _z_keyexpr_t key, uint32_t id, uint8_t flags) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
_ZP_UNUSED(key);
_ZP_UNUSED(id);
// Check transport type
Expand Down Expand Up @@ -350,31 +350,31 @@ int8_t _z_process_declare_interest(_z_session_t *zn, _z_keyexpr_t key, uint32_t
}

#else
int8_t _z_interest_process_declare(_z_session_t *zn, const _z_declaration_t *decl) {
int8_t _z_interest_process_declares(_z_session_t *zn, const _z_declaration_t *decl) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
_ZP_UNUSED(zn);
_ZP_UNUSED(decl);
return _Z_RES_OK;
}

int8_t _z_interest_process_undeclare(_z_session_t *zn, const _z_declaration_t *decl) {
int8_t _z_interest_process_undeclares(_z_session_t *zn, const _z_declaration_t *decl) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
_ZP_UNUSED(zn);
_ZP_UNUSED(decl);
return _Z_RES_OK;
}

int8_t _z_process_final_interest(_z_session_t *zn, uint32_t id) {
int8_t _z_interest_process_final_interest(_z_session_t *zn, uint32_t id) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
_ZP_UNUSED(zn);
_ZP_UNUSED(id);
return _Z_RES_OK;
}

int8_t _z_process_undeclare_interest(_z_session_t *zn, uint32_t id) {
int8_t _z_interest_process_undeclare_interest(_z_session_t *zn, uint32_t id) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
_ZP_UNUSED(zn);
_ZP_UNUSED(id);
return _Z_RES_OK;
}

int8_t _z_process_declare_interest(_z_session_t *zn, _z_keyexpr_t key, uint32_t id, uint8_t flags) {
int8_t _z_interest_process_declare_interest(_z_session_t *zn, _z_keyexpr_t key, uint32_t id, uint8_t flags) {

Check warning

Code scanning / Cppcheck (reported by Codacy)

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

misra violation 804 with no text in the supplied rule-texts-file
_ZP_UNUSED(zn);
_ZP_UNUSED(key);
_ZP_UNUSED(id);
Expand Down
18 changes: 9 additions & 9 deletions src/session/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,27 @@ int8_t _z_handle_network_message(_z_session_t *zn, _z_zenoh_message_t *msg, uint
_z_unregister_resource(zn, decl._decl._body._undecl_kexpr._id, local_peer_id);
} break;
case _Z_DECL_INTEREST: {
_z_process_declare_interest(zn, decl._decl._body._decl_interest._keyexpr,
decl._decl._body._decl_interest._id,
decl._decl._body._decl_interest.interest_flags);
_z_interest_process_declare_interest(zn, decl._decl._body._decl_interest._keyexpr,
decl._decl._body._decl_interest._id,
decl._decl._body._decl_interest.interest_flags);
} break;
case _Z_UNDECL_INTEREST: {
_z_process_undeclare_interest(zn, decl._decl._body._undecl_interest._id);
_z_interest_process_undeclare_interest(zn, decl._decl._body._undecl_interest._id);
} break;
case _Z_FINAL_INTEREST: {
_z_process_final_interest(zn, decl._decl._body._final_interest._id);
_z_interest_process_final_interest(zn, decl._decl._body._final_interest._id);
} break;
case _Z_DECL_SUBSCRIBER: {
_z_interest_process_declare(zn, &decl._decl);
_z_interest_process_declares(zn, &decl._decl);
} break;
case _Z_DECL_QUERYABLE: {
_z_interest_process_declare(zn, &decl._decl);
_z_interest_process_declares(zn, &decl._decl);
} break;
case _Z_UNDECL_SUBSCRIBER: {
_z_interest_process_undeclare(zn, &decl._decl);
_z_interest_process_undeclares(zn, &decl._decl);
} break;
case _Z_UNDECL_QUERYABLE: {
_z_interest_process_undeclare(zn, &decl._decl);
_z_interest_process_undeclares(zn, &decl._decl);
} break;
case _Z_DECL_TOKEN: {
// TODO: add support or explicitly discard
Expand Down

0 comments on commit 18649c3

Please sign in to comment.