Initialize class/struct variables with default values in core/ and drivers/

This commit is contained in:
Rafał Mikrut
2020-11-23 17:38:46 +01:00
parent 18023cc3ed
commit 7bd03b7188
34 changed files with 221 additions and 228 deletions

View File

@@ -73,7 +73,7 @@ public:
private:
friend class HashMap;
uint32_t hash;
uint32_t hash = 0;
Element *next = nullptr;
Element() {}
Pair pair;

View File

@@ -137,9 +137,9 @@ public:
private:
struct _Data {
Element *first;
Element *last;
int size_cache;
Element *first = nullptr;
Element *last = nullptr;
int size_cache = 0;
bool erase(const Element *p_I) {
ERR_FAIL_COND_V(!p_I, false);

View File

@@ -165,7 +165,7 @@ uint64_t atomic_exchange_if_greater(volatile uint64_t *pw, volatile uint64_t val
#endif
struct SafeRefCount {
uint32_t count;
uint32_t count = 0;
public:
// destroy() is called when weak_count_ drops to zero.

View File

@@ -80,7 +80,7 @@ public:
private:
struct _Data {
Element *_root = nullptr;
Element *_nil;
Element *_nil = nullptr;
int size_cache = 0;
_FORCE_INLINE_ _Data() {

View File

@@ -41,8 +41,8 @@ class ThreadWorkPool {
std::atomic<uint32_t> index;
struct BaseWork {
std::atomic<uint32_t> *index;
uint32_t max_elements;
std::atomic<uint32_t> *index = nullptr;
uint32_t max_elements = 0;
virtual void work() = 0;
virtual ~BaseWork() = default;
};