From 3d16f22135db57e9b65052ce32966f0668c95ca9 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Sat, 3 Dec 2016 13:08:00 +0100
Subject: [PATCH] player/Control: use C++11 initializers

---
 src/player/Control.cxx |  9 +--------
 src/player/Control.hxx | 14 +++++++-------
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/src/player/Control.cxx b/src/player/Control.cxx
index 905165432..5fdf01794 100644
--- a/src/player/Control.cxx
+++ b/src/player/Control.cxx
@@ -32,14 +32,7 @@ PlayerControl::PlayerControl(PlayerListener &_listener,
 			     unsigned _buffered_before_play)
 	:listener(_listener), outputs(_outputs),
 	 buffer_chunks(_buffer_chunks),
-	 buffered_before_play(_buffered_before_play),
-	 command(PlayerCommand::NONE),
-	 state(PlayerState::STOP),
-	 error_type(PlayerError::NONE),
-	 tagged_song(nullptr),
-	 next_song(nullptr),
-	 total_play_time(0),
-	 border_pause(false)
+	 buffered_before_play(_buffered_before_play)
 {
 }
 
diff --git a/src/player/Control.hxx b/src/player/Control.hxx
index 8ff9306a4..f8e9d8b3f 100644
--- a/src/player/Control.hxx
+++ b/src/player/Control.hxx
@@ -127,10 +127,10 @@ struct PlayerControl {
 	 */
 	Cond client_cond;
 
-	PlayerCommand command;
-	PlayerState state;
+	PlayerCommand command = PlayerCommand::NONE;
+	PlayerState state = PlayerState::STOP;
 
-	PlayerError error_type;
+	PlayerError error_type = PlayerError::NONE;
 
 	/**
 	 * The error that occurred in the player thread.  This
@@ -150,7 +150,7 @@ struct PlayerControl {
 	 * Protected by #mutex.  Set by the PlayerThread and consumed
 	 * by the main thread.
 	 */
-	DetachedSong *tagged_song;
+	DetachedSong *tagged_song = nullptr;
 
 	uint16_t bit_rate;
 	AudioFormat audio_format;
@@ -163,7 +163,7 @@ struct PlayerControl {
 	 * This is a duplicate, and must be freed when this attribute
 	 * is cleared.
 	 */
-	DetachedSong *next_song;
+	DetachedSong *next_song = nullptr;
 
 	SongTime seek_time;
 
@@ -172,7 +172,7 @@ struct PlayerControl {
 	ReplayGainConfig replay_gain_config;
 	ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
 
-	double total_play_time;
+	double total_play_time = 0;
 
 	/**
 	 * If this flag is set, then the player will be auto-paused at
@@ -181,7 +181,7 @@ struct PlayerControl {
 	 * This is a copy of the queue's "single" flag most of the
 	 * time.
 	 */
-	bool border_pause;
+	bool border_pause = false;
 
 	PlayerControl(PlayerListener &_listener,
 		      MultipleOutputs &_outputs,