You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -39,12 +39,10 @@ AAssetManager *FileAccessAndroid::asset_manager = nullptr;
|
||||
}*/
|
||||
|
||||
FileAccess *FileAccessAndroid::create_android() {
|
||||
|
||||
return memnew(FileAccessAndroid);
|
||||
}
|
||||
|
||||
Error FileAccessAndroid::_open(const String &p_path, int p_mode_flags) {
|
||||
|
||||
String path = fix_path(p_path).simplify_path();
|
||||
if (path.begins_with("/"))
|
||||
path = path.substr(1, path.length());
|
||||
@@ -64,7 +62,6 @@ Error FileAccessAndroid::_open(const String &p_path, int p_mode_flags) {
|
||||
}
|
||||
|
||||
void FileAccessAndroid::close() {
|
||||
|
||||
if (!a)
|
||||
return;
|
||||
AAsset_close(a);
|
||||
@@ -72,12 +69,10 @@ void FileAccessAndroid::close() {
|
||||
}
|
||||
|
||||
bool FileAccessAndroid::is_open() const {
|
||||
|
||||
return a != nullptr;
|
||||
}
|
||||
|
||||
void FileAccessAndroid::seek(size_t p_position) {
|
||||
|
||||
ERR_FAIL_COND(!a);
|
||||
AAsset_seek(a, p_position, SEEK_SET);
|
||||
pos = p_position;
|
||||
@@ -90,29 +85,24 @@ void FileAccessAndroid::seek(size_t p_position) {
|
||||
}
|
||||
|
||||
void FileAccessAndroid::seek_end(int64_t p_position) {
|
||||
|
||||
ERR_FAIL_COND(!a);
|
||||
AAsset_seek(a, p_position, SEEK_END);
|
||||
pos = len + p_position;
|
||||
}
|
||||
|
||||
size_t FileAccessAndroid::get_position() const {
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
size_t FileAccessAndroid::get_len() const {
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
bool FileAccessAndroid::eof_reached() const {
|
||||
|
||||
return eof;
|
||||
}
|
||||
|
||||
uint8_t FileAccessAndroid::get_8() const {
|
||||
|
||||
if (pos >= len) {
|
||||
eof = true;
|
||||
return 0;
|
||||
@@ -125,7 +115,6 @@ uint8_t FileAccessAndroid::get_8() const {
|
||||
}
|
||||
|
||||
int FileAccessAndroid::get_buffer(uint8_t *p_dst, int p_length) const {
|
||||
|
||||
off_t r = AAsset_read(a, p_dst, p_length);
|
||||
|
||||
if (pos + p_length > len) {
|
||||
@@ -133,7 +122,6 @@ int FileAccessAndroid::get_buffer(uint8_t *p_dst, int p_length) const {
|
||||
}
|
||||
|
||||
if (r >= 0) {
|
||||
|
||||
pos += r;
|
||||
if (pos > len) {
|
||||
pos = len;
|
||||
@@ -143,22 +131,18 @@ int FileAccessAndroid::get_buffer(uint8_t *p_dst, int p_length) const {
|
||||
}
|
||||
|
||||
Error FileAccessAndroid::get_error() const {
|
||||
|
||||
return eof ? ERR_FILE_EOF : OK; //not sure what else it may happen
|
||||
}
|
||||
|
||||
void FileAccessAndroid::flush() {
|
||||
|
||||
ERR_FAIL();
|
||||
}
|
||||
|
||||
void FileAccessAndroid::store_8(uint8_t p_dest) {
|
||||
|
||||
ERR_FAIL();
|
||||
}
|
||||
|
||||
bool FileAccessAndroid::file_exists(const String &p_path) {
|
||||
|
||||
String path = fix_path(p_path).simplify_path();
|
||||
if (path.begins_with("/"))
|
||||
path = path.substr(1, path.length());
|
||||
|
||||
Reference in New Issue
Block a user