@@ -58,14 +58,14 @@ class Ticker
58
58
// C-cast serves two purposes:
59
59
// static_cast for smaller integer types,
60
60
// reinterpret_cast + const_cast for pointer types
61
- _attach_ms (seconds * 1000 , true , callback, arg);
61
+ _attach_ms (seconds * 1000 , true , reinterpret_cast < callback_with_arg_t >( callback), ( void *) arg);
62
62
}
63
63
64
64
template <typename TArg>
65
65
void attach_ms (uint32_t milliseconds, void (*callback)(TArg), TArg arg)
66
66
{
67
67
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
68
- _attach_ms (milliseconds, true , callback, arg);
68
+ _attach_ms (milliseconds, true , reinterpret_cast < callback_with_arg_t >( callback), ( void *) arg);
69
69
}
70
70
71
71
void once (float seconds, callback_function_t callback)
@@ -84,14 +84,14 @@ class Ticker
84
84
void once (float seconds, void (*callback)(TArg), TArg arg)
85
85
{
86
86
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
87
- _attach_ms (seconds * 1000 , false , callback, arg);
87
+ _attach_ms (seconds * 1000 , false , reinterpret_cast < callback_with_arg_t >( callback), ( void *) arg);
88
88
}
89
89
90
90
template <typename TArg>
91
91
void once_ms (uint32_t milliseconds, void (*callback)(TArg), TArg arg)
92
92
{
93
93
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
94
- _attach_ms (milliseconds, false , callback, arg);
94
+ _attach_ms (milliseconds, false , reinterpret_cast < callback_with_arg_t >( callback), ( void *) arg);
95
95
}
96
96
97
97
void detach ();
0 commit comments