From 517ba0690dcc9e859a05df2113ce32401a5ab254 Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Mon, 30 Sep 2013 23:16:20 +0200 Subject: Clean up const usage to avoid excessive casting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't use const on pointers that hold heap allocated data, because that means functions that free them must cast away the const. Do use const on pointer parameters or fields that needn't be modified. Remove pointer casts that are no longer needed after fixing the constness. Change-Id: I5d206f5019982fd1950bc6d6d07b6062dc24e886 Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/1668 Tested-by: jenkins Reviewed-by: Mathias Küster Reviewed-by: Spencer Oliver --- src/rtos/ChibiOS.c | 2 +- src/rtos/embKernel.c | 2 +- src/rtos/linux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rtos') diff --git a/src/rtos/ChibiOS.c b/src/rtos/ChibiOS.c index 47e7fc5d..2148e91d 100644 --- a/src/rtos/ChibiOS.c +++ b/src/rtos/ChibiOS.c @@ -552,6 +552,6 @@ static int ChibiOS_create(struct target *target) return -1; } - target->rtos->rtos_specific_params = (void *) &ChibiOS_params_list[i]; + target->rtos->rtos_specific_params = &ChibiOS_params_list[i]; return 0; } diff --git a/src/rtos/embKernel.c b/src/rtos/embKernel.c index 9a45cf0b..f605deb3 100644 --- a/src/rtos/embKernel.c +++ b/src/rtos/embKernel.c @@ -131,7 +131,7 @@ static int embKernel_create(struct target *target) return -1; } - target->rtos->rtos_specific_params = (void *) &embKernel_params_list[i]; + target->rtos->rtos_specific_params = &embKernel_params_list[i]; return 0; } diff --git a/src/rtos/linux.c b/src/rtos/linux.c index e692ada8..2e97a421 100644 --- a/src/rtos/linux.c +++ b/src/rtos/linux.c @@ -1524,7 +1524,7 @@ static int linux_os_create(struct target *target) os_linux->threads_needs_update = 0; os_linux->threadid_count = 1; os_linux->current_threads = NULL; - target->rtos->rtos_specific_params = (void *)os_linux; + target->rtos->rtos_specific_params = os_linux; ct->core_id = target->coreid; ct->threadid = -1; ct->TS = 0xdeadbeef; -- cgit v1.2.3-18-g5258