From fdb136f1fa02f22e7dc9d3754c64355cd0757943 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 27 Dec 2016 23:13:03 +0100 Subject: [PATCH] StateFile: use C++11 initializers --- src/StateFile.cxx | 4 +--- src/StateFile.hxx | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/StateFile.cxx b/src/StateFile.cxx index 4c731faab..ab1cbdb39 100644 --- a/src/StateFile.cxx +++ b/src/StateFile.cxx @@ -42,9 +42,7 @@ StateFile::StateFile(AllocatedPath &&_path, unsigned _interval, :TimeoutMonitor(_loop), path(std::move(_path)), path_utf8(path.ToUTF8()), interval(_interval), - partition(_partition), - prev_volume_version(0), prev_output_version(0), - prev_playlist_version(0) + partition(_partition) { } diff --git a/src/StateFile.hxx b/src/StateFile.hxx index 056cfb654..8c59db6ef 100644 --- a/src/StateFile.hxx +++ b/src/StateFile.hxx @@ -42,8 +42,8 @@ class StateFile final : private TimeoutMonitor { * These version numbers determine whether we need to save the state * file. If nothing has changed, we won't let the hard drive spin up. */ - unsigned prev_volume_version, prev_output_version, - prev_playlist_version; + unsigned prev_volume_version = 0, prev_output_version = 0, + prev_playlist_version = 0; public: static constexpr unsigned DEFAULT_INTERVAL = 2 * 60;