mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-29 16:31:18 +01:00
Merge pull request #1662 from N8Fear/void_ptr_arith
lint: lpc1768/msp430: remove arith ops on void ptrs
This commit is contained in:
commit
acef250652
@ -38,7 +38,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
|
||||
{
|
||||
unsigned int *stk;
|
||||
int i;
|
||||
stk = (unsigned int *)((unsigned int)stack_start + stack_size);
|
||||
stk = (unsigned int *)((uintptr_t)stack_start + stack_size);
|
||||
stk--;
|
||||
|
||||
*stk = STACK_MARKER;
|
||||
|
||||
@ -74,7 +74,7 @@ char *thread_arch_stack_init(void *(*task_func)(void *), void *arg, void *stack_
|
||||
uint8_t *stk;
|
||||
|
||||
/* AVR uses 16 Bit or two 8 Bit registers for storing pointers*/
|
||||
stk = (uint8_t *)((uint16_t)stack_start + stack_size);
|
||||
stk = (uint8_t *)((uintptr_t)stack_start + stack_size);
|
||||
|
||||
/* put marker on stack */
|
||||
stk--;
|
||||
|
||||
@ -66,7 +66,7 @@ char *thread_arch_stack_init(void *(*task_func)(void *),
|
||||
int stack_size)
|
||||
{
|
||||
uint32_t *stk;
|
||||
stk = (uint32_t *)((uint32_t)stack_start + stack_size);
|
||||
stk = (uint32_t *)((uintptr_t)stack_start + stack_size);
|
||||
|
||||
/* marker */
|
||||
stk--;
|
||||
|
||||
@ -57,7 +57,7 @@ static void context_restore(void) NORETURN;
|
||||
char *thread_arch_stack_init(void *(*task_func)(void *), void *arg, void *stack_start, int stack_size)
|
||||
{
|
||||
uint32_t *stk;
|
||||
stk = (uint32_t *)((uint32_t)stack_start + stack_size);
|
||||
stk = (uint32_t *)((uintptr_t)stack_start + stack_size);
|
||||
|
||||
/* marker */
|
||||
stk--;
|
||||
|
||||
@ -63,7 +63,7 @@ char *thread_arch_stack_init(void *(*task_func)(void *),
|
||||
int stack_size)
|
||||
{
|
||||
uint32_t *stk;
|
||||
stk = (uint32_t *)((uint32_t)stack_start + stack_size);
|
||||
stk = (uint32_t *)((uintptr_t)stack_start + stack_size);
|
||||
|
||||
/* marker */
|
||||
stk--;
|
||||
|
||||
@ -114,7 +114,7 @@ NORETURN void sched_task_return(void)
|
||||
char * thread_stack_init(void *(*task_func)(void *), void *arg, void *stack_start, int stack_size)
|
||||
{
|
||||
unsigned int * stk;
|
||||
stk = (unsigned int *) (stack_start + stack_size);
|
||||
stk = (unsigned int *) ((uintptr_t) stack_start + stack_size);
|
||||
|
||||
/* marker */
|
||||
stk--;
|
||||
|
||||
@ -64,7 +64,7 @@ __attribute__((section (".fini9"))) void __main_epilogue(void) { __asm__("ret");
|
||||
//----------------------------------------------------------------------------
|
||||
char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stack_size)
|
||||
{
|
||||
unsigned short stk = (unsigned short)(stack_start + stack_size);
|
||||
unsigned short stk = (unsigned short)((uintptr_t) stack_start + stack_size);
|
||||
|
||||
/* ensure correct stack alignment (on 16-bit boundary) */
|
||||
stk &= 0xfffe;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user