1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-30 16:26:50 +00:00

Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks

This commit is contained in:
Rémi Verschelde
2021-05-04 14:41:06 +02:00
parent 64a63e0861
commit b5e1e05ef2
1439 changed files with 1 additions and 34187 deletions

View File

@@ -37,7 +37,6 @@
static Map<String, Vector<uint8_t>> *files = NULL;
void FileAccessMemory::register_file(String p_name, Vector<uint8_t> p_data) {
if (!files) {
files = memnew((Map<String, Vector<uint8_t>>));
}
@@ -53,7 +52,6 @@ void FileAccessMemory::register_file(String p_name, Vector<uint8_t> p_data) {
}
void FileAccessMemory::cleanup() {
if (!files)
return;
@@ -61,12 +59,10 @@ void FileAccessMemory::cleanup() {
}
FileAccess *FileAccessMemory::create() {
return memnew(FileAccessMemory);
}
bool FileAccessMemory::file_exists(const String &p_name) {
String name = fix_path(p_name);
//name = DirAccess::normalize_path(name);
@@ -74,7 +70,6 @@ bool FileAccessMemory::file_exists(const String &p_name) {
}
Error FileAccessMemory::open_custom(const uint8_t *p_data, int p_len) {
data = (uint8_t *)p_data;
length = p_len;
pos = 0;
@@ -82,7 +77,6 @@ Error FileAccessMemory::open_custom(const uint8_t *p_data, int p_len) {
}
Error FileAccessMemory::_open(const String &p_path, int p_mode_flags) {
ERR_FAIL_COND_V(!files, ERR_FILE_NOT_FOUND);
String name = fix_path(p_path);
@@ -99,46 +93,38 @@ Error FileAccessMemory::_open(const String &p_path, int p_mode_flags) {
}
void FileAccessMemory::close() {
data = NULL;
}
bool FileAccessMemory::is_open() const {
return data != NULL;
}
void FileAccessMemory::seek(size_t p_position) {
ERR_FAIL_COND(!data);
pos = p_position;
}
void FileAccessMemory::seek_end(int64_t p_position) {
ERR_FAIL_COND(!data);
pos = length + p_position;
}
size_t FileAccessMemory::get_position() const {
ERR_FAIL_COND_V(!data, 0);
return pos;
}
size_t FileAccessMemory::get_len() const {
ERR_FAIL_COND_V(!data, 0);
return length;
}
bool FileAccessMemory::eof_reached() const {
return pos > length;
}
uint8_t FileAccessMemory::get_8() const {
uint8_t ret = 0;
if (pos < length) {
ret = data[pos];
@@ -167,7 +153,6 @@ int FileAccessMemory::get_buffer(uint8_t *p_dst, int p_length) const {
}
Error FileAccessMemory::get_error() const {
return pos >= length ? ERR_FILE_EOF : OK;
}
@@ -176,14 +161,12 @@ void FileAccessMemory::flush() {
}
void FileAccessMemory::store_8(uint8_t p_byte) {
ERR_FAIL_COND(!data);
ERR_FAIL_COND(pos >= length);
data[pos++] = p_byte;
}
void FileAccessMemory::store_buffer(const uint8_t *p_src, int p_length) {
int left = length - pos;
int write = MIN(p_length, left);
if (write < p_length) {
@@ -195,6 +178,5 @@ void FileAccessMemory::store_buffer(const uint8_t *p_src, int p_length) {
}
FileAccessMemory::FileAccessMemory() {
data = NULL;
}