@@ -32,7 +32,7 @@ class Ticker
3232 Ticker ();
3333 ~Ticker ();
3434
35- typedef void (*callback_with_arg_t )(void *);
35+ typedef void (*callback_with_arg_t )(void *);
3636 typedef std::function<void (void )> callback_function_t ;
3737
3838 void attach_scheduled (float seconds, callback_function_t callback)
@@ -64,14 +64,14 @@ class Ticker
6464 // C-cast serves two purposes:
6565 // static_cast for smaller integer types,
6666 // reinterpret_cast + const_cast for pointer types
67- _attach_s (seconds, true , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
67+ _attach_s (seconds, true , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
6868 }
6969
7070 template <typename TArg>
7171 void attach_ms (uint32_t milliseconds, void (*callback)(TArg), TArg arg)
7272 {
7373 static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
74- _attach_ms (milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
74+ _attach_ms (milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
7575 }
7676
7777 void once_scheduled (float seconds, callback_function_t callback)
@@ -100,14 +100,14 @@ class Ticker
100100 void once (float seconds, void (*callback)(TArg), TArg arg)
101101 {
102102 static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
103- _attach_s (seconds, false , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
103+ _attach_s (seconds, false , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
104104 }
105105
106106 template <typename TArg>
107107 void once_ms (uint32_t milliseconds, void (*callback)(TArg), TArg arg)
108108 {
109109 static_assert (sizeof (TArg) <= sizeof (void *), " attach() callback argument size must be <= sizeof(void*)" );
110- _attach_ms (milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), ( void *) arg);
110+ _attach_ms (milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), reinterpret_cast < void *>( arg) );
111111 }
112112
113113 void detach ();
@@ -122,7 +122,6 @@ class Ticker
122122
123123private:
124124 void _attach_s (float seconds, bool repeat, callback_with_arg_t callback, void * arg);
125- // char _etsTimerMem[sizeof(ETSTimer)];
126125 ETSTimer _etsTimer;
127126};
128127
0 commit comments