input/InputStream: use C++11 initializers

This commit is contained in:
Max Kellermann 2017-12-26 11:32:36 +01:00
parent 078839c711
commit 82a79565de
4 changed files with 9 additions and 13 deletions

View File

@ -22,8 +22,7 @@
#include "tag/Tag.hxx" #include "tag/Tag.hxx"
IcyInputStream::IcyInputStream(InputStream *_input) IcyInputStream::IcyInputStream(InputStream *_input)
:ProxyInputStream(_input), :ProxyInputStream(_input)
override_offset(0)
{ {
} }

View File

@ -44,7 +44,7 @@ class IcyInputStream final : public ProxyInputStream {
*/ */
std::unique_ptr<Tag> icy_tag; std::unique_ptr<Tag> icy_tag;
offset_type override_offset; offset_type override_offset = 0;
public: public:
IcyInputStream(InputStream *_input); IcyInputStream(InputStream *_input);

View File

@ -70,24 +70,24 @@ protected:
* indicates whether the stream is ready for reading and * indicates whether the stream is ready for reading and
* whether the other attributes in this struct are valid * whether the other attributes in this struct are valid
*/ */
bool ready; bool ready = false;
/** /**
* if true, then the stream is fully seekable * if true, then the stream is fully seekable
*/ */
bool seekable; bool seekable = false;
static constexpr offset_type UNKNOWN_SIZE = -1; static constexpr offset_type UNKNOWN_SIZE = -1;
/** /**
* the size of the resource, or #UNKNOWN_SIZE if unknown * the size of the resource, or #UNKNOWN_SIZE if unknown
*/ */
offset_type size; offset_type size = UNKNOWN_SIZE;
/** /**
* the current offset within the stream * the current offset within the stream
*/ */
offset_type offset; offset_type offset = 0;
private: private:
/** /**
@ -98,9 +98,7 @@ private:
public: public:
InputStream(const char *_uri, Mutex &_mutex, Cond &_cond) InputStream(const char *_uri, Mutex &_mutex, Cond &_cond)
:uri(_uri), :uri(_uri),
mutex(_mutex), cond(_cond), mutex(_mutex), cond(_cond) {
ready(false), seekable(false),
size(UNKNOWN_SIZE), offset(0) {
assert(_uri != nullptr); assert(_uri != nullptr);
} }

View File

@ -34,7 +34,7 @@ class RewindInputStream final : public ProxyInputStream {
/** /**
* The write/append position within the buffer. * The write/append position within the buffer.
*/ */
size_t tail; size_t tail = 0;
/** /**
* The size of this buffer is the maximum number of bytes * The size of this buffer is the maximum number of bytes
@ -48,8 +48,7 @@ class RewindInputStream final : public ProxyInputStream {
public: public:
RewindInputStream(InputStream *_input) RewindInputStream(InputStream *_input)
:ProxyInputStream(_input), :ProxyInputStream(_input) {
tail(0) {
} }
/* virtual methods from InputStream */ /* virtual methods from InputStream */