Skip to content

Commit

Permalink
native: fix wrong pointer type warning
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseichinger committed Jul 21, 2015
1 parent 51b7227 commit 0c15084
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cpu/native/native_cpu.c
Expand Up @@ -96,24 +96,18 @@ void thread_print_stack(void)

char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stacksize)
{
unsigned int *stk;
char *stk;
ucontext_t *p;

VALGRIND_STACK_REGISTER(stack_start, (char *) stack_start + stacksize);
VALGRIND_DEBUG("VALGRIND_STACK_REGISTER(%p, %p)\n", stack_start, (void*)((int)stack_start + stacksize));

DEBUG("thread_stack_init\n");

stk = (unsigned int *)stack_start;
stk = stack_start;

#ifdef NATIVESPONTOP
p = (ucontext_t *)stk;
stk += sizeof(ucontext_t) / sizeof(void *);
stacksize -= sizeof(ucontext_t);
#else
p = (ucontext_t *)(stk + ((stacksize - sizeof(ucontext_t)) / sizeof(void *)));
stacksize -= sizeof(ucontext_t);
#endif

if (getcontext(p) == -1) {
err(EXIT_FAILURE, "thread_stack_init: getcontext");
Expand Down

0 comments on commit 0c15084

Please sign in to comment.