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/command_queue_mt.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'core/command_queue_mt.h') diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h index 2f2b3b783c..af8bbb24c6 100644 --- a/core/command_queue_mt.h +++ b/core/command_queue_mt.h @@ -301,14 +301,14 @@ class CommandQueueMT { struct SyncSemaphore { Semaphore sem; - bool in_use; + bool in_use = false; }; struct CommandBase { virtual void call() = 0; - virtual void post(){}; - virtual ~CommandBase(){}; + virtual void post() {} + virtual ~CommandBase() {} }; struct SyncCommand : public CommandBase { @@ -339,13 +339,13 @@ class CommandQueueMT { SYNC_SEMAPHORES = 8 }; - uint8_t *command_mem; - uint32_t read_ptr; - uint32_t write_ptr; - uint32_t dealloc_ptr; + uint8_t *command_mem = (uint8_t *)memalloc(COMMAND_MEM_SIZE); + uint32_t read_ptr = 0; + uint32_t write_ptr = 0; + uint32_t dealloc_ptr = 0; SyncSemaphore sync_sems[SYNC_SEMAPHORES]; Mutex mutex; - Semaphore *sync; + Semaphore *sync = nullptr; template T *allocate() { -- cgit v1.2.3