diff --git a/src/crl/dispatch/crl_dispatch_async.h b/src/crl/dispatch/crl_dispatch_async.h index be01b0c..cfbb75d 100644 --- a/src/crl/dispatch/crl_dispatch_async.h +++ b/src/crl/dispatch/crl_dispatch_async.h @@ -49,9 +49,9 @@ inline void on_queue_invoke( using Plain = Return(*)(); const auto copy = static_cast(callable); invoker(queue, [](void *passed) { - const auto callable = static_cast(passed); + const auto callable = reinterpret_cast(passed); (*callable)(); - }, static_cast(copy)); + }, reinterpret_cast(copy)); } else { const auto copy = new Function(std::forward(callable)); invoker(queue, [](void *passed) { diff --git a/src/crl/dispatch/crl_dispatch_queue.h b/src/crl/dispatch/crl_dispatch_queue.h index 34ad52d..5c3493d 100644 --- a/src/crl/dispatch/crl_dispatch_queue.h +++ b/src/crl/dispatch/crl_dispatch_queue.h @@ -44,9 +44,9 @@ class queue { using Plain = Return(*)(); const auto copy = static_cast(callable); async_plain([](void *passed) { - const auto callable = static_cast(passed); + const auto callable = reinterpret_cast(passed); (*callable)(); - }, static_cast(copy)); + }, reinterpret_cast(copy)); } else { const auto copy = new Function(std::forward(callable)); async_plain([](void *passed) { @@ -67,9 +67,9 @@ class queue { using Plain = Return(*)(); const auto copy = static_cast(callable); sync_plain([](void *passed) { - const auto callable = static_cast(passed); + const auto callable = reinterpret_cast(passed); (*callable)(); - }, static_cast(copy)); + }, reinterpret_cast(copy)); } else { const auto copy = new Function(std::forward(callable)); sync_plain([](void *passed) { diff --git a/src/crl/winapi/crl_winapi_async.h b/src/crl/winapi/crl_winapi_async.h index a4746ea..54e8737 100644 --- a/src/crl/winapi/crl_winapi_async.h +++ b/src/crl/winapi/crl_winapi_async.h @@ -46,9 +46,9 @@ inline void async(Callable &&callable) { using Plain = Return(*)(); const auto copy = static_cast(callable); details::async_plain([](void *passed) { - const auto callable = static_cast(passed); + const auto callable = reinterpret_cast(passed); (*callable)(); - }, static_cast(copy)); + }, reinterpret_cast(copy)); } else { const auto copy = new Function(std::forward(callable)); details::async_plain([](void *passed) {