Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Commit

Permalink
Fix void* -> void(*)() casts
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Dec 27, 2017
1 parent 6127f98 commit 9e11a5c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/crl/dispatch/crl_dispatch_async.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ inline void on_queue_invoke(
using Plain = Return(*)();
const auto copy = static_cast<Plain>(callable);
invoker(queue, [](void *passed) {
const auto callable = static_cast<Plain>(passed);
const auto callable = reinterpret_cast<Plain>(passed);
(*callable)();
}, static_cast<void*>(copy));
}, reinterpret_cast<void*>(copy));
} else {
const auto copy = new Function(std::forward<Callable>(callable));
invoker(queue, [](void *passed) {
Expand Down
8 changes: 4 additions & 4 deletions src/crl/dispatch/crl_dispatch_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class queue {
using Plain = Return(*)();
const auto copy = static_cast<Plain>(callable);
async_plain([](void *passed) {
const auto callable = static_cast<Plain>(passed);
const auto callable = reinterpret_cast<Plain>(passed);
(*callable)();
}, static_cast<void*>(copy));
}, reinterpret_cast<void*>(copy));
} else {
const auto copy = new Function(std::forward<Callable>(callable));
async_plain([](void *passed) {
Expand All @@ -67,9 +67,9 @@ class queue {
using Plain = Return(*)();
const auto copy = static_cast<Plain>(callable);
sync_plain([](void *passed) {
const auto callable = static_cast<Plain>(passed);
const auto callable = reinterpret_cast<Plain>(passed);
(*callable)();
}, static_cast<void*>(copy));
}, reinterpret_cast<void*>(copy));
} else {
const auto copy = new Function(std::forward<Callable>(callable));
sync_plain([](void *passed) {
Expand Down
4 changes: 2 additions & 2 deletions src/crl/winapi/crl_winapi_async.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ inline void async(Callable &&callable) {
using Plain = Return(*)();
const auto copy = static_cast<Plain>(callable);
details::async_plain([](void *passed) {
const auto callable = static_cast<Plain>(passed);
const auto callable = reinterpret_cast<Plain>(passed);
(*callable)();
}, static_cast<void*>(copy));
}, reinterpret_cast<void*>(copy));
} else {
const auto copy = new Function(std::forward<Callable>(callable));
details::async_plain([](void *passed) {
Expand Down

0 comments on commit 9e11a5c

Please sign in to comment.