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

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