From 889cadaca568fa3b68a647b46cafeefed2abe18b Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 9 May 2019 05:06:44 +0100 Subject: [PATCH] BACKENDS: Fix GCC Compiler Warning in Default Timer Implementation This is another instance of a warning from usage of memset on a non-trivial data structure, but this can be removed and replaced by a constructor. --- backends/timer/default/default-timer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp index 8964d5a7c7e..19d1a0af115 100644 --- a/backends/timer/default/default-timer.cpp +++ b/backends/timer/default/default-timer.cpp @@ -35,6 +35,8 @@ struct TimerSlot { uint32 nextFireTimeMicro; // microseconds part of nextFire TimerSlot *next; + + TimerSlot() : refCon(0), interval(0), nextFireTime(0), nextFireTimeMicro(0), next(0) {} }; void insertPrioQueue(TimerSlot *head, TimerSlot *newSlot) { @@ -63,7 +65,6 @@ DefaultTimerManager::DefaultTimerManager() : _head(0) { _head = new TimerSlot(); - memset(_head, 0, sizeof(TimerSlot)); } DefaultTimerManager::~DefaultTimerManager() {