Merge pull request #39683 from asmaloney/3.2-FileAccessBuffered-init

[3.2] Ensure FileAccessBuffered structs are properly initialized
This commit is contained in:
Rémi Verschelde 2020-06-19 23:44:17 +02:00 committed by GitHub
commit bd16fd9d19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 7 deletions

View File

@ -52,18 +52,16 @@ protected:
Error set_error(Error p_error) const; Error set_error(Error p_error) const;
mutable struct File { mutable struct File {
bool open = false;
bool open; int size = 0;
int size; int offset = 0;
int offset;
String name; String name;
int access_flags; int access_flags = 0;
} file; } file;
mutable struct Cache { mutable struct Cache {
Vector<uint8_t> buffer; Vector<uint8_t> buffer;
int offset; int offset = 0;
} cache; } cache;
virtual int read_data_block(int p_offset, int p_size, uint8_t *p_dest = 0) const = 0; virtual int read_data_block(int p_offset, int p_size, uint8_t *p_dest = 0) const = 0;