@@ -64,21 +64,21 @@ class Ticker
64
64
// C-cast serves two purposes:
65
65
// static_cast for smaller integer types,
66
66
// reinterpret_cast + const_cast for pointer types
67
- _attach_us (1000000ULL * seconds, true , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
67
+ _attach_us (1000000ULL * seconds, true , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
68
68
}
69
69
70
70
template <typename TArg>
71
71
void attach_ms (uint64_t milliseconds, void (*callback)(TArg), TArg arg)
72
72
{
73
73
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
74
- _attach_us (1000ULL * milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
74
+ _attach_us (1000ULL * milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
75
75
}
76
76
77
77
template <typename TArg>
78
78
void attach_us (uint64_t micros, void (*callback)(TArg), TArg arg)
79
79
{
80
80
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
81
- _attach_us (micros, true , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
81
+ _attach_us (micros, true , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
82
82
}
83
83
84
84
void once (float seconds, callback_function_t callback)
@@ -103,21 +103,21 @@ class Ticker
103
103
void once (float seconds, void (*callback)(TArg), TArg arg)
104
104
{
105
105
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
106
- _attach_us (1000000ULL * seconds, false , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
106
+ _attach_us (1000000ULL * seconds, false , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
107
107
}
108
108
109
109
template <typename TArg>
110
110
void once_ms (uint64_t milliseconds, void (*callback)(TArg), TArg arg)
111
111
{
112
112
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
113
- _attach_us (1000ULL * milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
113
+ _attach_us (1000ULL * milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
114
114
}
115
115
116
116
template <typename TArg>
117
117
void once_us (uint64_t micros, void (*callback)(TArg), TArg arg)
118
118
{
119
119
static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
120
- _attach_us (micros, false , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
120
+ _attach_us (micros, false , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
121
121
}
122
122
123
123
void detach ();
0 commit comments