Skip to content

Commit c83b911

Browse files
committed
fix: Add missing const/sonarcube note
1 parent 6c24ca6 commit c83b911

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

iso14229.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3941,7 +3941,7 @@ static void doip_handle_routing_activation_response(DoIPClient_t *tp, const uint
39413941
* @param payload Pointer to DoIP payload
39423942
* @param payload_len Length of DoIP payload
39433943
*/
3944-
static void doip_handle_alive_check_request(DoIPClient_t *tp, const uint8_t *payload,
3944+
static void doip_handle_alive_check_request(const DoIPClient_t *tp, const uint8_t *payload,
39453945
uint32_t payload_len) {
39463946

39473947
(void)tp;
@@ -4353,7 +4353,7 @@ void doip_update_sdu_info(const UDSTp_t *hdl, UDSSDU_t *info) {
43534353
return;
43544354
}
43554355

4356-
const DoIPClient_t *impl = (DoIPClient_t *)hdl;
4356+
const DoIPClient_t *impl = (const DoIPClient_t *)hdl;
43574357
info->A_Mtype = UDS_A_MTYPE_DIAG;
43584358
info->A_SA = impl->source_address;
43594359
info->A_TA = impl->target_address;

src/tp/doip/doip_client.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static void doip_handle_routing_activation_response(DoIPClient_t *tp, const uint
221221
* @param payload Pointer to DoIP payload
222222
* @param payload_len Length of DoIP payload
223223
*/
224-
static void doip_handle_alive_check_request(DoIPClient_t *tp, const uint8_t *payload,
224+
static void doip_handle_alive_check_request(const DoIPClient_t *tp, const uint8_t *payload,
225225
uint32_t payload_len) {
226226

227227
(void)tp;
@@ -633,7 +633,7 @@ void doip_update_sdu_info(const UDSTp_t *hdl, UDSSDU_t *info) {
633633
return;
634634
}
635635

636-
const DoIPClient_t *impl = (DoIPClient_t *)hdl;
636+
const DoIPClient_t *impl = (const DoIPClient_t *)hdl;
637637
info->A_Mtype = UDS_A_MTYPE_DIAG;
638638
info->A_SA = impl->source_address;
639639
info->A_TA = impl->target_address;
@@ -654,6 +654,8 @@ void doip_update_sdu_info(const UDSTp_t *hdl, UDSSDU_t *info) {
654654
* @param info Pointer to SDU info structure (optional)
655655
* @return ssize_t Number of bytes sent, or negative on error
656656
*/
657+
658+
/* NOTE: SonarCube complains about missing const, but the interface requires non-const */
657659
static ssize_t doip_tp_send(UDSTp_t *hdl, uint8_t *buf, size_t len, UDSSDU_t *info) {
658660
UDS_ASSERT(hdl);
659661
ssize_t ret = -1;

0 commit comments

Comments
 (0)