summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-11-24 13:00:27 +0100
committerGitHub <noreply@github.com>2020-11-24 13:00:27 +0100
commit32b31a5fa47b1e068be98f3196cf5d83a2260667 (patch)
tree1216c119f5326964d34d9cab2ab78df911c1469f /core/io
parent4159baff6c564eaaec1cbe1e546805dd42b9148f (diff)
parent7bd03b718871137740c6bf074e984bba8dc113c3 (diff)
Merge pull request #43730 from qarmin/core_drivers_default_values
Initialize class/struct variables with default values in core/ and drivers/
Diffstat (limited to 'core/io')
-rw-r--r--core/io/file_access_encrypted.h4
-rw-r--r--core/io/file_access_memory.h4
-rw-r--r--core/io/packed_data_container.h2
-rw-r--r--core/io/pck_packer.h8
4 files changed, 9 insertions, 9 deletions
diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h
index fddc6842f3..c760933038 100644
--- a/core/io/file_access_encrypted.h
+++ b/core/io/file_access_encrypted.h
@@ -47,8 +47,8 @@ private:
Vector<uint8_t> key;
bool writing = false;
FileAccess *file = nullptr;
- size_t base;
- size_t length;
+ size_t base = 0;
+ size_t length = 0;
Vector<uint8_t> 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 1a9bd3fbbb..47012b4e83 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/packed_data_container.h b/core/io/packed_data_container.h
index b784abcd16..3899c14bb4 100644
--- a/core/io/packed_data_container.h
+++ b/core/io/packed_data_container.h
@@ -84,7 +84,7 @@ class PackedDataContainerRef : public Reference {
GDCLASS(PackedDataContainerRef, Reference);
friend class PackedDataContainer;
- uint32_t offset;
+ uint32_t offset = 0;
Ref<PackedDataContainer> from;
protected:
diff --git a/core/io/pck_packer.h b/core/io/pck_packer.h
index c1026c2499..56be1b52df 100644
--- a/core/io/pck_packer.h
+++ b/core/io/pck_packer.h
@@ -39,7 +39,7 @@ class PCKPacker : public Reference {
GDCLASS(PCKPacker, Reference);
FileAccess *file = nullptr;
- int alignment;
+ int alignment = 0;
uint64_t ofs = 0;
Vector<uint8_t> key;
@@ -50,9 +50,9 @@ class PCKPacker : public Reference {
struct File {
String path;
String src_path;
- uint64_t ofs;
- uint64_t size;
- bool encrypted;
+ uint64_t ofs = 0;
+ uint64_t size = 0;
+ bool encrypted = false;
Vector<uint8_t> md5;
};
Vector<File> files;