@@ -47,6 +47,8 @@ class Ticker
47
47
_attach_ms (milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), 0 );
48
48
}
49
49
50
+ #pragma GCC diagnostic push
51
+ #pragma GCC diagnostic ignored "-Wcast-function-type"
50
52
template <typename TArg>
51
53
void attach (float seconds, void (*callback)(TArg), TArg arg)
52
54
{
@@ -65,6 +67,7 @@ class Ticker
65
67
uint32_t arg32 = (uint32_t )arg;
66
68
_attach_ms (milliseconds, true , reinterpret_cast <callback_with_arg_t >(callback), arg32);
67
69
}
70
+ #pragma GCC diagnostic pop
68
71
69
72
void once (float seconds, callback_t callback)
70
73
{
@@ -73,9 +76,11 @@ class Ticker
73
76
74
77
void once_ms (uint32_t milliseconds, callback_t callback)
75
78
{
76
- _attach_ms (milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), 0 );
79
+ _attach_ms (milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), 0 );
77
80
}
78
81
82
+ #pragma GCC diagnostic push
83
+ #pragma GCC diagnostic ignored "-Wcast-function-type"
79
84
template <typename TArg>
80
85
void once (float seconds, void (*callback)(TArg), TArg arg)
81
86
{
@@ -91,11 +96,12 @@ class Ticker
91
96
uint32_t arg32 = (uint32_t )(arg);
92
97
_attach_ms (milliseconds, false , reinterpret_cast <callback_with_arg_t >(callback), arg32);
93
98
}
99
+ #pragma GCC diagnostic pop
94
100
95
101
void detach ();
96
102
bool active ();
97
103
98
- protected:
104
+ protected:
99
105
void _attach_ms (uint32_t milliseconds, bool repeat, callback_with_arg_t callback, uint32_t arg);
100
106
101
107
0 commit comments