summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Braun <matthias.braun@kit.edu>2013-11-15 14:39:07 +0100
committerMatthias Braun <matthias.braun@kit.edu>2013-11-15 14:39:11 +0100
commit6e277816334ed3b93f82cecba3a94d7d5237fea9 (patch)
treea6e22002a4805aa7959da08339c3a854badd7c06
parent18b36c2eb2f89cd2c9da1b1d919064165b104af3 (diff)
small cleanups to avoid function pointer casting
-rw-r--r--octopos_threads.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/octopos_threads.c b/octopos_threads.c
index 5daad17..10f0672 100644
--- a/octopos_threads.c
+++ b/octopos_threads.c
@@ -30,12 +30,13 @@ GC_INNER void GC_start_world(void)
}
/* Will be called for every thread (except the current) by OctoPOS */
-GC_INNER void push_stack_callback(ptr_t bottom, ptr_t top)
+GC_INNER void push_stack_callback(const void *bottom, const void *top)
{
+ ptr_t bottom_p = (ptr_t)(void*)bottom;
+ ptr_t top_p = (ptr_t)(void*)top;
// Update total stacksize
- GC_total_stacksize += top - bottom;
-
- GC_push_all_stack(bottom, top);
+ GC_total_stacksize += top_p - bottom_p;
+ GC_push_all_stack(bottom_p, top_p);
}
/* Push all thread stacks */
@@ -44,7 +45,7 @@ GC_INNER void GC_push_all_stacks(void)
/* Stack size for current thread stack has already been set in GC_push_all_eager.
* For other threads this will be set in the callback. */
- int res = gc_iterate_all_stacks((void (*)(const void*, const void*)) &push_stack_callback);
+ int res = gc_iterate_all_stacks(&push_stack_callback);
GC_ASSERT(res == 0);
}