Skip to content

Commit

Permalink
fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Nov 12, 2015
1 parent 718bfbb commit 0aec198
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static void NOINLINE save_stack(jl_task_t *t)
size_t nb = (char*)jl_stackbase - (char*)&_x;
char *buf;
if (t->stkbuf == NULL || ((size_t*)t->stkbuf)[-1] < nb) {
buf = (char*)realloc(t->stkbuf ? t->stkbuf - sizeof(size_t) : NULL,
buf = (char*)realloc(t->stkbuf ? (char*)t->stkbuf - sizeof(size_t) : NULL,
nb + sizeof(size_t));
if (buf == NULL)
jl_throw(jl_memory_exception);
Expand Down Expand Up @@ -216,7 +216,7 @@ static void NORETURN finish_task(jl_task_t *t, jl_value_t *resultval)
void *stkbuf = t->stkbuf;
if (t->copy_stack && stkbuf != NULL && stkbuf != (void*)(intptr_t*)-1) {
t->stkbuf = (void*)(intptr_t)-1;
free(stkbuf - sizeof(size_t));
free((char*)stkbuf - sizeof(size_t));
}
#endif
if (ti_tid != 0) {
Expand Down Expand Up @@ -305,7 +305,7 @@ static void ctx_switch(jl_task_t *t)

#ifdef COPY_STACKS
if (t->copy_stack && t->stkbuf) // task already exists, resume from the copy-stack
restore_stack(t, lastt->copy_stack ? NULL : (void*)(intptr_t)1); // resume at jl_setjmp of the other task after restoring the stack (doesn't return)
restore_stack(t, lastt->copy_stack ? NULL : (char*)(intptr_t)1); // resume at jl_setjmp of the other task after restoring the stack (doesn't return)
#endif

if (!t->copy_stack && !t->stkbuf) // task not started yet, jump to start_task
Expand Down Expand Up @@ -755,7 +755,7 @@ static void jl_task_cleanup(jl_task_t *t)
if (stk && stk != (void*)(intptr_t)-1) {
t->stkbuf = (void*)(intptr_t)-1;
if (t->copy_stack)
free(stk - sizeof(size_t));
free((char*)stk - sizeof(size_t));
else
#ifdef _OS_WINDOWS_
DeleteFiber(t->fiber);
Expand Down Expand Up @@ -1087,7 +1087,7 @@ void jl_init_root_task(void *stack, size_t ssize)
jl_set_typeof(jl_current_task, jl_task_type);

jl_current_task->copy_stack = 0;
jl_current_task->stkbuf = stack - ssize - 3000000; // guess at address of bottom of stack
jl_current_task->stkbuf = (char*)stack - ssize - 3000000; // guess at address of bottom of stack
jl_current_task->ssize = ssize + 3000000; // guess at sizeof stack
jl_current_task->parent = jl_current_task;
jl_current_task->current_module = jl_current_module;
Expand Down

0 comments on commit 0aec198

Please sign in to comment.