From 776954bdb5f1257d4b6265761a6dc725c471b272 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 10 Sep 2023 17:24:20 -0500 Subject: [PATCH] Update: Use size_t and perform explicit casts in Control program. The f_socket_read() function expects a size_t type but is passed f_array_length_t. By default these should be the same thing. Change "length" to a size_t and add appropriate casts. This is not a very important change because the Control program is incomplete. --- level_3/control/c/private-control.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/level_3/control/c/private-control.c b/level_3/control/c/private-control.c index ce8f28e..d95088d 100644 --- a/level_3/control/c/private-control.c +++ b/level_3/control/c/private-control.c @@ -288,7 +288,7 @@ extern "C" { f_string_range_t range_payload = f_string_range_t_initialize; { - f_array_length_t length = 5; + size_t length = 5; uint8_t head[length]; memset(head, 0, sizeof(uint8_t) * length); @@ -302,13 +302,13 @@ extern "C" { return F_status_set_error(F_packet_not); } - length = control_packet_header_length(head[0] & control_packet_flag_endian_big_d, head); + length = (size_t) control_packet_header_length(head[0] & control_packet_flag_endian_big_d, head); if (length > 0xffffffffu) { return F_status_set_error(F_too_large); } - status = f_string_dynamic_increase_by(length, &data->cache.large); + status = f_string_dynamic_increase_by((f_array_length_t) length, &data->cache.large); if (F_status_is_error(status)) return status; status = f_socket_read(&data->socket, f_socket_flag_wait_all_d, (void *) head, &length); -- 1.8.3.1