Skip to content

Commit 2ae34c4

Browse files
authored
Merge pull request #4184 from geky/events-strict-alias-warning
events: Remove strict-aliasing warning
2 parents 743ab7e + 4459e6d commit 2ae34c4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

events/equeue/equeue_mbed.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@ static void equeue_tick_init() {
4242
"The equeue_timer buffer must fit the class Timer");
4343
MBED_STATIC_ASSERT(sizeof(equeue_ticker) >= sizeof(Ticker),
4444
"The equeue_ticker buffer must fit the class Ticker");
45-
new (equeue_timer) Timer;
46-
new (equeue_ticker) Ticker;
45+
Timer *timer = new (equeue_timer) Timer;
46+
Ticker *ticker = new (equeue_ticker) Ticker;
4747

4848
equeue_minutes = 0;
49-
reinterpret_cast<Timer*>(equeue_timer)->start();
50-
reinterpret_cast<Ticker*>(equeue_ticker)
51-
->attach_us(equeue_tick_update, 1000 << 16);
49+
timer->start();
50+
ticker->attach_us(equeue_tick_update, 1000 << 16);
5251

5352
equeue_tick_inited = true;
5453
}

0 commit comments

Comments
 (0)