From 8b12036ad518a0f669878699ead03f22b8dc11aa Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Fri, 19 Jun 2020 19:11:14 -0400 Subject: [PATCH] Ensure members are initialized --- core/io/file_access_buffered.h | 2 +- core/io/file_access_encrypted.h | 4 ++-- core/io/file_access_memory.h | 4 ++-- core/io/pck_packer.h | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/io/file_access_buffered.h b/core/io/file_access_buffered.h index 99d5ce903d87..8ee01e256b1f 100644 --- a/core/io/file_access_buffered.h +++ b/core/io/file_access_buffered.h @@ -45,7 +45,7 @@ class FileAccessBuffered : public FileAccess { int cache_size = DEFAULT_CACHE_SIZE; int cache_data_left() const; - mutable Error last_error; + mutable Error last_error = OK; protected: Error set_error(Error p_error) const; diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h index e269c1e30c74..92c44e1d88ca 100644 --- a/core/io/file_access_encrypted.h +++ b/core/io/file_access_encrypted.h @@ -46,8 +46,8 @@ class FileAccessEncrypted : public FileAccess { Vector key; bool writing = false; FileAccess *file = nullptr; - size_t base; - size_t length; + size_t base = 0; + size_t length = 0; Vector data; mutable int pos = 0; mutable bool eofed = false; diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h index 1a9bd3fbbbca..47012b4e834b 100644 --- a/core/io/file_access_memory.h +++ b/core/io/file_access_memory.h @@ -35,8 +35,8 @@ class FileAccessMemory : public FileAccess { uint8_t *data = nullptr; - int length; - mutable int pos; + int length = 0; + mutable int pos = 0; static FileAccess *create(); diff --git a/core/io/pck_packer.h b/core/io/pck_packer.h index 2929967a68ca..7727ad42543a 100644 --- a/core/io/pck_packer.h +++ b/core/io/pck_packer.h @@ -39,15 +39,15 @@ class PCKPacker : public Reference { GDCLASS(PCKPacker, Reference); FileAccess *file = nullptr; - int alignment; + int alignment = 0; static void _bind_methods(); struct File { String path; String src_path; - int size; - uint64_t offset_offset; + int size = 0; + uint64_t offset_offset = 0; }; Vector files;