From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/core/file_sys/archive_backend.cpp | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'src/core/file_sys/archive_backend.cpp') diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp index cc0aa7022..6ea920ec1 100644 --- a/src/core/file_sys/archive_backend.cpp +++ b/src/core/file_sys/archive_backend.cpp @@ -12,27 +12,23 @@ #include "core/file_sys/archive_backend.h" #include "core/memory.h" - namespace FileSys { Path::Path(LowPathType type, u32 size, u32 pointer) : type(type) { switch (type) { - case Binary: - { + case Binary: { binary.resize(size); Memory::ReadBlock(pointer, binary.data(), binary.size()); break; } - case Char: - { + case Char: { string.resize(size - 1); // Data is always null-terminated. Memory::ReadBlock(pointer, &string[0], string.size()); break; } - case Wchar: - { + case Wchar: { u16str.resize(size / 2 - 1); // Data is always null-terminated. Memory::ReadBlock(pointer, &u16str[0], u16str.size() * sizeof(char16_t)); break; @@ -50,8 +46,7 @@ std::string Path::DebugStr() const { return "[Invalid]"; case Empty: return "[Empty]"; - case Binary: - { + case Binary: { std::stringstream res; res << "[Binary: "; for (unsigned byte : binary) @@ -73,13 +68,13 @@ std::string Path::AsString() const { case Wchar: return Common::UTF16ToUTF8(u16str); case Empty: - return{}; + return {}; case Invalid: case Binary: default: // TODO(yuriks): Add assert LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!"); - return{}; + return {}; } } @@ -90,12 +85,12 @@ std::u16string Path::AsU16Str() const { case Wchar: return u16str; case Empty: - return{}; + return {}; case Invalid: case Binary: // TODO(yuriks): Add assert LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!"); - return{}; + return {}; } } @@ -105,25 +100,23 @@ std::vector Path::AsBinary() const { return binary; case Char: return std::vector(string.begin(), string.end()); - case Wchar: - { + case Wchar: { // use two u8 for each character of u16str std::vector to_return(u16str.size() * 2); for (size_t i = 0; i < u16str.size(); ++i) { u16 tmp_char = u16str.at(i); - to_return[i*2] = (tmp_char & 0xFF00) >> 8; - to_return[i*2 + 1] = (tmp_char & 0x00FF); + to_return[i * 2] = (tmp_char & 0xFF00) >> 8; + to_return[i * 2 + 1] = (tmp_char & 0x00FF); } return to_return; } case Empty: - return{}; + return {}; case Invalid: default: // TODO(yuriks): Add assert LOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!"); - return{}; + return {}; } } - } -- cgit v1.2.3 From ebdae19fd226104baec712b9da9939ff82ef3c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 21 Sep 2016 00:21:23 +0900 Subject: Remove empty newlines in #include blocks. This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. --- src/core/file_sys/archive_backend.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/core/file_sys/archive_backend.cpp') diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp index 6ea920ec1..5c02fb748 100644 --- a/src/core/file_sys/archive_backend.cpp +++ b/src/core/file_sys/archive_backend.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/archive_backend.h" #include #include #include - #include "common/logging/log.h" #include "common/string_util.h" - -#include "core/file_sys/archive_backend.h" #include "core/memory.h" namespace FileSys { -- cgit v1.2.3 From 84fbbe26297652d994d203bde543ec252c2d801a Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Tue, 20 Sep 2016 23:52:38 -0700 Subject: Use negative priorities to avoid special-casing the self-include --- src/core/file_sys/archive_backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/file_sys/archive_backend.cpp') diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp index 5c02fb748..1fae0ede0 100644 --- a/src/core/file_sys/archive_backend.cpp +++ b/src/core/file_sys/archive_backend.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/archive_backend.h" #include #include #include #include "common/logging/log.h" #include "common/string_util.h" +#include "core/file_sys/archive_backend.h" #include "core/memory.h" namespace FileSys { -- cgit v1.2.3