Skip to content

Commit

Permalink
rtos: mqx: minor rework to avoid a cast
Browse files Browse the repository at this point in the history
Change the type of task_name[] to char in order to drop a cast.

Change-Id: I233fc862e972e52130fd4ffcb29a3da36f4f8923
Signed-off-by: Antonio Borneo <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8599
Reviewed-by: Paul Fertser <[email protected]>
Tested-by: jenkins
  • Loading branch information
borneoa committed Dec 22, 2024
1 parent dca76cd commit cd9e64a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rtos/mqx.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int mqx_update_threads(
i < (uint32_t)rtos->thread_count;
i++
) {
uint8_t task_name[MQX_THREAD_NAME_LENGTH + 1];
char task_name[MQX_THREAD_NAME_LENGTH + 1];
uint32_t task_addr = 0, task_template = 0, task_state = 0;
uint32_t task_name_addr = 0, task_id = 0, task_errno = 0;
uint32_t state_index = 0;
Expand Down Expand Up @@ -380,7 +380,7 @@ static int mqx_update_threads(
rtos->thread_details[i].threadid = task_id;
rtos->thread_details[i].exists = true;
/* set thread name */
rtos->thread_details[i].thread_name_str = strdup((char *)task_name);
rtos->thread_details[i].thread_name_str = strdup(task_name);
if (!rtos->thread_details[i].thread_name_str)
return ERROR_FAIL;
/* set thread extra info
Expand Down

0 comments on commit cd9e64a

Please sign in to comment.