소스 검색

Ensure FileAccessBuffered structs are properly initialized

Andy Maloney 5 년 전
부모
커밋
37a2a5a997
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 5
      core/io/file_access_buffered.h

+ 5 - 5
core/io/file_access_buffered.h

@@ -51,16 +51,16 @@ protected:
 	Error set_error(Error p_error) const;
 	Error set_error(Error p_error) const;
 
 
 	mutable struct File {
 	mutable struct File {
-		bool open;
-		int size;
-		int offset;
+		bool open = false;
+		int size = 0;
+		int offset = 0;
 		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 = nullptr) const = 0;
 	virtual int read_data_block(int p_offset, int p_size, uint8_t *p_dest = nullptr) const = 0;