diff --git a/tdutils/td/utils/buffer.h b/tdutils/td/utils/buffer.h index f65019606..0d81538e7 100644 --- a/tdutils/td/utils/buffer.h +++ b/tdutils/td/utils/buffer.h @@ -20,23 +20,22 @@ namespace td { struct BufferRaw { - explicit BufferRaw(size_t size) - : data_size_(size), begin_(0), end_(0), ref_cnt_(1), has_writer_(true), was_reader_(false) { + explicit BufferRaw(size_t size) : data_size_(size) { } size_t data_size_; // Constant after first reader is created. // May be change by writer before it. // So writer may do prepends till there is no reader created. - size_t begin_; + size_t begin_ = 0; // Write by writer. // Read by reader. - std::atomic end_; + std::atomic end_{0}; - mutable std::atomic ref_cnt_; - std::atomic has_writer_; - bool was_reader_; + mutable std::atomic ref_cnt_{1}; + std::atomic has_writer_{true}; + bool was_reader_{false}; alignas(4) unsigned char data_[1]; }; diff --git a/tdutils/td/utils/filesystem.h b/tdutils/td/utils/filesystem.h index 6fff63f8d..ae6d6aef1 100644 --- a/tdutils/td/utils/filesystem.h +++ b/tdutils/td/utils/filesystem.h @@ -20,4 +20,5 @@ Status copy_file(CSlice from, CSlice to, int64 size = -1) TD_WARN_UNUSED_RESULT; Status write_file(CSlice to, Slice data) TD_WARN_UNUSED_RESULT; std::string clean_filename(CSlice name); + } // namespace td