Skip to content

Commit

Permalink
thread/posix: optimize handler and fix gcc arm32 warning
Browse files Browse the repository at this point in the history
Fixes (on arm32 gcc):
warning: cast from function call of type ‘int’ to non-matching type ‘void *’ [-Wbad-function-cast]
  • Loading branch information
sreimers committed Mar 27, 2024
1 parent c8ec56b commit 287eb60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/thread/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ struct thread {

static void *handler(void *p)
{
struct thread th = *(struct thread *)p;
struct thread *th = p;

mem_deref(p);
int ret = th->func(th->arg);
mem_deref(th);

return (void *)(intptr_t)th.func(th.arg);
return (void *)(intptr_t)ret;
}


Expand Down

0 comments on commit 287eb60

Please sign in to comment.