From 051cdc96706f57c6b7416305bd9b9cef2a54a036 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 23 Nov 2016 18:04:23 +0100 Subject: [PATCH] MusicPipe: use C++11 initializers --- src/MusicPipe.hxx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/MusicPipe.hxx b/src/MusicPipe.hxx index f85cf0be0..07f69f3ad 100644 --- a/src/MusicPipe.hxx +++ b/src/MusicPipe.hxx @@ -38,31 +38,26 @@ class MusicBuffer; */ class MusicPipe { /** the first chunk */ - MusicChunk *head; + MusicChunk *head = nullptr; /** a pointer to the tail of the chunk */ - MusicChunk **tail_r; + MusicChunk **tail_r = &head; /** the current number of chunks */ - unsigned size; + unsigned size = 0; /** a mutex which protects #head and #tail_r */ mutable Mutex mutex; #ifndef NDEBUG - AudioFormat audio_format; + AudioFormat audio_format = AudioFormat::Undefined(); #endif public: /** * Creates a new #MusicPipe object. It is empty. */ - MusicPipe() - :head(nullptr), tail_r(&head), size(0) { -#ifndef NDEBUG - audio_format.Clear(); -#endif - } + MusicPipe() = default; /** * Frees the object. It must be empty now.