diff --git a/hal/api/Callback.h b/hal/api/Callback.h index 377d84a2a0..8ffd70164c 100644 --- a/hal/api/Callback.h +++ b/hal/api/Callback.h @@ -80,7 +80,7 @@ public: */ template void attach(T *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - _obj = static_cast(obj); + _obj = (void*)obj; memcpy(&_func, &func, sizeof func); _thunk = &Callback::_boundthunk; } @@ -221,7 +221,7 @@ public: */ template void attach(T *obj, R (*func)(T*, A0, A1, A2, A3)) { - _obj = static_cast(obj); + _obj = (void*)obj; memcpy(&_func, &func, sizeof func); _thunk = &Callback::_boundthunk; } @@ -362,7 +362,7 @@ public: */ template void attach(T *obj, R (*func)(T*, A0, A1, A2)) { - _obj = static_cast(obj); + _obj = (void*)obj; memcpy(&_func, &func, sizeof func); _thunk = &Callback::_boundthunk; } @@ -503,7 +503,7 @@ public: */ template void attach(T *obj, R (*func)(T*, A0, A1)) { - _obj = static_cast(obj); + _obj = (void*)obj; memcpy(&_func, &func, sizeof func); _thunk = &Callback::_boundthunk; } @@ -644,7 +644,7 @@ public: */ template void attach(T *obj, R (*func)(T*, A0)) { - _obj = static_cast(obj); + _obj = (void*)obj; memcpy(&_func, &func, sizeof func); _thunk = &Callback::_boundthunk; } @@ -785,7 +785,7 @@ public: */ template void attach(T *obj, R (*func)(T*)) { - _obj = static_cast(obj); + _obj = (void*)obj; memcpy(&_func, &func, sizeof func); _thunk = &Callback::_boundthunk; }