Skip to content

Commit c825b04

Browse files
author
Mika Leppänen
committed
Corrected covery warning on delay_us multiplication
Warning: sign_extension: Suspicious implicit sign extension: fhss_structure->platform_functions.fhss_resolution_divider with type uint8_t (8 bits, unsigned) is promoted in delay_us * fhss_structure->platform_functions.fhss_resolution_divider to type long (32 bits, signed), then sign-extended to type long long (64 bits, signed). If delay_us * fhss_structure->platform_functions.fhss_resolution_divider is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
1 parent be63bbb commit c825b04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static void fhss_broadcast_handler(const fhss_api_t *fhss_api, uint16_t delay)
348348
}
349349

350350
if (fhss_structure->ws->is_on_bc_channel == false) {
351-
fhss_ws_start_timer(fhss_structure, MS_TO_US(fhss_structure->ws->fhss_configuration.fhss_bc_dwell_interval) - (delay_us * fhss_structure->platform_functions.fhss_resolution_divider), fhss_broadcast_handler);
351+
fhss_ws_start_timer(fhss_structure, MS_TO_US(fhss_structure->ws->fhss_configuration.fhss_bc_dwell_interval) - ((int64_t) delay_us * fhss_structure->platform_functions.fhss_resolution_divider), fhss_broadcast_handler);
352352
fhss_structure->ws->is_on_bc_channel = true;
353353
next_channel = fhss_structure->ws->bc_channel = fhss_ws_calc_bc_channel(fhss_structure);
354354

0 commit comments

Comments
 (0)