From e573cbf0320e5dee844da40002eee5e6bbac225f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 1 Feb 2018 19:53:42 +0100 Subject: [PATCH] db/update/Queue: work around GCC7 -Wuninitialized --- src/db/update/Queue.hxx | 4 ++++ src/db/update/Service.cxx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/db/update/Queue.hxx b/src/db/update/Queue.hxx index 90373aab3..63a7acbc6 100644 --- a/src/db/update/Queue.hxx +++ b/src/db/update/Queue.hxx @@ -49,6 +49,10 @@ struct UpdateQueueItem { bool IsDefined() const { return id != 0; } + + void Clear() { + id = 0; + } }; class UpdateQueue { diff --git a/src/db/update/Service.cxx b/src/db/update/Service.cxx index 099dc8104..8660575c6 100644 --- a/src/db/update/Service.cxx +++ b/src/db/update/Service.cxx @@ -252,7 +252,7 @@ UpdateService::RunDeferred() delete walk; walk = nullptr; - next = UpdateQueueItem(); + next.Clear(); idle_add(IDLE_UPDATE);