From 1f6f364a56319eabd02c050746fe7df3f55ffee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 12 May 2020 17:01:17 +0200 Subject: Port member initialization from constructor to declaration (C++11) Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists. --- core/io/file_access_network.h | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'core/io/file_access_network.h') diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h index 7f664b46f7..6cdd6af0b4 100644 --- a/core/io/file_access_network.h +++ b/core/io/file_access_network.h @@ -50,13 +50,14 @@ class FileAccessNetworkClient { List block_requests; Semaphore sem; - Thread *thread; - bool quit; + Thread *thread = nullptr; + bool quit = false; Mutex mutex; Mutex blockrequest_mutex; Map accesses; Ref client; - int last_id; + int last_id = 0; + int lockcount = 0; Vector block; @@ -67,7 +68,6 @@ class FileAccessNetworkClient { void put_64(int64_t p_64); int get_32(); int64_t get_64(); - int lockcount; void lock_mutex(); void unlock_mutex(); @@ -88,27 +88,23 @@ class FileAccessNetwork : public FileAccess { Semaphore sem; Semaphore page_sem; Mutex buffer_mutex; - bool opened; + bool opened = false; size_t total_size; - mutable size_t pos; + mutable size_t pos = 0; int id; - mutable bool eof_flag; - mutable int last_page; - mutable uint8_t *last_page_buff; + mutable bool eof_flag = false; + mutable int last_page = -1; + mutable uint8_t *last_page_buff = nullptr; int page_size; int read_ahead; - mutable int waiting_on_page; - mutable int last_activity_val; + mutable int waiting_on_page = -1; + struct Page { - int activity; - bool queued; + int activity = 0; + bool queued = false; Vector buffer; - Page() { - activity = 0; - queued = false; - } }; mutable Vector pages; -- cgit v1.2.3