From 85b6a526622e2bbd08da7c29f231e83d15a318b9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 11 Jul 2016 22:44:39 +0200 Subject: [PATCH] decoder/flac: use C++11 initializers --- src/decoder/plugins/FlacCommon.cxx | 8 -------- src/decoder/plugins/FlacCommon.hxx | 10 ++++++---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/decoder/plugins/FlacCommon.cxx b/src/decoder/plugins/FlacCommon.cxx index 943225328..634433f7a 100644 --- a/src/decoder/plugins/FlacCommon.cxx +++ b/src/decoder/plugins/FlacCommon.cxx @@ -29,14 +29,6 @@ #include "util/Error.hxx" #include "Log.hxx" -FlacDecoder::FlacDecoder(Decoder &_decoder, - InputStream &_input_stream) - :FlacInput(_input_stream, &_decoder), - initialized(false), unsupported(false), - position(0) -{ -} - static SampleFormat flac_sample_format(unsigned bits_per_sample) { diff --git a/src/decoder/plugins/FlacCommon.hxx b/src/decoder/plugins/FlacCommon.hxx index 6d0eddd79..6cb775572 100644 --- a/src/decoder/plugins/FlacCommon.hxx +++ b/src/decoder/plugins/FlacCommon.hxx @@ -41,12 +41,12 @@ struct FlacDecoder : public FlacInput { /** * Has decoder_initialized() been called yet? */ - bool initialized; + bool initialized = false; /** * Does the FLAC file contain an unsupported audio format? */ - bool unsupported; + bool unsupported = false; /** * The validated audio format of the FLAC file. This @@ -58,11 +58,13 @@ struct FlacDecoder : public FlacInput { * End of last frame's position within the stream. This is * used for bit rate calculations. */ - FLAC__uint64 position; + FLAC__uint64 position = 0; Tag tag; - FlacDecoder(Decoder &decoder, InputStream &input_stream); + + FlacDecoder(Decoder &_decoder, InputStream &_input_stream) + :FlacInput(_input_stream, &_decoder) {} /** * Wrapper for decoder_initialized().